Skip to content
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

synflood script raise a value error #74

Closed
alifiroozi80 opened this issue Nov 18, 2021 · 1 comment
Closed

synflood script raise a value error #74

alifiroozi80 opened this issue Nov 18, 2021 · 1 comment

Comments

@alifiroozi80
Copy link

hello
when i run the python synflood.py --port 80 185.73.226.46

it reurns an error:

WARNING: No IPv4 address found on en1 !
WARNING: No IPv4 address found on en2 !
WARNING: more No IPv4 address found on bridge0 !
Traceback (most recent call last):
  File "/Users/ali/Desktop/smorf/venv/lib/python3.9/site-packages/scapy/fields.py", line 236, in addfield
    return s + self.struct.pack(self.i2m(pkt, val))
struct.error: required argument is not an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ali/Desktop/smorf/synflood.py", line 35, in <module>
    send(p, loop=1, verbose=0)
  File "/Users/ali/Desktop/smorf/venv/lib/python3.9/site-packages/scapy/sendrecv.py", line 425, in send
    return _send(
  File "/Users/ali/Desktop/smorf/venv/lib/python3.9/site-packages/scapy/sendrecv.py", line 395, in _send
    results = __gen_send(socket, x, inter=inter, loop=loop,
  File "/Users/ali/Desktop/smorf/venv/lib/python3.9/site-packages/scapy/sendrecv.py", line 360, in __gen_send
    s.send(p)
  File "/Users/ali/Desktop/smorf/venv/lib/python3.9/site-packages/scapy/arch/bpf/supersocket.py", line 403, in send
    frame = raw(self.guessed_cls() / pkt)
  File "/Users/ali/Desktop/smorf/venv/lib/python3.9/site-packages/scapy/compat.py", line 279, in raw
    return bytes(x)
  File "/Users/ali/Desktop/smorf/venv/lib/python3.9/site-packages/scapy/packet.py", line 564, in __bytes__
    return self.build()
  File "/Users/ali/Desktop/smorf/venv/lib/python3.9/site-packages/scapy/packet.py", line 695, in build
    p = self.do_build()
  File "/Users/ali/Desktop/smorf/venv/lib/python3.9/site-packages/scapy/packet.py", line 678, in do_build
    pay = self.do_build_payload()
  File "/Users/ali/Desktop/smorf/venv/lib/python3.9/site-packages/scapy/packet.py", line 664, in do_build_payload
    return self.payload.do_build()
  File "/Users/ali/Desktop/smorf/venv/lib/python3.9/site-packages/scapy/packet.py", line 678, in do_build
    pay = self.do_build_payload()
  File "/Users/ali/Desktop/smorf/venv/lib/python3.9/site-packages/scapy/packet.py", line 664, in do_build_payload
    return self.payload.do_build()
  File "/Users/ali/Desktop/smorf/venv/lib/python3.9/site-packages/scapy/packet.py", line 675, in do_build
    pkt = self.self_build()
  File "/Users/ali/Desktop/smorf/venv/lib/python3.9/site-packages/scapy/packet.py", line 654, in self_build
    p = f.addfield(self, p, val)
  File "/Users/ali/Desktop/smorf/venv/lib/python3.9/site-packages/scapy/fields.py", line 238, in addfield
    raise ValueError(
ValueError: Incorrect type of value for field dport:
struct.error('required argument is not an integer')
To inject bytes into the field regardless of the type, use RawVal. See help(RawVal)
@alifiroozi80
Copy link
Author

i find out my what is my problem...

parser.add_argument("-p", "--port", help="Destination port (the port of the target's machine service, \
e.g 80 for HTTP, 22 for SSH and so on).")

have to change to this (add type=int ):

parser.add_argument("-p", "--port", type=int, help="Destination port (the port of the target's machine service, \
e.g 80 for HTTP, 22 for SSH and so on).")

for more info head over here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant