python发送伪造的arp请求
发布时间:2016-12-28 来源:查字典编辑
摘要:复制代码代码如下:#!/usr/bin/envpythonimportsockets=socket.socket(socket.AF_PAC...
复制代码 代码如下:
#!/usr/bin/env python
import socket
s = socket.socket(socket.AF_PACKET, socket.SOCK_RAW)
s.bind(("lo", 0))
src_addr = "x50x3dxe5x0ex35x3f"
dst_addr = "xffxffxffxffxffxff"
ethertype = "x08x06"
s.send(dst_addr+src_addr+ethertype+"x00x01"+"x08x00"+"x06"+"x04"+"x00x01"+src_addr+"x7fx00x00x01"+"x00x00x00x00x00x00"+"x7fx00x00x01")