I am writing some code to send a specific amount of syn packets to a destination using the following command:
from scapy.all import *
sr(IP(dst=SERVER)/TCP(dport=80,flags='S'), count=100 )
But I always get the same error:
Traceback (most recent call last):
File "/home/kali/Desktop/tcpsflood.py", line 7, in <module>
ans = sr(IP(dst=SERVER)/TCP(dport=80,flags='S'), count=100 )
File "/usr/lib/python3/dist-packages/scapy/sendrecv.py", line 510, in sr
result = sndrcv(s, x, *args, **kargs)
File "/usr/lib/python3/dist-packages/scapy/sendrecv.py", line 278, in sndrcv
sndrcver = SndRcvHandler(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'count'
I get the same error even if instead of count
I use iter
or loop
arguments. These are allowed arguments though according to the implementation and tutorials. I am running the experiments on the latest Kali VM with python 3.9.2 and scapy 2.4.4
Can someone help figure out what is wrong with my code?
Edit: Added the import statement