meow-watermelon / dns-flow Goto Github PK
View Code? Open in Web Editor NEWDNS Traffic Flow Sniffer
DNS Traffic Flow Sniffer
some responses can crash the process due to UnboundLocalError
exception:
Sat, 19 Nov 2022 16:01:11 +0000 UDP RESPONSE 50022 ServFail
###[ Ethernet ]###
dst = <masked>
src = <masked>
type = IPv4
###[ IP ]###
version = 4
ihl = 5
tos = 0xc0
len = 105
id = 8510
flags =
frag = 0
ttl = 64
proto = icmp
chksum = 0xd47b
src = 192.168.1.102
dst = 192.168.1.100
\options \
###[ ICMP ]###
type = dest-unreach
code = port-unreachable
chksum = 0x8162
reserved = 0
length = 0
nexthopmtu= 0
unused = ''
###[ IP in ICMP ]###
version = 4
ihl = 5
tos = 0x0
len = 77
id = 63282
flags =
frag = 0
ttl = 64
proto = udp
chksum = 0xff52
src = 192.168.1.100
dst = 192.168.1.102
\options \
###[ UDP in ICMP ]###
sport = domain
dport = 46760
len = 57
chksum = 0x362f
###[ DNS ]###
id = 50022
qr = 1
opcode = QUERY
aa = 0
tc = 0
rd = 1
ra = 1
z = 0
ad = 0
cd = 0
rcode = server-failure
qdcount = 1
ancount = 0
nscount = 0
arcount = 0
\qd \
|###[ DNS Question Record ]###
| qname = 'copr-be.cloud.fedoraproject.org.'
| qtype = AAAA
| qclass = IN
an = None
ns = None
ar = None
None
Traceback (most recent call last):
File "/home/ericlee/Projects/git/dns-flow/./dns-flow.py", line 122, in process_payload
print(f'{timestamp}\t{dns_upper_layer}\tRESPONSE\t{dns_id}\t{dns_rcode_text}')
UnboundLocalError: local variable 'dns_upper_layer' referenced before assignment
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ericlee/Projects/git/dns-flow/./dns-flow.py", line 164, in <module>
sniff(iface=args.interface, lfilter=lambda p: process_payload(p))
File "/usr/lib/python3.10/site-packages/scapy/sendrecv.py", line 1263, in sniff
sniffer._run(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/scapy/sendrecv.py", line 1206, in _run
if lfilter and not lfilter(p):
File "/home/ericlee/Projects/git/dns-flow/./dns-flow.py", line 164, in <lambda>
sniff(iface=args.interface, lfilter=lambda p: process_payload(p))
File "/home/ericlee/Projects/git/dns-flow/./dns-flow.py", line 125, in process_payload
raise Exception
Exception
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.