reaver: print hint when we get deauth packets during WPS exchange
when we get deauth, something went wrong, so at least inform the user. we have not yet decided the best strategy to automatically recover, or whether that is even desirable.
This commit is contained in:
parent
78651c216f
commit
375973b5d4
|
@ -168,7 +168,8 @@ enum wps_type
|
||||||
M7 = 0x0B,
|
M7 = 0x0B,
|
||||||
M8 = 0x0C,
|
M8 = 0x0C,
|
||||||
DONE = 0x0F,
|
DONE = 0x0F,
|
||||||
NACK = 0x0E
|
NACK = 0x0E,
|
||||||
|
WPS_PT_DEAUTH = 0xFF
|
||||||
};
|
};
|
||||||
|
|
||||||
enum wfa_elements
|
enum wfa_elements
|
||||||
|
|
|
@ -43,6 +43,7 @@ enum wps_result do_wps_exchange()
|
||||||
int premature_timeout = 0, terminated = 0, got_nack = 0;
|
int premature_timeout = 0, terminated = 0, got_nack = 0;
|
||||||
int id_response_sent = 0, tx_type = 0;
|
int id_response_sent = 0, tx_type = 0;
|
||||||
int m2_sent = 0, m4_sent = 0, m6_sent = 0;
|
int m2_sent = 0, m4_sent = 0, m6_sent = 0;
|
||||||
|
int deauth_flag = 0;
|
||||||
|
|
||||||
/* Initialize settings for this WPS exchange */
|
/* Initialize settings for this WPS exchange */
|
||||||
set_last_wps_state(0);
|
set_last_wps_state(0);
|
||||||
|
@ -66,7 +67,7 @@ enum wps_result do_wps_exchange()
|
||||||
{
|
{
|
||||||
tx_type = 0;
|
tx_type = 0;
|
||||||
|
|
||||||
if(packet_type > last_msg)
|
if(packet_type != WPS_PT_DEAUTH && packet_type > last_msg)
|
||||||
{
|
{
|
||||||
last_msg = packet_type;
|
last_msg = packet_type;
|
||||||
}
|
}
|
||||||
|
@ -80,6 +81,11 @@ enum wps_result do_wps_exchange()
|
||||||
if(packet_type != UNKNOWN)
|
if(packet_type != UNKNOWN)
|
||||||
switch(packet_type)
|
switch(packet_type)
|
||||||
{
|
{
|
||||||
|
case WPS_PT_DEAUTH:
|
||||||
|
if(!deauth_flag)
|
||||||
|
cprintf(VERBOSE, "[+] Received deauth request\n");
|
||||||
|
deauth_flag = 1;
|
||||||
|
break;
|
||||||
case IDENTITY_REQUEST:
|
case IDENTITY_REQUEST:
|
||||||
cprintf(VERBOSE, "[+] Received identity request\n");
|
cprintf(VERBOSE, "[+] Received identity request\n");
|
||||||
tx_type = IDENTITY_RESPONSE;
|
tx_type = IDENTITY_RESPONSE;
|
||||||
|
@ -154,6 +160,10 @@ enum wps_result do_wps_exchange()
|
||||||
terminated = 1;
|
terminated = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if(packet_type != UNKNOWN && packet_type != WPS_PT_DEAUTH)
|
||||||
|
deauth_flag = 0;
|
||||||
|
else if(packet_type == WPS_PT_DEAUTH)
|
||||||
|
continue;
|
||||||
|
|
||||||
if(tx_type == IDENTITY_RESPONSE)
|
if(tx_type == IDENTITY_RESPONSE)
|
||||||
{
|
{
|
||||||
|
@ -189,6 +199,7 @@ enum wps_result do_wps_exchange()
|
||||||
}
|
}
|
||||||
|
|
||||||
send_eapol_start();
|
send_eapol_start();
|
||||||
|
deauth_flag = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -293,6 +304,12 @@ static int is_packet_for_us(struct dot11_frame_header *frame_header)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int is_deauth_packet(struct dot11_frame_header *frame_header)
|
||||||
|
{
|
||||||
|
int fcstype = frame_header->fc & end_htole16(IEEE80211_FCTL_STYPE);
|
||||||
|
return (fcstype == end_htole16(IEEE80211_STYPE_DEAUTH));
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Processes incoming packets looking for EAP and WPS messages.
|
* Processes incoming packets looking for EAP and WPS messages.
|
||||||
* Responsible for stopping the timer when a valid EAP packet is received.
|
* Responsible for stopping the timer when a valid EAP packet is received.
|
||||||
|
@ -333,6 +350,9 @@ enum wps_type process_packet(const u_char *packet, struct pcap_pkthdr *header)
|
||||||
if(!is_packet_for_us(frame_header))
|
if(!is_packet_for_us(frame_header))
|
||||||
return UNKNOWN;
|
return UNKNOWN;
|
||||||
|
|
||||||
|
if(is_deauth_packet(frame_header))
|
||||||
|
return WPS_PT_DEAUTH;
|
||||||
|
|
||||||
int data_pkt_type;
|
int data_pkt_type;
|
||||||
|
|
||||||
/* Is this a data packet ? */
|
/* Is this a data packet ? */
|
||||||
|
|
Loading…
Reference in New Issue