Skip to content

Scapy does not recognize tcpreplay on Windows #2793

@adamvm

Description

@adamvm

Brief description

In Windows 10 system tcpreplay win32 binaries are present and added to path, but sendpfast returns exception

Environment

  • Scapy version: scapy 2.4.3
  • Python version: 3.7
  • Operating System: Windows 10 64-bit

How to reproduce

p = Ether() / IP(src=None, dst="192.168.255.1") / TCP(dport=23, flags='S')
sendpfast(p, pps=8000, loop=1, iface='ASIX AX88179 USB 3.0 to Gigabit Ethernet Adapter')

Actual result

Traceback (most recent call last):
  File "<input>", line 1, in <module>
NameError: name 'sendpfast' is not defined
from scapy.sendrecv import sendp, sr, sendpfast
sendpfast(p, pps=8000, loop=1, iface='ASIX AX88179 USB 3.0 to Gigabit Ethernet Adapter')
Traceback (most recent call last):
  File "C:\Robot\venv\lib\site-packages\scapy\sendrecv.py", line 385, in sendpfast
    stderr=subprocess.PIPE)
  File "C:\Python37\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Python37\lib\subprocess.py", line 1119, in _execute_child
    args = list2cmdline(args)
  File "C:\Python37\lib\subprocess.py", line 530, in list2cmdline
    needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'NoneType' is not iterable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Robot\venv\lib\site-packages\scapy\sendrecv.py", line 398, in sendpfast
    log_runtime.info(stdout.decode())
  File "C:\Robot\venv\lib\site-packages\scapy\utils.py", line 555, in __exit__
    raise OSError(msg)
OSError: Could not execute sendpfast(), is it installed ?
sendpfast(p, pps=8000, loop=1, iface='ASIX AX88179 USB 3.0 to Gigabit Ethernet Adapter')
Traceback (most recent call last):
  File "C:\Robot\venv\lib\site-packages\scapy\sendrecv.py", line 385, in sendpfast
    stderr=subprocess.PIPE)
  File "C:\Python37\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Python37\lib\subprocess.py", line 1119, in _execute_child
    args = list2cmdline(args)
  File "C:\Python37\lib\subprocess.py", line 530, in list2cmdline
    needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'NoneType' is not iterable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Robot\venv\lib\site-packages\scapy\sendrecv.py", line 398, in sendpfast
    log_runtime.info(stdout.decode())
  File "C:\Robot\venv\lib\site-packages\scapy\utils.py", line 555, in __exit__
    raise OSError(msg)
OSError: Could not execute sendpfast(), is it installed ?

Expected result

packets should be sent

Related resources

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions