first commit
This commit is contained in:
20
Sniffing_Spoofing/Labsetup/volumes/traceroute.py
Normal file
20
Sniffing_Spoofing/Labsetup/volumes/traceroute.py
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python3
|
||||
from scapy.all import *
|
||||
|
||||
target = "8.8.8.8"
|
||||
print(f"Traceroute to {target}...")
|
||||
|
||||
for i in range(1, 31):
|
||||
pkt = IP(dst=target, ttl=i) / ICMP()
|
||||
reply = sr1(pkt, verbose=0, timeout=1)
|
||||
|
||||
if reply is None:
|
||||
print(f"{i}: * * *")
|
||||
elif reply.type == 3: # Destination unreachable
|
||||
print(f"{i}: {reply.src} (Unreachable)")
|
||||
break
|
||||
else:
|
||||
print(f"{i}: {reply.src}")
|
||||
if reply.src == target:
|
||||
print("Reached target!")
|
||||
break
|
||||
Reference in New Issue
Block a user