Monthly Archives: February 2011

github for my scripts :D

So I’m releasing my scripts to github :D check them out HERE
right now its just two python+scapy scripts

scapy on the n900

I came across this rather neat tool called scapy, after playing around with on my desktops I wondered if it would run on my phone(nokia n900) so I checked the repos, and it was in there

Unfortunately AT&T blocks trace-routes :(      oh well, the n900 has wifi so it’s all good \o/

Here’s a demo of me doing a trace-route \o/

Start scapy :D

Start scapy :D

enter in the traceroute command

enter in the traceroute command

run it and watch the moving text :o

run it and watch the moving text :o

oh yay, it's done :D

oh yay, it's done :D

Then run    res.graph(target=”> /tmp/graph.svg”)     to export the graph to a svg   (For me it errors out if I just run res.graph()

Then you can view the .svg in the maemo browser :D

mmmm graphs

mmmm graphs

Of course you can do anything else that scapy allows you to do *evil grin* >.>   but I would highly recommend scripting that, entering in commands on the n900 is quite annoying xD

ex: my crappy but working script for the above:

#! /usr/bin/env python
import sys, os
from scapy.all import *
#txt file with a list
#remove \n
#get name of image to create
name_img = raw_input('enter in name for image: ')
askfile = raw_input('use file for server list? yes/NO: ')
 
if askfile == "yes" or askfile == "y":
	serverfile = open("/root/python/scapy/fromfile/servers", "r")
	servers = [line[:-1] for line in serverfile]
elif askfile == "no" or askfile == 'n' or askfile == "":
	servers = []
	serversin = raw_input("enter in domain/ip(seprate with a space): ")
	servers = serversin.split()
print servers
 
#broken D:
#askport = raw_input('Use default ports?(80, 443)?(YES/no): ')
#if askport == "" or askport == 'yes':
#	ports = "80, 443"
#else:
#	ports = raw_input("enter in ports(seprate with comma): ")
	#ports = portin.split()
#print ports
 
#wiere you want svg and pngs to poop out
path="/home/pronto/images/scapy/"
#scapy stuff
res,unans=traceroute(servers[0:],dport=[22,80,443],maxttl=20,retry=-2)
res.graph(target="> %s%s.svg" % (path,name_img))