Skip to content

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

Merged
merged 13 commits into from
Feb 4, 2016

Conversation

p-l-
Copy link
Member

@p-l- p-l- commented Jan 12, 2016

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.

@p-l-
Copy link
Member Author

p-l- commented Jan 24, 2016

@n1nj4sec, I have probably broken support for hosts with PowerShell installed. Mind testing? I'll test also as soon as I can.

@n1nj4sec
Copy link
Contributor

@p-l- I sent you a PR with some modifications

n1nj4sec and others added 2 commits January 29, 2016 19:28
fix support for powershell and fixed some warnings when sending packets on XP
@p-l-
Copy link
Member Author

p-l- commented Feb 3, 2016

@guedou tested and OK (ready to merge) for me.

@n1nj4sec
Copy link
Contributor

n1nj4sec commented Feb 3, 2016

awesome ! it seems good to me too.



if conf.use_winpcapy:
#mostly code from https://github.com/phaethon/scapy translated to python2.X
Copy link
Member

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.

@guedou
Copy link
Member

guedou commented Feb 4, 2016

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

p-l- added a commit that referenced this pull request Feb 4, 2016
Windows: use Winpcap, drop DNET dependency

self-merge since @guedou is OK and @n1nj4sec agrees.
@p-l- p-l- merged commit d5b2e6e into secdev:master Feb 4, 2016
@p-l- p-l- deleted the feature-winpcap branch February 4, 2016 18:01
@hsluoyz
Copy link

hsluoyz commented Jun 8, 2016

Hi.

You would like to try Npcap: https://github.com/nmap/npcap.

It's another fork of WinPcap with multiple new features.

wataash added a commit to wataash/scapy that referenced this pull request Feb 17, 2020
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
p-l- pushed a commit that referenced this pull request May 24, 2020
gpotter2 pushed a commit that referenced this pull request Jul 24, 2020
correct doc in accordance to code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants