1
我試圖修改下面的腳本,以便在檢測到與特定格式匹配的探針時能夠在終端中發出警報。我想匹配的格式是'KD - ????????????????'誰能幫我嗎?修改scapy以識別特定的探針
#!/usr/bin/env python
# -- coding: utf-8 --
from scapy.all import *
unique_probe = []
def Handler(pkt):
if pkt.haslayer(Dot11): # 802.11
if pkt.type == 0 and pkt.subtype == 4: # mgmt, probe request
if pkt.addr2 not in unique_probe :
unique_probe.append(pkt.addr2)
#####need something here to match pkt.info to a condition e.g. if pkt.info=KD* then
print "MAC: %s probing for %s possible use of KarmaDetector" %(pkt.addr2, pkt.info)
sniff(iface="wla0mon", count=0, prn=Handler, store=0) # sudo rfkill unblock wifi && sudo airmon-ng start wlan0