- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我捕获了一些流量并存储在 .pcap 文件中。在那里,发生了ARP中毒攻击。
有没有办法在 python 脚本中使用 scapy 检测攻击者的 IP 和 MAC 地址以及受害者的 IP 和 MAC 地址?
最佳答案
我相信像这样的脚本可以完成这项工作
#! /usr/bin/python
from scapy.all import *
pkts = rdpcap('capture2.pcap')
#these are from wireshark
ipadr=['192.168.0.1','192.168.0.2','192.168.0.3','192.168.0.30']
macadr['00:03:ff:98:98:01','00:03:ff:98:98:02','00:03:ff:98:98:03','00:03:ff:98:98:30']
c=-1
for p in pkts:
c=c+1
if p.haslayer(ARP):
#find a packet where p.dst and p.pdst isn't a valid pair
if p.dst != 'ff:ff:ff:ff:ff:ff':
if not(( ipadr[0]==p.pdst and macadr[0]==p.dst ) or ( ipadr[1]==p.pdst and macadr[1]==p.dst) or ( ipadr[2]==p.pdst and macadr[2]==p.dst ) or ( ipadr[3]==p.pdst and macadr[3]==p.dst )) :
print 'packet data ' +p.psrc +" "+p.src+" " + p.pdst + " " + p.dst +" "+str(c)
print 'packet number = ' + str(c)
print 'MAC of attacker = ' + p.dst
print 'IP of attacker = ' + ipadr[macadr.index(p.dst)]
print 'MAC of target = ' + p.src
print 'IP of target = ' + p.psrc
关于python - 使用scapy检测ARP中毒,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20301127/
Scapy 文档给出了以下 ARP 缓存中毒的例子: send(Ether(dst=clientMAC)/ARP(op="who-has", psrc=gateway, pdst=client)) 问
我试图了解 object.prototype 如何在 javascript 中运行然后我遇到了这段代码。我不明白? // Poisoning Object.prototype Object.proto
我的 occam-pi 应用程序有一个长时间运行的 producer 进程定义如下: PROC producer (VAL INT start, step, CHAN OF INT c!) INT
想要在 Apache tomcat 服务器中停止主机 header 注入(inject)或中毒。是否可以通过创建虚拟主机。 最佳答案 如果可以的话,最好不要信任 Host header 。虚拟主机是解
我正在使用 MEF发现和实例化插件并希望使过程尽可能健壮。特别是我不希望一个写得不好的插件对主机或其他插件的执行产生不利影响。 不幸的是,我在使用 GetExportedValues() 时发现了这一
在 Justin Seitz Black Hat Python 书的第四章中,该部分详细介绍了使用 scapy 的 ARP 中毒。我在获取目标机器的目标 ip 的 mac 地址时遇到问题。我使用 Ka
我是一名优秀的程序员,十分优秀!