记一次crack wifi的测试学习

发布时间 2023-07-23 16:27:32作者: saaspeter

为了学习测试下crack wifi,参考了这篇文章:https://www.wikihow.com/Hack-WPA/WPA2-Wi-Fi-with-Kali-Linux  (kali)

也可以参考:https://gainanov.pro/eng-blog/sysad/wifi-cracking/  (但是jamWifi在较新的macos上已经不能deauth client了,因此可能要结合别的方法。)
中文的资料可以参考:https://blog.csdn.net/weixin_51194266/article/details/124345164

通常Kali不需要连接wifi,直接用宿主机的连接即可,但是为了测试crack wifi, 需要kali连接wifi,开始我以为是vmware fusion的设置,设置了半天都不行,后来查知默认vmware和virtualbox都不支持wifi的,最简单的是用一个USB的wifi adapter,插上USB wifi后在kali上就可以用了。在虚拟机器,usb中勾选上你的usb设备即可。

 以下就是上面文章中的内容了。

1.  airmon-ng 测试你的机器是否支持,出现无线网络接口才可继续进行。

2.  Run airmon-ng start wlan0 to start monitoring the network. If the name of your Wi-Fi interface isn't wlan0, replace that part of the command with the correct name. This gives you a new virtual interface name, which will usually be something like mon0, which you'll see next to "(monitor mode enabled)."

If you see a message that says "Found processes that could cause trouble," run airmon-ng check kill to kill them.

3. Run airodump-ng wlan0 to view the results. 注意ENC和AUTH列,只有wpa和wpa2及psk才能crack。

 4.  Monitor the network for a handshake。 上图中的BSSID就是AP的信息,CH也是要用到的。
airodump-ng -c number --bssid xx:xx:xx:xx:xx:xx -w /root/Desktop/ wlan0   
此时该窗口进入monitor模式

 5.  Send the deauth packets. Run this command,  aireplay-ng -0 2 -a AP_BSSID -c Client_BSSID wlan0 , 其中AP_BSSID是无线路由器的,client_bssid是客户端的。经测试原文写的应该是反了。
原文让从airodump-ng 命令查看链接的客户端,但是我测试的时候却很难得到客户端的数据。因此我用的是macos的jemWifi,尽管jamwifi用来deauth是不行了,但是可以搜集客户端信息,得到Client_BSSID。运行该命令的时候airodump-ng 的窗口命令要继续运行。

  • This command will send 2 deauth packets to disconnect the client from the network. Don't try to send more than this—sending too many packets could prevent the client from reconnecting and generating the handshake.  我测试的时候2得不到要的数据,4可以,但是4会导致客户端连不上wifi。

6.  得到数据后,在第一个窗口使用 Control+C to quit airodump-ng , 这时会在root的桌面产生一个 .cap文件。使用aircrack的时候需要一个字典,按字典来crack,密码必须在字典上,我觉得挺愚蠢的。可以用kali自带的rockyou字典试试。 gzip -d /usr/share/wordlists/rockyou.txt.gz    

7.  crack the password. You'll use a tool called aircrack-ng, which come with Kali Linux, to do so. The command is aircrack-ng -a2 -b NETWORK BSSID -w /usr/share/wordlists/rockyou.txt /root/Desktop/*.cap  

最后我自己的wifi password没有能破译出来,可能太复杂了。这种暴力方式我觉得不是太好。

注意:本文是学习测试目的的,未经允许不要尝试crack别人的wifi!