Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

traceroute and mtr fail with NoneType' object has no attribute 'route' #258

Open
sherif84 opened this issue Nov 8, 2018 · 0 comments
Open

Comments

@sherif84
Copy link

sherif84 commented Nov 8, 2018

i'm trying to utilize the traceroute and mtr function, however I consistently get an error

AttributeError: 'NoneType' object has no attribute 'route'

it works fine with the scapy package but fails with kamene

kamene version : 0.32
Scapy : 2.4.0

>>> from kamene.layers import inet
>>> import kamene
>>> kamene.layers.inet.traceroute(["www.microsoft.com"])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/virtualenvs/owl/lib/python3.4/site-packages/kamene/layers/inet.py", line 1428, in traceroute
    timeout=timeout, filter=filter, verbose=verbose, **kargs)
  File "/home/user/virtualenvs/owl/lib/python3.4/site-packages/kamene/sendrecv.py", line 332, in sr
    a,b=sndrcv(s,x,*args,**kargs)
  File "/home/user/virtualenvs/owl/lib/python3.4/site-packages/kamene/sendrecv.py", line 55, in sndrcv
    h = i.hashret()
  File "/home/user/virtualenvs/owl/lib/python3.4/site-packages/kamene/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 "/home/user/virtualenvs/owl/lib/python3.4/site-packages/kamene/packet.py", line 201, in __getattr__
    return fld.i2h(self, v)
  File "/home/user/virtualenvs/owl/lib/python3.4/site-packages/kamene/fields.py", line 259, in i2h
    iff,x,gw = conf.route.route(dst)
AttributeError: 'NoneType' object has no attribute 'route'
>>> from scapy.layers import inet
>>> import scapy
>>> scapy.layers.inet.traceroute(["www.microsoft.com"])
Begin emission:
***Finished sending 30 packets.
****
Received 7 packets, got 7 answers, remaining 22 packets
   23.211.101.235:tcp80
2  172.28.95.226   11
8  64.125.30.194   11
21 23.211.101.235  SA
27 23.211.101.235  SA
28 23.211.101.235  SA
29 23.211.101.235  SA
30 23.211.101.235  SA
(<Traceroute: TCP:5 UDP:0 ICMP:2 Other:0>, <Unanswered: TCP:23 UDP:0 ICMP:0 Other:0>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant