GithubHelp home page GithubHelp logo

dns-flow's People

Contributors

meow-watermelon avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

qwazgen

dns-flow's Issues

crash due to UnboundLocalError exception

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.