http://www.thesprawl.org/infocalypse/in ... itle=Scapy
hier eine kostprobe:
EDIT:
(diese ganze packet gescichte ist mir relativ neu: groebere fehlerin folgenden listings evtl. vorhanden)
Code: Alles auswählen
>>> p = IP(dst='127.0.0.1', src=RandIP())/TCP(flags="S", dport=80)
>>> while True: send(p)
...
Code: Alles auswählen
>>> p = IP(dst='www.google.de')/ICMP()
>>> sr1(p)
Begin emission:
.Finished to send 1 packets.
*
Received 2 packets, got 1 answers, remaining 0 packets
<IP version=4L ihl=5L tos=0x0 len=28 id=1 flags= frag=0L ttl=244 proto=icmp chksum=0xab62 src=209.85.135.99 dst=192.168.2.28 options='' |<ICMP type=echo-reply code=0 chksum=0x0 id=0x0 seq=0x0 |<Padding load='\xe1x\x93\xd2&\xa9\xde\x81h\x8d\xf7.U\x05\xc85\x93\xac' |>>>
>>> pong = _
>>> pong.show()
###[ IP ]###
version= 4L
ihl= 5L
tos= 0x0
len= 28
id= 1
flags=
frag= 0L
ttl= 244
proto= icmp
chksum= 0xab62
src= 209.85.135.99
dst= 192.168.2.28
options= ''
###[ ICMP ]###
type= echo-reply
code= 0
chksum= 0x0
id= 0x0
seq= 0x0
###[ Padding ]###
load= '\xe1x\x93\xd2&\xa9\xde\x81h\x8d\xf7.U\x05\xc85\x93\xac'
>>>
Code: Alles auswählen
>>> for i in range(10): print sr1( IP(dst='www.google.de', ttl=i)/TCP(flags="S", dport=80), verbose=0 ).summary()
...
IP / ICMP 192.168.2.1 > 192.168.2.28 time-exceeded 0 / IPerror / TCPerror
IP / ICMP 192.168.2.1 > 192.168.2.28 time-exceeded 0 / IPerror / TCPerror
IP / ICMP 217.0.116.180 > 192.168.2.28 time-exceeded 0 / IPerror / TCPerror
IP / ICMP 217.0.64.118 > 192.168.2.28 time-exceeded 0 / IPerror / TCPerror
IP / ICMP 62.156.138.178 > 192.168.2.28 time-exceeded 0 / IPerror / TCPerror
IP / ICMP 4.68.108.30 > 192.168.2.28 time-exceeded 0 / IPerror / TCPerror
IP / ICMP 4.69.133.174 > 192.168.2.28 time-exceeded 0 / IPerror / TCPerror
IP / ICMP 4.69.133.146 > 192.168.2.28 time-exceeded 0 / IPerror / TCPerror
IP / ICMP 4.69.132.129 > 192.168.2.28 time-exceeded 0 / IPerror / TCPerror
IP / ICMP 4.69.132.138 > 192.168.2.28 time-exceeded 0 / IPerror / TCPerror