forked from mariusv/Gray-Hacker-and-PenTesting
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mari Wahl
committed
Dec 2, 2014
1 parent
36356bc
commit 4123fa6
Showing
2 changed files
with
46 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters