还有,为什么我们有“responses,unanswered=”而不是“responses=”in“responses,unanswered=srp(以太(dst=“ff:ff:ff:ff:ff”)/ARP(pdst=ip\u地址),timeout=2,retry=10)”响应和未响应都是什么
from scapy.all import *
import sys
import threading
interface = "eth0"
target_ip = "172.16.155.137"
gateway_ip = "172.16.155.2"
packet_count = 100000
poisoning = True
def restore_target(gateway_ip, gateway_mac, target_ip, target_mac):
print "[*] Restoring target..."
send(ARP(op=2, psrc=gateway_ip, pdst=target_ip, hwdst="ff:ff:ff:ff:ff:ff", hwsrc=gateway_mac), count=5)
send(ARP(op=2, psrc=target_ip, pdst=gateway_ip, hwdst="ff:ff:ff:ff:ff:ff",
hwsrc=target_mac), count=5)
def get_mac(ip_address):
responses,unanswered = srp(Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst=ip_address),timeout=2,retry=10)
# return the MAC address from a response
for s, r in responses:
return r[Ether].src
return None
目前没有回答
相关问题 更多 >
编程相关推荐