Skip to content

Commit

Permalink
Bug Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Apr 13, 2015
1 parent ec29809 commit 4cbab1c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
14 changes: 13 additions & 1 deletion src/argsparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ int process_arguments(int argc, char **argv)
int long_opt_index = 0;
char bssid[MAC_ADDR_LEN] = { 0 };
char mac[MAC_ADDR_LEN] = { 0 };
char *short_options = "K:b:e:m:i:t:d:c:T:x:r:g:l:o:p:s:C:1:2:aA5ELfnqvDShwXN";
char *short_options = "K:b:e:m:i:t:d:c:T:x:r:g:l:o:p:s:C:1:2:ZaA5ELfnqvDShwXN";
struct option long_options[] = {
{ "pixie-dust", required_argument, NULL, 'K' },
{ "no-auto-pass", no_argument, NULL, 'Z' },
{ "interface", required_argument, NULL, 'i' },
{ "bssid", required_argument, NULL, 'b' },
{ "essid", required_argument, NULL, 'e' },
Expand Down Expand Up @@ -87,9 +88,19 @@ int process_arguments(int argc, char **argv)
{
switch(c)
{
case 'Z':
//set valor para auto get pass
set_op_autopass(0);
break;
case 'K':
//set valor para pixie
set_op_pixie(atoi(optarg));
if( (atoi(optarg)==1) || (atoi(optarg)==2) )
{
//need option -S, already set here
set_dh_small(1);
printf("Option (-K 1) or (-K 2) must use the -S option. -S Option enabled now, continuing.\n");
}
break;
case 'i':
set_iface(optarg);
Expand Down Expand Up @@ -219,6 +230,7 @@ void init_default_settings(void)
set_p1_index(0);
set_p2_index(0);
set_op_pixie(0);
set_op_autopass(1);
}

/* Parses the recurring delay optarg */
Expand Down
5 changes: 5 additions & 0 deletions src/globule.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,11 @@ void set_op_pixie(int index)
globule->op_pixie = index;
}

void set_op_autopass(int index)
{
globule->op_autopass = index;
}

void set_cmd_reaver_test(char *string)
{
/*
Expand Down
4 changes: 4 additions & 0 deletions src/globule.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ struct globals
*/
int op_pixie;
char cmd_reaver_test[4000];
int op_autopass;

} *globule;

Expand Down Expand Up @@ -247,5 +248,8 @@ void set_exec_string(char *string);
char *get_exec_string(void);
void set_oo_send_nack(int value);
int get_oo_send_nack(void);
void set_op_pixie(int index);
void set_op_autopass(int index);
void set_cmd_reaver_test(char *string);

#endif
4 changes: 2 additions & 2 deletions src/wps/wps_registrar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1884,7 +1884,7 @@ static int wps_process_e_hash2(struct wps_data *wps, const u8 *e_hash2)
//return -1;
}

if(pixie_test == 1)
if((pixie_test == 1) && (globule->op_autopass==1))
{
//here will make the test to get pass

Expand All @@ -1899,7 +1899,7 @@ static int wps_process_e_hash2(struct wps_data *wps, const u8 *e_hash2)
memset(cmd_reaver_test_aux, 0, sizeof(cmd_reaver_test_aux));
memset(cmd_buf_c, 0, sizeof(cmd_buf_c));

strcat(cmd_reaver_test_aux,"./reaver -i ");
strcat(cmd_reaver_test_aux,"reaver -i ");
strcat(cmd_reaver_test_aux,get_iface());

strcat(cmd_reaver_test_aux," -b ");
Expand Down
3 changes: 2 additions & 1 deletion src/wpscrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ int usage(char *prog_name)
fprintf(stderr, "\t-v, --verbose Display non-critical warnings (-vv for more)\n");
fprintf(stderr, "\t-q, --quiet Only display critical messages\n");
fprintf(stderr, "\t-K, --pixie-dust Test Pixie Dust [1] Basic(-S) [2] With E-Once(-S) [3] With PKR \n");
fprintf(stderr, "\t-Z, --no-auto-pass Not run automatically recover to get the password when the pixiewps retrieves the pin\n");
fprintf(stderr, "\t-h, --help Show help\n");

fprintf(stderr, "\nAdvanced Options:\n");
Expand All @@ -193,7 +194,7 @@ int usage(char *prog_name)
fprintf(stderr, "\t-1, --p1-index Set initial array index for the first half of the pin [False]\n");
fprintf(stderr, "\t-2, --p2-index Set initial array index for the second half of the pin [False]\n");

fprintf(stderr, "\nExample:\n\t%s -i mon0 -b 00:90:4C:C1:AC:21 -vv\n\n", prog_name);
fprintf(stderr, "\nExample:\n\t%s -i mon0 -b 00:90:4C:C1:AC:21 -vv -K 1\n\n", prog_name);

return EXIT_FAILURE;
}
Expand Down

0 comments on commit 4cbab1c

Please sign in to comment.