mirror of
https://github.com/autistic-symposium/sec-pentesting-toolkit.git
synced 2025-05-07 01:04:57 -04:00
scapy
This commit is contained in:
parent
36356bcc36
commit
4123fa683b
2 changed files with 46 additions and 8 deletions
16
Network_and_802.11/scapy/traceroute_simple.py
Normal file
16
Network_and_802.11/scapy/traceroute_simple.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
from scapy.all import *
|
||||
hostname = "google.com"
|
||||
for i in range(1, 28):
|
||||
pkt = IP(dst=hostname, ttl=i) / UDP(dport=33434)
|
||||
# Send the packet and get a reply
|
||||
reply = sr1(pkt, verbose=0)
|
||||
if reply is None:
|
||||
# No reply =(
|
||||
break
|
||||
elif reply.type == 3:
|
||||
# We've reached our destination
|
||||
print "Done!", reply.src
|
||||
break
|
||||
else:
|
||||
# We're in the middle somewhere
|
||||
print "%d hops away: " % i , reply.src
|
Loading…
Add table
Add a link
Reference in a new issue