python的scapy库:抓包,分析,创建,修改,注入网络流量
>>> ARP().display()
###[ ARP ]###
hwtype= 0x1
ptype= 0x800
hwlen= 6
plen= 4
op= who-has
hwsrc= 00:0c:29:9f:b8:42
psrc= 172.18.6.43
hwdst= 00:00:00:00:00:00
pdst= 0.0.0.0
>>> arp=ARP()
>>> arp.hwtype
1
>>> arp.pdst="172.18.6.86"
>>> arp.pdst
'172.18.6.86'
>>> sr1(arp)
.Begin emission:
*Finished to send 1 packets.
m=sr1(IP(dst='172.18.6.34')/TCP(dport=80,flags='S'),timeout=1)