Diagnose my Python/Scapy errors anyone? - Programming On Unix

Users browsing this thread: 1 Guest(s)
Long time nixers
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:

import logging
import sys
from scapy.all import *

conf.route6.add(dst="fe80::60c:ceff:fee2:d4fe", gw="fe80::21f:c6ff:fe5d:8a38")
print conf.route6
q=ICMPv6EchoRequest(data = "lol")

The errors I get are as follows:

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
  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.


Long time nixers
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!
If you are on Linux you might want to take a look at /proc/sys/net/ipv6/ .
Long time nixers
One target OS and the source is Linux, will have a little look at that, thanks!
Long time nixers
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.