Skip to content

Commit

Permalink
stop attack when nack code is SETUP_LOCKED
Browse files Browse the repository at this point in the history
  • Loading branch information
feitoi authored and rofl0r committed Jan 25, 2022
1 parent 8ab068a commit 2db7ca5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/cracker.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,7 @@ void crack()
}

/* If we've hit our max number of pin attempts, quit */
if((get_max_pin_attempts() > 0) &&
(pin_count == get_max_pin_attempts()))
if (pin_count >= get_max_pin_attempts())
{
cprintf(VERBOSE, "[+] Quitting after %d crack attempts\n", pin_count);
break;
Expand Down
7 changes: 7 additions & 0 deletions src/exchange.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ enum wps_result do_wps_exchange()
{
ret_val = UNKNOWN_ERROR;
}
/* WPS locked or ISPs that had vulnerable routers in the past opted
to "fix" them by simply not completing any more WPS transactions */
if (get_nack_reason() == SETUP_LOCKED) {
/* set maximum number of pin attempts to 0 for quit */
set_max_pin_attempts(0);
cprintf(WARNING, "[!] WARNING: Detected AP has WPS setup locked!\n");
}
}
else if(premature_timeout)
{
Expand Down

0 comments on commit 2db7ca5

Please sign in to comment.