add script to send ipv4 packet
This commit is contained in:
parent
c3ca4da4e3
commit
b8f5750464
1 changed files with 20 additions and 0 deletions
20
bin/send_packet_ipv4.py
Normal file
20
bin/send_packet_ipv4.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import sys
|
||||||
|
from scapy.all import *
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
iface = sys.argv[1]
|
||||||
|
|
||||||
|
e = Ether(src="02:53:55:42:45:01",
|
||||||
|
dst='ff:ff:ff:ff:ff:ff')
|
||||||
|
|
||||||
|
i = IP(src = "192.168.2.1", dst = "192.168.2.4")
|
||||||
|
|
||||||
|
t = TCP(dport=80, sport=random.randint(49152,65535))
|
||||||
|
|
||||||
|
d = "A"
|
||||||
|
|
||||||
|
pkg = e / i / t / d
|
||||||
|
|
||||||
|
sendp(pkg, iface=iface, verbose=True)
|
Loading…
Reference in a new issue