dnschef icon indicating copy to clipboard operation
dnschef copied to clipboard

dnslib.dns.DNSError: QTYPE: Invalid forward lookup: [65]

Open y2k04 opened this issue 5 years ago • 1 comments

----------------------------------------
Exception happened during processing of request from ('192.168.137.81', 61732)
(19:19:06) [*] 192.168.137.81: cooking the response of type 'A' for gsp85-ssl.ls.apple.com to 192.168.137.1
(19:19:06) [*] 192.168.137.81: cooking the response of type 'A' for clients4.google.com to 192.168.137.1
(19:19:06) [*] 192.168.137.81: cooking the response of type 'A' for www.google.com to 192.168.137.1
Traceback (most recent call last):
  File "C:\Users\oheal\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\dnslib\bimap.py", line 66, in __getitem__
    return self.forward[k]
KeyError: 65

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
(19:19:06) [*] 192.168.137.81: cooking the response of type 'A' for www.apple.com to 192.168.137.1
Traceback (most recent call last):
  File "C:\Users\oheal\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\dnslib\bimap.py", line 66, in __getitem__
    return self.forward[k]
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\socketserver.py", line 650, in process_request_thread
    self.finish_request(request, client_address)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\socketserver.py", line 720, in __init__
    self.handle()
KeyError: 65
  File "dnschef.py", line 356, in handle
    response = self.parse(data)
  File "dnschef.py", line 110, in parse
    qtype = QTYPE[d.q.qtype]

How would I fix this? My command line arguments are: python dnschef.py --fakeip 192.168.137.1 --interface 192.168.137.1 --nameservers 192.168.137.1 -q

y2k04 avatar Sep 20 '20 09:09 y2k04

In case anybody else gets this, this is a bug in dnslib, this worked for me:

sudo apt install python3-dnslib

7a avatar Feb 07 '22 13:02 7a