ls(ARP())
hwtype : XShortField = 1 ('1')
ptype : XShortEnumField = 2048 ('2048')
hwlen : FieldLenField = None ('None')
plen : FieldLenField = None ('None')
op : ShortEnumField = 1 ('1')
hwsrc : MultipleTypeField (SourceMACField, StrFixedLenField) = 'dc:a6:32:bb:49:9d' ('None')
psrc : MultipleTypeField (SourceIPField, SourceIP6Field, StrFixedLenField) = '192.168.1.100' ('None')
hwdst : MultipleTypeField (MACField, StrFixedLenField) = '00:00:00:00:00:00' ('None')
pdst : MultipleTypeField (IPField, IP6Field, StrFixedLenField) = '0.0.0.0' ('None')
>>>
op操作码:默认1,取值1或2,分别代表ARP请求包或响应包(请求操作或响应操作)
hwsrc:发送方MAC地址,用于告诉对方我的MAC地址是什么,默认为本机,所以可以忽略此属性
psrc:发送方IP地址,用于告诉对方我的IP地址是什么 ,可用来伪装
这报文发给谁,由下面的两个属性决定:
hwdst: 对方的MAC地址
pdst:对方的IP地址
ls(Ether())
dst : DestMACField = WARNING: Mac address to reach destination not found. Using broadcast.
'ff:ff:ff:ff:ff:ff' ('None')
src : SourceMACField = 'dc:a6:32:bb:49:9d' ('None')
type : XShortEnumField = 36864 ('36864')
>>>
构造ARP包:
欺骗目标主机,我的是网关:
发送给目标 主机