Baptiste Cos..
5
这是来自第二条消息的EAPOL数据(在逻辑链接控件之后立即开始),采用四向握手方式:
unsigned char eapol[] =
{
'\x01', // Version
'\x03', // Type
'\x00','\x77', // Length
'\xfe', // Key Descriptor Type
'\x01','\x0a', // Key information
'\x00','\x10', // Key length
// Replay counter
'\x00','\x00','\x00','\x00','\x00','\x00','\x00','\x01',
// WPA Key Nounce
'\x77','\xd6','\x54','\xad','\x0c','\x1f','\xea','\x2f',
'\x20','\x99','\xf1','\xdd','\x1c','\xae','\xdb','\xd8',
'\xf7','\xe8','\x86','\xb0','\x81','\x60','\xed','\x7f',
'\x70','\xdd','\xbb','\x33','\xb6','\xf1','\xd9','\x98',
// Key IV
'\x00','\x00','\x00','\x00','\x00','\x00','\x00','\x00',
'\x00','\x00','\x00','\x00','\x00','\x00','\x00','\x00',
// Key RSC
'\x00','\x00','\x00','\x00','\x00','\x00','\x00','\x00',
// Key ID
'\x00','\x00','\x00','\x00','\x00','\x00','\x00','\x00',
// MIC **************** CHANGE HERE ********************
// '\x0a','\x62','\x24','\x07','\x11','\x36','\xd5','\x67',
// '\x87','\xc0','\x7b','\x82','\x6b','\x06','\xf7','\xff',
'\x00','\x00','\x00','\x00','\x00','\x00','\x00','\x00',
'\x00','\x00','\x00','\x00','\x00','\x00','\x00','\x00',
// Key Data Length
'\x00','\x18',
// Key Data
'\xdd','\x16','\x00','\x50','\xf2','\x01','\x01','\x00',
'\x00','\x50','\xf2','\x04','\x01','\x00','\x00','\x50',
'\xf2','\x04','\x01','\x00','\x00','\x50','\xf2','\x02'
};
确保将MIC字段的16个字节替换为“ \ x00”,并且已经准备好根据Michael算法计算出有效的EAPOL数据。
另外,请确保您使用的是基于WPA版本的正确算法。WPA1使用带有MD5哈希函数的HMAC,WPA2使用带有SHA1哈希的HMAC,如在aircrack-ng源代码中所看到的:
if (ap->wpa.keyver == 1)
HMAC(EVP_md5(), ptk[j], 16, ap->wpa.eapol, ap->wpa.eapol_size, mic[j], NULL);
else
HMAC(EVP_sha1(), ptk[j], 16, ap->wpa.eapol, ap->wpa.eapol_size, mic[j], NULL);
我认为python在HMAC对象中默认使用MD5。