0

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

Mnemosyne
  • 1,162
  • 4
  • 13
  • 45
  • `count` may have been an argument of `sr` in older versions, but it might not be anymore. Check the result of `help(sr)`. For version 2.4.5 I installed on my laptop, its not present. – qouify Sep 26 '21 at 07:44
  • you are right, sr does not support count explicitely anymore. – Mnemosyne Sep 26 '21 at 13:09

0 Answers0