Network Security - Chapter II Active Information Collection papers - the scapy

scapy is python third-party libraries, it can also be called using the python alone use.

It can be very powerful for capture, analyze, create, modify, injected into the network traffic.

Use scapy

image

You can view detailed usage GitHub: https://github.com/secdev/scapy

Use ARP (). Display () calls this method, a custom ARP packet

image

hwtype hardware type

ptype protocol type

hwlen hardware address length

Protocol length plen

Operation op who-has arp query packet

hwsrc source MAC address

psrc source IP address

hwdst destination MAC address

pdst destination IP address

Compared to capture wireshark comparisonimage

image

It can be obtained with the real scapy ARP packet structure consistent contrast.

By assigning a request for the required IP address in the ARP method scapy in pdst variable here as my gateway

image

Out here ready to release the assembled package, before premature opening of wireshark display filter through arp packet capture filters

image

There can be obtained according to the data packet analysis of this response obtained:

Protocol Type: ARP

Hardware type: 0x1

Protocol type is: 0x800

Hardware length: 6

Protocol length: 4

Action: Determine who is a host

Source mac address: 54: 66: 6c: 80: f3: 50

Source Host IP: 10.0.0.1

Target mac address: 00: 0c: 29: cf: 9f: 77

Destination IP Address: 10.0.0.8

padding: When the minimum packet length is still not satisfied all the fields added, the hexadecimal x00 will be fill bits.

 

The assembly has been caught ARP packets

image

Guess you like

Origin www.cnblogs.com/lqinghua/p/11241138.html