nixers
Diagnose my Python/Scapy errors anyone? - Printable Version
+- nixers (https://nixers.net)
+-- Forum: Development & Graphics (https://nixers.net/Forum-Development-Graphics)
+--- Forum: Programming On Unix (https://nixers.net/Forum-Programming-On-Unix)
+--- Thread: Diagnose my Python/Scapy errors anyone? (/Thread-Diagnose-my-Python-Scapy-errors-anyone)


Diagnose my Python/Scapy errors anyone? - Derby - 28-08-2013

Had trouble with my Debian partition so thought it would be best to make the inevitable change to Kali (I know, no one will think this is a good idea but I mainly use Linux for pen testing anyway)

Anyway, I am attempting IPv6 packets on Scapy with a very basic script so far it gives the same error if I run through the commands in the Scapy interface as if I run the Python code.

The code I get is as follows:

Code:
import logging
import sys
from scapy.all import *

conf.iface='eth0'
conf.route6.add(dst="fe80::60c:ceff:fee2:d4fe", gw="fe80::21f:c6ff:fe5d:8a38")
print conf.route6
i=IPv6()
i.dst="fe80::60c:ceff:fee2:d4fe"
i.src="fe80::21f:c6ff:fe5d:8a38"
i.display()
q=ICMPv6EchoRequest(data = "lol")
q.display()
p=(i/q)
reply=sr1(p)
reply.show()

The errors I get are as follows:

Code:
WARNING: No route found for IPv6 destination :: (no default route?)
Destination                   Next Hop                  iface  src candidates          
fe80::/64                     ::                        eth0   fe80::21f:c6ff:fe5d:8a38
::1/128                       ::                        lo     ::1                    
fe80::21f:c6ff:fe5d:8a38/128  ::                        lo     ::1                    
fe80::60c:ceff:fee2:d4fe/128  fe80::21f:c6ff:fe5d:8a38  lo     :, :, 1                
###[ IPv6 ]###
  version   = 6
  tc        = 0
  fl        = 0
  plen      = None
  nh        = No Next Header
  hlim      = 64
  src       = fe80::21f:c6ff:fe5d:8a38
  dst       = fe80::60c:ceff:fee2:d4fe
###[ ICMPv6 Echo Request ]###
  type      = Echo Request
  code      = 0
  cksum     = None
  id        = 0x0
  seq       = 0x0
  data      = 'lol'
Begin emission:
ERROR: --- Error in child 10355
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/scapy/sendrecv.py", line 89, in sndrcv
    pks.send(p)
  File "/usr/local/lib/python2.7/dist-packages/scapy/arch/linux.py", line 375, in send
    iff,a,gw  = x.route()
  File "/usr/local/lib/python2.7/dist-packages/scapy/layers/inet6.py", line 356, in route
    return conf.route6.route(dst)
  File "/usr/local/lib/python2.7/dist-packages/scapy/route6.py", line 232, in route
    srcaddr = get_source_addr_from_candidate_set(dst, p[1][1])
  File "/usr/local/lib/python2.7/dist-packages/scapy/utils6.py", line 144, in get_source_addr_from_candidate_set
    candidate_set.sort(cmp=rfc3484_cmp, reverse=True)
AttributeError: 'str' object has no attribute 'sort'

I am running rather late on the thesis the Scapy code implementation will be for (I have a week to implement, document, evaluate and conclude) so if ANYONE has suggestions as to how to remedy this I will be eternally grateful.

If anymore information is needed I'll be happy to provide.

Thanks,

Lux


RE: Diagnose my Python/Scapy errors anyone? - Derby - 28-08-2013

These errors have been fixed.

However, the code now fails often with a time out which I'm guessing is ICMPv6 rate limiting.

If anyone could hazard a better guess as to the problem or knows how to disable rate limiting on any OS it would be helpful!


RE: Diagnose my Python/Scapy errors anyone? - venam - 29-08-2013

If you are on Linux you might want to take a look at /proc/sys/net/ipv6/ .


RE: Diagnose my Python/Scapy errors anyone? - Derby - 29-08-2013

One target OS and the source is Linux, will have a little look at that, thanks!


RE: Diagnose my Python/Scapy errors anyone? - Derby - 29-08-2013

I'm sorry in my haste to push forward I hadn't mentioned here that the issue was using WLAN and through using ethernet I've managed to fixed the issue of not getting responses.