-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Windows: use Winpcap, drop DNET dependency #1
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
Conversation
Under Windows XP, the InterfaceIndex in Win32_IP4RouteTable does not match the InterfaceIndex in Win32_NetworkAdapter, we have to use the IP addresses to match interfaces to routes.
@n1nj4sec, I have probably broken support for hosts with PowerShell installed. Mind testing? I'll test also as soon as I can. |
@p-l- I sent you a PR with some modifications |
…ngs on winXP when sending packets
fix support for powershell and fixed some warnings when sending packets on XP
@guedou tested and OK (ready to merge) for me. |
awesome ! it seems good to me too. |
|
||
|
||
if conf.use_winpcapy: | ||
#mostly code from https://github.com/phaethon/scapy translated to python2.X |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it is better to give the full link to the commit/file that was used.
It could test this code on Windows. I tried with Amazon EC2 but could not make it work. So, I will leave you guys with this responsibility =) The code looks nice, however it could be nice to make it more compliant to PEP-08 using pylint or flake8 |
Hi. You would like to try Npcap: https://github.com/nmap/npcap. It's another fork of WinPcap with multiple new features. |
Import OPENBSD symbol
errno set by pcap_open_live(3) (typically EPERM or ENXIO) was not checked, eventually causing a segmentation violation at pcap_get_selectable_fd(): $ python3 -c 'from scapy.all import *; conf.use_pcap = True; sendp("", iface="nonexist0")' fish: “python3 -c 'from scapy.all impo…” terminated by signal SIGSEGV (Address boundary error) because pcap_get_selectable_fd(3) refered to NULL: (gdb) bt #0 pcap_get_selectable_fd (p=0x0) at ./pcap.c:1419 secdev#1 0x00007f963a72781e in ffi_call_unix64 () from /lib/x86_64-linux-gnu/libffi.so.6 secdev#2 0x00007f963a7271ef in ffi_call () from /lib/x86_64-linux-gnu/libffi.so.6 secdev#3 0x00007f963b17cf49 in _call_function_pointer (flags=flags@entry=4353, pProc=pProc@entry=0x7f96382d1300 <pcap_get_selectable_fd>, avalues=0x7ffd96028bd0, atypes=<optimized out>, restype=<optimized out>, resmem=resmem@entry=0x7ffd96028be0, argcount=1) at ./Modules/_ctypes/callproc.c:827 secdev#4 0x00007f963b17d965 in _ctypes_callproc (pProc=pProc@entry=0x7f96382d1300 <pcap_get_selectable_fd>, argtuple=argtuple@entry=0x7f963b263608, flags=4353, argtypes=argtypes@entry=0x7f9638360d58, restype=restype@entry=0x18d7628, checker=checker@entry=0x0) at ./Modules/_ctypes/callproc.c:1184 secdev#5 0x00007f963b176401 in PyCFuncPtr_call (self=0x7f963836bcf0, inargs=<optimized out>, kwds=<optimized out>) at ./Modules/_ctypes/_ctypes.c:3969 secdev#6 0x000000000043730f in ?? () secdev#7 0x00007f96382823b8 in ?? () secdev#8 0x0000000000000000 in ?? () (gdb) l 1414 1415 #if !defined(_WIN32) && !defined(MSDOS) 1416 int 1417 pcap_get_selectable_fd(pcap_t *p) 1418 { 1419 return (p->selectable_fd); 1420 } 1421 #endif 1422 1423 void (gdb) p p $1 = (pcap_t *) 0x0
New IEs and fields for GTPv2 message
correct doc in accordance to code
This is bitbucket pull request #158, on behalf on @n1nj4sec.
It is augmented to support Windows XP, without the need of PowerShell.
It is not ready for merge and needs a lot of tests.