In the local area network, how to get the MAC address of the PPPoE server is a headache, especially in the Windows environment; There are two ways to get the PPPoE server MAC address:
1. Under Windows, we run the Wireshark software, we can get all the packet format and content in and out of the network card, the Wireshark filter is set to PPPoE filter, and then the empty user name password dial, you can see the PPPoE discovery phase of 4 packets, Specific implementation methods Please Google search, online tutorials a lot.
2. Can write a Python program, first send a PADI packet, then the PPPoE server will reply to a PADR packet, according to this packet can be to the PPPoE server MAC address. The Python code is as follows:
From scapy.all Import * #定义PPPoE数据包的格式def packet (code=0x09,len=0,macadd= ' FF:FF:FF:FF:FF:FF '): A=ether ()/pppoe () A.dst=macadd a.type=0x8863 a.payload.version=1 a.payload.type=1 A.payload.code=code A.payload.len=len return a# send PADR packet SENDP (packet (code=0x09)) #嗅探网卡得到的数据c =sniff (filter= ' pppoed ', count=1) # Data packets returned by the PPPoE server (MAC address of the server) C[0].show ()
This article is from the Python applet blog, so be sure to keep this source http://mdh6789.blog.51cto.com/7270513/1569861
PPPoE protocol Attack 4: How to get the MAC address of the PPPoE server