Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop attack when nack code is SETUP_LOCKED #341

Merged
merged 2 commits into from Jan 25, 2022
Merged

stop attack when nack code is SETUP_LOCKED #341

merged 2 commits into from Jan 25, 2022

Conversation

feitoi
Copy link
Contributor

@feitoi feitoi commented May 18, 2021

I think it is more appropriate to use type int for the variable pin_count.

src/cracker.c Outdated
@@ -279,7 +279,8 @@ void crack()
case KEY_REJECTED:
fail_count = 0;
pin_count++;
advance_pin_count();
if (!get_pin_string_mode())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldnt this lead to "quitting after 0 pin attempts" when using string pin ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

advance_pin_count() is for to increment the index of p1 or p2 on normal attack.
I know that in string mode has protection of set_max_pin_attempts(1) implicit and also does not save .wpc file to avoid wrong.
To avoid any change in the index of p1 and/or p2 when using string pin, the use of if condition is good for it.

@feitoi feitoi changed the title cracker: change the type of variable pin_count from float to int stop attack when nack code is SETUP_LOCKED May 27, 2021
@feitoi
Copy link
Contributor Author

feitoi commented May 27, 2021

Analyzing the nack codes, I saw that when a router starts WPS lock, the code is 0x000F, and if continue attacking with the -L option, NACK is returned just after M2 and the nack code is 0x000F.
And also those routers that show are not with WPS lock, but it returns NACK soon after sending M2 and the nack code is also 0x000F. (#274 (comment))
So I think it's better stop the attack.

@rofl0r
Copy link
Collaborator

rofl0r commented Jan 25, 2022

oops, i totally forgot about this. but better late than never ;)

@feitoi feitoi deleted the type branch January 25, 2022 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants