このカムテーブル枯渇検出スクリプトを検出するスクリプトを実行すると、次のエラーが発生します。
File "camtable.py", line 22, in <module>
sniff(iface=interface,prn=monitorPackets)
File "/usr/lib/python2.7/site-packages/scapy/sendrecv.py", line 561, in sniff
s = L2socket(type=ETH_P_ALL, *arg, **karg)
File "/usr/lib/python2.7/site-packages/scapy/arch/linux.py", line 455, in __init__
self.ins.bind((iface, type))
File "/usr/lib64/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 19] No such device
いくつかのガイダンスが必要になります。
import sys
import scapy
import datetime
from scapy.all import *
THRESH=(254/4)
START = 5
def monitorPackets(p):
if p.haslayer(IP):
hwSrc = p.getlayer(Ether).src
if hwSrc not in hwList:
hwList.append(hwSrc)
delta = datetime.datetime.now() - start
if((delta.seconds > START) and ((len(hwList)/delta.seconds) > THRESH)):
print "[*]- Detected CAM Table Attack."
interface = sys.argv[0]
hwList = []
start = datetime.datetime.now()
sniff(iface=interface,prn=monitorPackets)