簡體   English   中英

嘗試使用ARP檢測我的局域網中的嗅探器

[英]Try to detect sniffers in my lan using ARP

我嘗試檢測局域網中的嗅探。 當我使用嗅探PC的ip將arp數據包發送到FF:FF:FF:FF:FF:FE時,pc不會接收該數據包(thr數據包不在嗅探pc中的wirehark中封裝但在harshhark中封裝在發送PC上如何使用ARP檢測我的局域網中的嗅探

import sys
i, o, e = sys.stdin, sys.stdout, sys.stderr
from scapy.all import *
sys.stdin, sys.stdout, sys.stderr = i, o, e

def main():

   #create an ARP packet for 192.168.1.25 the sniffing PC
   packet = Ether(dst = 'FF:FF:FF:FF:FF:FE')/ARP(pdst='192.168.1.25',hwdst = 
   'FF:FF:FF:FF:FF:FE')
   while True:
   #sending the packet until we get an answer
     pa = srp1(packet,timeout=1)
     if pa is not None:
     #if there is an answer print the packet and break
        print pa.show()
        break


if __name__ == '__main__':
  main()

您無需在arp數據包中設置hwdst scapy還具有一個內置方法,即promiscping(ip or CIDR block)可以做到這一點。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM