-
Notifications
You must be signed in to change notification settings - Fork 310
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
Add new features #49
Add new features #49
Conversation
binarymaster
commented
Sep 1, 2017
•
edited
Loading
edited
- Add ability to detect routers with "empty string" pins
- Argument for output file
- Full-length pin brute-force (for non-standard pins like 222222)
Great work again, binarymaster! Thanks alot for this one :) |
Added more useful features :) Related information about empty pin:
Test case 1:
Test case 2:
|
@wiire-a merge this and bump version? thanks :) |
@kimocoder will do tomorrow hopefully. I wanted to take a proper look at the changes before merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of changes before merging:
- snprintf with empty string warning (L 974-1047)
- dynamic memory allocation of pin (L 477-481-862)
src/pixiewps.c
Outdated
} else { | ||
if (i == 0) | ||
{ | ||
snprintf(pin, WPS_PIN_LEN + 1, ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be (to avoid compiler warnings):
pin[0] = '\0';
src/pixiewps.c
Outdated
free(buffer); | ||
free(result); | ||
|
||
snprintf(pin, WPS_PIN_LEN + 1, ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above (to avoid compiler warnings):
pin[0] = '\0';
src/pixiewps.c
Outdated
@@ -462,10 +474,12 @@ int main(int argc, char **argv) { | |||
|
|||
uint_fast8_t k = 0; | |||
uint_fast8_t found_p_mode = NONE; | |||
unsigned int pin; | |||
char *pin; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being just 8 + 1 characters in length I would avoid using dynamic memory allocation:
char pin[WPS_PIN_LEN + 1];
src/pixiewps.c
Outdated
uint32_t seed; | ||
uint32_t print_seed = 0; | ||
|
||
pin = calloc(WPS_PIN_LEN + 1, 1); if (!pin) goto memory_err; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the change proposed above this line would go.
In any case, to be more precise the line should be (although in C99 I believe sizeof(char) is always 1):
pin = calloc(WPS_PIN_LEN + 1, sizeof(char)); if (!pin) goto memory_err;
src/pixiewps.c
Outdated
@@ -841,6 +859,7 @@ int main(int argc, char **argv) { | |||
free(wps->warning); | |||
} | |||
|
|||
free(pin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With stack allocation this line would go (see above).
Thanks for the review! I fixed warnings and removed dynamic memory allocation for pin. |
The casts (when calling (char *)&pin are pointeless, pin is already of type pin is enough. In C the name of the array is already a pointer to the first element of the array (in fact |
Fixed :) |
Thank you! |
could you bump pixiewps version so it would be quickly included in Kali? thanks both of you |
Done (v1.3). Hopefully they'll upgrade. |
here it's assigned. again, thanks both @wiire-a & @binarymaster great work. |