Codice:
#!/usr/bin/python
import scapy
from scapy import *
import sys
import time
import os
import random
conf.verb = 1
#created by ^4st3r1X^
print "_____________________ _____ _________ ___________ "
time.sleep(0.01)
print "\__ ___/\______ \ / _ \ \_ ___ \ \_ _____/ "
time.sleep(0.01)
print " | | | _/ / /_\ \ / \ \/ | __)_ "
time.sleep(0.01)
print " | | | | \/ | \\ \____ | \ "
time.sleep(0.01)
print " |____| |____|_ /\____|__ / \______ //_______ / "
time.sleep(0.01)
print " \/ \/ \/ \/ \n"
def trace():
res,unans = traceroute([ip],dport=[80,443,22,25,23],maxttl=20,retry=-2)
time.sleep(0.5)
print "\n\n[+]Creating graph..."
time.sleep(0.5)
if os.path.exists("%s.jpg" % (ip)) == True:
print "[+]%s.jpg is existent...renamed" % (ip)
time.sleep(0.5)
named = random.randint(1,99) - random.randint(1,99) + random.randint(1,10000)
name = "%s-%s.jpg" % (ip, named)
res.graph(type="jpg", target="> %s" % (name))
print "[+]chmod 777 %s" % (name)
time.sleep(1)
os.popen("chmod 777 %s\n" % (name))
time.sleep(0.2)
print "\n-END-\n"
else:
res.graph(type="jpg", target="> %s.jpg" % (ip))
print "[+]chmod 777 %s.jpg" % (ip)
time.sleep(1)
os.popen("chmod 777 %s.jpg\n" % (ip))
time.sleep(0.2)
print "\n-END-\n"
try:
ip = sys.argv[1]
if ip:
trace()
except:
print "\nEs: ./trace google.it"
exit()
OUTPUT TERMINALE:
Codice:
root@ganja:/home/asterix/Scrivania# ./trace jpl.nasa.gov
_____________________ _____ _________ ___________
\__ ___/\______ \ / _ \ \_ ___ \ \_ _____/
| | | _/ / /_\ \ / \ \/ | __)_
| | | | \/ | \ \____ | \
|____| |____|_ /\____|__ / \______ //_______ /
\/ \/ \/ \/
Begin emission:
Finished to send 100 packets.
Begin emission:
Finished to send 37 packets.
Begin emission:
Finished to send 37 packets.
Received 64 packets, got 63 answers, remaining 37 packets
137.78.160.205:tcp22 137.78.160.205:tcp23 137.78.160.205:tcp25 137.78.160.205:tcp443 137.78.160.205:tcp80
1 192.168.1.1 11 192.168.1.1 11 192.168.1.1 11 192.168.1.1 11 192.168.1.1 11
2 213.205.0.142 11 213.205.0.142 11 213.205.0.142 11 213.205.0.142 11 213.205.0.142 11
3 213.205.12.97 11 213.205.12.97 11 213.205.12.97 11 213.205.12.97 11 213.205.12.97 11
4 213.205.13.69 11 213.205.13.69 11 213.205.13.69 11 213.205.13.69 11 213.205.13.69 11
5 213.205.1.93 11 213.205.1.93 11 213.205.1.93 11 213.205.1.93 11 213.205.1.93 11
6 89.149.185.114 11 89.149.185.114 11 89.149.185.114 11 89.149.185.114 11 89.149.185.114 11
7 206.223.115.12 11 206.223.115.12 11 206.223.115.12 11 206.223.115.12 11 206.223.115.12 11
8 129.250.2.129 11 129.250.2.129 11 129.250.2.129 11 129.250.2.129 11 129.250.2.129 11
9 129.250.5.24 11 129.250.5.24 11 129.250.5.24 11 129.250.5.24 11 129.250.5.24 11
11 198.172.117.163 11 198.172.117.163 11 198.172.117.163 11 198.172.117.163 11 198.172.117.163 11
12 130.152.181.51 11 130.152.181.51 11 130.152.181.51 11 130.152.181.51 11 130.152.181.51 11
13 - - - - 137.78.12.230 11
14 - - - - 137.78.160.205 SA
15 - - - - 137.78.160.205 SA
16 - - - - 137.78.160.205 SA
17 - - - - 137.78.160.205 SA
18 - - - - 137.78.160.205 SA
19 - - - - 137.78.160.205 SA
20 - - - - 137.78.160.205 SA
[+]Creating graph...
[+]jpl.nasa.gov.jpg is existent...renamed
[+]chmod 777 jpl.nasa.gov-7867.jpg
-END-
root@ganja:/home/asterix/Scrivania#
Grafico
[img=600x500]http://img256.imageshack.us/img256/4480/jplnasagov.jpg[/img]