Packet Generators: Difference between revisions

(scapy added)
 
 
(9 intermediate revisions by the same user not shown)
Line 67:
>>> res,unans = traceroute(["www.microsoft.com","www.cisco.com","www.yahoo.com","www.wanadoo.fr","www.pacsec.com"],dport=[80,443],maxttl=20,retry=-2)
>>> res.graph()
 
==Simple Examples==
 
*Crafting ICMP Packet:
>>> i = IP()
>>> i.dst="192.168.1.1"
>>> i.display()
>>> ic = ICMP()
>>> ic.display()
sr1(i/ic)
sr1(i/ic/”aman.info.tm”)
 
*Crafting ARP Packet:
 
Be careful with this example, it will may break cause LAN issues for some time.<br />
You need to clear arp cache or wait for timeout on the device/router 192.168.1.10.
 
>>> a = ARP()
>>> a.pdst="192.168.1.10"
>>> a.hwsrc="11:11:11:11:11:11"
>>> a.psrc="1.1.1.1"
>>> a.hwdst="ff:ff:ff:ff:ff:ff"
>>> a.display()
send(a)
arp –a
 
==Complex Examples==
Line 208 ⟶ 235:
ans=sr1((IP(proto=6, tos=0, dst='10.100.10.22', options='', version=4L)/TCP(seq=sack, ack=sseq+1, dport=21, flags="A", options=[('NOP', None), ('NOP', None), ('Timestamp', (981592, 525503134))])))
 
= PackEth =
{{UC}}
 
 
=Misc=
*Generating 100 FTP requests
Need to install 'parallel' first
sudo apt-get install parallel
seq 100 | parallel -j0 -joblog log curl ftp://test:test@10.107.88.93/log ">" {}.txt