phaethon / kamene

Network packet and pcap file crafting/sniffing/manipulation/visualization security tool. Originally forked from scapy in 2015 and providing python3 compatibility since then.
GNU General Public License v2.0
868 stars 191 forks source link

[technical support / bug report] traceroute() not work #227

Closed kmahyyg closed 6 years ago

kmahyyg commented 6 years ago
kmahyyg@PatrickY:~/Desktop$ sudo python3
[sudo] kmahyyg's Password:
Python 3.5.4rc1 (default, Jul 25 2017, 08:53:34) 
[GCC 6.4.0 20170704] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from scapy.layers.inet import traceroute
WARNING: Failed to execute tcpdump. Check it is installed and in the PATH
>>> traceroute()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: traceroute() missing 1 required positional argument: 'target'
>>> traceroute('google.com')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/scapy/layers/inet.py", line 1428, in traceroute
    timeout=timeout, filter=filter, verbose=verbose, **kargs)
  File "/usr/local/lib/python3.5/dist-packages/scapy/sendrecv.py", line 327, in sr
    a,b=sndrcv(s,x,*args,**kargs)
  File "/usr/local/lib/python3.5/dist-packages/scapy/sendrecv.py", line 55, in sndrcv
    h = i.hashret()
  File "/usr/local/lib/python3.5/dist-packages/scapy/layers/inet.py", line 465, in hashret
    return strxor(inet_aton(self.src), inet_aton(self.dst)) + struct.pack("B", self.proto) + self.payload.hashret()
  File "/usr/local/lib/python3.5/dist-packages/scapy/packet.py", line 201, in __getattr__
    return fld.i2h(self, v)
  File "/usr/local/lib/python3.5/dist-packages/scapy/fields.py", line 262, in i2h
    iff,x,gw = conf.route.route(dst)
AttributeError: 'NoneType' object has no attribute 'route'