当前位置: 编程技术>python
python发送伪造的arp请求
来源: 互联网 发布时间:2014-09-04
本文导语: 代码如下:#!/usr/bin/env pythonimport 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+"x7fx00x00x0...
代码如下:
#!/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")