Skip to content

Commit

Permalink
improved code
Browse files Browse the repository at this point in the history
  • Loading branch information
t6x committed May 5, 2015
1 parent a28b0af commit 68515bd
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
Empty file modified src/wps/wps_attr_build.c
100755 → 100644
Empty file.
45 changes: 37 additions & 8 deletions src/wps/wps_registrar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1868,6 +1868,7 @@ static int wps_process_e_hash2(struct wps_data *wps, const u8 *e_hash2)
int pixie_test=0;
char pixie_pin[16];
char *aux_pixie_pin;
int i=0;

memset(pixie_pin, 0, sizeof(pixie_pin));

Expand All @@ -1883,19 +1884,33 @@ static int wps_process_e_hash2(struct wps_data *wps, const u8 *e_hash2)
if(aux_pixie_pin != NULL)
{
pixie_test = 0;
//exit(0);
break;
}


aux_pixie_pin = strstr(pixie_buf_aux,"WPS pin:");
if(aux_pixie_pin != NULL)
{
pixie_test = 1;
//exit(0);
//here will get the pin
strncpy(pixie_pin, aux_pixie_pin + 12, 8);

//a slightly better way to locate the pin
//thx offensive-security by attention

for(i=0;i<strlen(aux_pixie_pin);i++)
{
if(isdigit(aux_pixie_pin[i]))
{
strncpy(pixie_pin, aux_pixie_pin + i, 8);
break;
}
}

break;
}

}
printf("[Pixie-Dust]\n");

if(pclose(fpixe)) {
//printf("Command not found or exited with error status\n");
Expand Down Expand Up @@ -1926,19 +1941,33 @@ static int wps_process_e_hash2(struct wps_data *wps, const u8 *e_hash2)
if(aux_pixie_pin != NULL)
{
pixie_test = 0;
//exit(0);
break;
}

aux_pixie_pin = strstr(pixie_buf_aux,"WPS pin:");
if(aux_pixie_pin != NULL)
{
pixie_test = 1;
//exit(0);

//here will get the pin
strncpy(pixie_pin, aux_pixie_pin + 12, 8);

//a slightly better way to locate the pin
//thx offensive-security by attention

for(i=0;i<strlen(aux_pixie_pin);i++)
{
if(isdigit(aux_pixie_pin[i]))
{
strncpy(pixie_pin, aux_pixie_pin + i, 8);
break;
}
}

break;
}

}
printf("[Pixie-Dust]\n");

if(pclose(fpixe)) {
//printf("Command not found or exited with error status\n");
Expand Down Expand Up @@ -1982,8 +2011,8 @@ static int wps_process_e_hash2(struct wps_data *wps, const u8 *e_hash2)
}


printf("Running reaver with the correct pin, wait ...\n");
printf("Cmd : %s\n\n",cmd_reaver_test_aux);
printf("[+] Running reaver with the correct pin, wait ...\n");
printf("[+] Cmd : %s\n",cmd_reaver_test_aux);
printf("[Reaver Test] [+] BSSID: %s\n", mac2str(get_bssid(),':'));
printf("[Reaver Test] [+] Channel: %s\n", cmd_buf_c);
//printf("Command : \n", globule->cmd_reaver_test);
Expand Down

0 comments on commit 68515bd

Please sign in to comment.