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

Add new features #49

Merged
merged 4 commits into from
Oct 7, 2017
Merged

Add new features #49

merged 4 commits into from
Oct 7, 2017

Conversation

binarymaster
Copy link
Contributor

@binarymaster binarymaster commented Sep 1, 2017

  • Add ability to detect routers with "empty string" pins
  • Argument for output file
  • Full-length pin brute-force (for non-standard pins like 222222)

@kimocoder
Copy link

Great work again, binarymaster! Thanks alot for this one :)

@binarymaster binarymaster changed the title Add support for empty string pin Add new features Sep 2, 2017
@binarymaster
Copy link
Contributor Author

binarymaster commented Sep 2, 2017

Added more useful features :)

Related information about empty pin:

Test case 1:

./pixiewps -e D0141B15656E96B85FCEAD2E8E76330D2B1AC1576BB026E7A328C0E1BAF8CF91664371174C08EE12EC92B0519C54879F21255BE5A8770E1FA1880470EF423C90E34D7847A6FCB4924563D1AF1DB0C481EAD9852C519BF1DD429C163951CF69181B132AEA2A3684CAF35BC54ACA1B20C88BB3B7339FF7D56E09139D77F0AC58079097938251DBBE75E86715CC6B7C0CA945FA8DD8D661BEB73B414032798DADEE32B5DD61BF105F18D89217760B75C5D966A5A490472CEBA9E3B4224F3D89FB2B -r 1728DDB6E2FE0299097E6AEE2571484E4A45873BAB4F642869574746A5568EBAD62AF802EF815664D08403A9D16F74D28277EA4C855FA8DECE39CCA92ADB1226C15087645B497478E7ECC7DC0DC57E0A7557D8E73041D379AA5D335392FA1E154A7909567DADBCC72FF69CDC9604C055AA42C80B871DFA1C28F8F71165305CED3B50D698E54D855939836331DBC9C197C43F157F5731AFB9124FE846CC99F2AB6D52DEC89BA0DF2B5DEE6F8864D125F7ED1A6800CEFCF85771930F43CB7D5966 -s 11FA59884F68CBC9B801D99AD5FB9E57DDFB800671E760768DBF28730ED26E25 -z 11FA59884F68CBC9B801D99AD5FB9E57DDFB800671E760768DBF28730ED26E25 -a 64DB405CC37BC332D573D771FABAB50C366E57F20AC63E39E7EBC40A4D0A97B5 -n 5C0D7C67117A59917708B50D20127BEF --start 03/1970 --end 04/1970

Test case 2:

./pixiewps -e D0141B15656E96B85FCEAD2E8E76330D2B1AC1576BB026E7A328C0E1BAF8CF91664371174C08EE12EC92B0519C54879F21255BE5A8770E1FA1880470EF423C90E34D7847A6FCB4924563D1AF1DB0C481EAD9852C519BF1DD429C163951CF69181B132AEA2A3684CAF35BC54ACA1B20C88BB3B7339FF7D56E09139D77F0AC58079097938251DBBE75E86715CC6B7C0CA945FA8DD8D661BEB73B414032798DADEE32B5DD61BF105F18D89217760B75C5D966A5A490472CEBA9E3B4224F3D89FB2B -r CE733463B55D3C410E59949D94F0B95FFF816DC2CBD27F0832F010121143F37FEBE96A22E7B43C1A4CCE45BBCDFE48A55BCACE804C0643286208DE9F620C9F8DF6B91D1F1AD7EB9398B49E28CCFA1349DFCB11943A6D6F40FC52C76BEDB2FECC516906A4C4FFF0C10AE337EF9F82E9AA4B695B3707256B4E13CEEA0E19B29E2B35BDFA8E09BD60F2B3FF78E9B3BD2A0A7D97B633A0046134BFC03C18AADA6A002C60709A56191DB258025C9249BB0668BFE45078F4AAA32E937FB88A802850BC -s 2FA02BFDBE2FC4010C6C655870CC8FABB651F930401C61BB23C28A04597F163F -z 2FA02BFDBE2FC4010C6C655870CC8FABB651F930401C61BB23C28A04597F163F -a 06C01B8D83A4B25EA741980E912F59F3687D22D277526F7F12774BDECDBB16E0 -n 6DDA2C0103BB28624169DCAC0B4D3D20 --start 01/1970 --end 02/1970

@kimocoder
Copy link

@wiire-a merge this and bump version? thanks :)

@wiire-a
Copy link
Owner

wiire-a commented Oct 5, 2017

@kimocoder will do tomorrow hopefully. I wanted to take a proper look at the changes before merging.

Copy link
Owner

@wiire-a wiire-a left a 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, "");
Copy link
Owner

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, "");
Copy link
Owner

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;
Copy link
Owner

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;
Copy link
Owner

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);
Copy link
Owner

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).

@binarymaster
Copy link
Contributor Author

Thanks for the review! I fixed warnings and removed dynamic memory allocation for pin.

@wiire-a
Copy link
Owner

wiire-a commented Oct 7, 2017

The casts (when calling crack(..., ....)):

(char *)&pin

are pointeless, pin is already of type char *. Just:

pin

is enough.

In C the name of the array is already a pointer to the first element of the array (in fact pin it's equal to &pin[0])

@binarymaster
Copy link
Contributor Author

Fixed :)

@wiire-a wiire-a merged commit 5ec1e43 into wiire-a:master Oct 7, 2017
@wiire-a
Copy link
Owner

wiire-a commented Oct 7, 2017

Thank you!

@kimocoder
Copy link

could you bump pixiewps version so it would be quickly included in Kali? thanks both of you

@wiire-a
Copy link
Owner

wiire-a commented Oct 7, 2017

Done (v1.3). Hopefully they'll upgrade.

@kimocoder
Copy link

kimocoder commented Oct 7, 2017

here it's assigned. again, thanks both @wiire-a & @binarymaster great work.

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

3 participants