GNU General Public License v3.0

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

深度解析 GitHub 项目:flashnuke/wifi-deauth

项目背景与痛点

flashnuke/wifi-deauth 是一个专注于执行去授权攻击的工具,从设计上看,它解决了如何高效地从目标 Wi-Fi 网络中切断所有设备的连通性问题。无论是传统的 2.4GHz 频段还是更快的 5GHz 频段,它都能胜任。值得一提的是,这款工具不仅支持 WPA3,还能保证对强制保护功能(Protected Management Frames, PMF)未测试的情况保持兼容。其核心价值在于,为网络安全专业人士提供了一种高效的手段,用以分析和测试 Wi-Fi 网络的安全边界与漏洞。

核心技术揭秘

wifi-deauth 的设计思路透露出简洁而强大的特性。作为一款专门用于生成去授权攻击(deauth attack)的工具,它巧妙地利用了 Wi-Fi 的弱点来实现目的。去授权攻击通过发送去授权帧(Deauthentication frames),迫使目标设备与接入点(Access Point, AP)断开连接,从而暂时性地中断网络。

该工具的核心技术栈主要依赖于原始的网络接口操作以及 Wi-Fi 802.11 帧的精准控制。从技术架构来看,wifi-deauth 的工作流程可简要描绘如下:

graph TD A[网络配置与监控] --> B[捕获 Wi-Fi 协议] B --> C[生成 Deauth 帧] C --> D[发送帧至设备] D --> E{"复位与断连"} E -->|"复位"| F[返回] E -->|"断连"| G[重连]
  • 网络配置与监控:该阶段涉及挑选和配置执行攻击的目标网络接口(Network Interface),并确保工具具备足够的权限和可视性以监控网络数据流。
  • 捕获 Wi-Fi 协议:解码和验证接收到的 Wi-Fi 相关协议数据包,确保 Deauth 攻击基于有效的会话进行。
  • 生成 Deauth 帧:核心阶段之一,基于 AI 和 Wi-Fi 协议生成具有欺骗性质的去授权帧。
  • 发送帧至设备:向特定设备或者整个网络中的所有设备发送上述生成的去授权帧,迫使其断开与网络的连接。
  • 复位与断连:设备接收到去授权帧后,其响应将决定是继续连接还是选择重新认证并重新连接至网络。

这种技术架构使得工具能够精准且高效地实施攻击,而设计模式的采用(如生成器模式)确保了其灵活性和可扩展性。

功能亮点与差异

相对于其他类似工具,wifi-deauth 的亮点之一是其强大的兼容性,覆盖了包括 WPA3 体系在内的多种安全协议。尤其是针对那些看似坚不可摧的现代网络,通过对最新加密技术的支持,有效填补了市场上许多工具的空白。

另一个关键特性在于它的高度可配置性。用户能够细致地调整攻击的参数,如发送 Deauth 帧的频率、目标设备的 MAC 地址,甚至是攻击范围(限定于特定设备或整个网络)。这也增加了工具的安全性和针对性。

应用场景与落地建议

wifi-deauth 在生产环境使用时需谨慎。特别注意的是,尽管其技术本身无疑具备潜力,但这种工具应当仅限于合法的安全研究和测试环境使用。且在任何应用场景中,要确保所有活动处于法律与道德允许的范围内,并且事先获得目标网络所有者的明确授权。在企业层面,能够应用这种技术进行定期的网络安全性审查和防御策略的优化,以此提升整体防御策略的有效性。

综合评价

总的来说,wifi-deauth 可谓是网络安全技术领域的一剂猛药,提供了极其有用的工具来剖析 Wi-Fi 网络的安全性。然而,它也是一把双刃剑,因此,使用时需格外小心谨慎。积极的一面在于其高性能的攻击效率,尤其是在检测和强化网络基础设施中的应用;潜在的缺点则在于对未授权单元的滥用可能会带来法律以及伦理上的风险。总体而言,对于有合法需用需求的团队或个人,wifi-deauth 是一个强有力的选择。

关于

GitHub 原始描述(英文)

A deauth attack that disconnects all devices from the target wifi network (2.4Ghz & 5Ghz), WPA3 also supported (PMF not tested)

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

Python

Release

贡献者

README

image
A DoS attack that disconnects all devices from a target wifi network.

  • The network’s password is not required
  • Tested on Kali NetHunter (Snapshot at the bottom)

IMPORTANT
In some occasions, network APs might operate on both 5GHz and 2.4GHz under the same BSSID/SSID name.
In order to truly bring the AP down, I usually run simultaneously two de-authers using 2 network interfaces: one for 2.4GHz and one for 5GHz.

Bandwidth Channel range
2.4 GHz 1 <–> 14
5 GHz 35 <–> 165

How it works

The program iterates over all possible channels, and by sniffing 802.11 packets it determines which access points are available.
After the attacker chooses a target access point to attack, the program:

  1. Continously sends spoofed deauthentication packets using broadcast mac address as the destination
  2. Starts sniffing for clients that are connected to the AP by filtering for certain 802.11 packet frames and sending spoofed deauthentication packets to those clients in addition to the broadcast address

Usage

Installing on the system (requires pipx >= 1.6.0)
git clone https://github.com/flashnuke/wifi-deauth.git
cd wifi-deauth

sudo pipx install . --global

sudo wifi-deauth -i <iface>
Running without installing (using venv)
git clone https://github.com/flashnuke/wifi-deauth.git
cd wifi-deauth

python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt

cd wifi_deauth
sudo ../venv/bin/python wifi_deauth.py -i <iface>  # sudo doesn't inherit the venv, so use the full path
git clone https://github.com/flashnuke/wifi-deauth.git
cd wifi-deauth

sudo pip3 install -r requirements.txt --break-system-packages

cd wifi_deauth
sudo python3 wifi_deauth.py -i <iface>

Usage notes

  • <iface> is the name of the network interface (i.e wlan0 or eth0) that supports packet injection
  • --deauth-all-channels - try this option if the attack doesn’t work (see more in Optional Arguments)
  • --autostart is good for automation - first make sure that only 1 access point is found, you can use filters (bssid, ssid, channels, etc…) to ensure that
  • The initial iteration over all channels might take a minute or two (depends on how many bands the interface supports)

Optional arguments

  • --deauth-all-channels - send de-auth packets on all allowed channels (or all custom channels if --channels is set) iteratively, effective against access points that switch to a different channel as a protection mechanism
  • --ssid <name> - filter for a specific SSID by a case-insensitive substring (this should shorten the channel-scanning duration), whitespaces should be passed with an escape character (i.e -> new\ york)
  • --bssid <addr> - filter for a specific BSSID (the access point’s MAC address), case in-sensitive
  • --autostart - start the de-auth loop automatically, works only when one access point is found
  • --channels <ch1,ch2> - scan for specific channels only, otherwise all supported channels will be scanned
  • --clients <m_addr1,m_addr2> - target only specific clients to disconnect from the AP, otherwise all connected clients will be targeted (note: using this option disables deauth broadcast)
  • --debug - enable debug prints
  • --kill (or run sudo systemctl stop NetworkManager) - kill NetworkManager service which might interfere with the attack
  • --skip-monitormode - enable monitor mode manually (otherwise the program does it automatically)

Misc notes

  • Setting custom client mac addresses (--clients) is not suggested, as some clients might reconnect using a random MAC address which is different than the one set
  • Check ifconfig to find the interface nickname
  • Works for 2.4GHhz and 5Ghz

Requirements

  • Linux OS
  • A network adapter that supports monitor mode and packet injection
  • Scapy library (listed in requirements.txt)

Deadnet & other projects

Feel free to check out my other projects, the most recent one being mod-rootkit, which is a Linux kernel-level rootkit designed to hide files, processes, and network activity.

There’s another project (deadnet) that performs a DoS attack on networks, which requires credentials but quite effective nonetheless.

Disclaimer

This tool is only for testing and can only be used where strict consent has been given. Do not use it for illegal purposes! It is the end user’s responsibility to obey all applicable local, state and federal laws. I assume no liability and am not responsible for any misuse or damage caused by this tool and software.

Distributed under the GNU License.

评论

暂无评论