Upload files to "/"

This commit is contained in:
2026-02-01 11:48:47 +00:00
commit 100fd723fa
2 changed files with 56 additions and 0 deletions

20
arpDetector.py Normal file
View File

@@ -0,0 +1,20 @@
from scapy.all import sniff
IP_MAC_Map = {}
def processPacket(packet):
src_IP = packet['ARP'].psrc
src_MAC = packet['Ether'].src
if src_MAC in IP_MAC_Map.keys():
if IP_MAC_Map[src_MAC] != src_IP :
try:
old_IP = IP_MAC_Map[src_MAC]
except:
old_IP = "unknown"
message = ("\n Possible ARP attack detected \n "
+ " It is possible that the machine with IP address \n " + str(src_IP) + " is pretending to be "
+ str(old_IP) + "\n ")
return message
else:
IP_MAC_Map[src_MAC] = src_IP
sniff(count=0, filter="arp", store = 0, prn = processPacket)