void closest_pair(int64_t low, int64_t length){ // printf("\nentered closest_pair with low = %"PRId64"length = %"PRId64,low,length); if(length == 2){ P = X[low]; Q = X[low+1]; //return dist(X[low],X[low+1]) // base } else if(length==3){ bruteforce(low,length); } else if(length>3){ // printf("\nentered else"); closest_pair(low,(length/2)); // divide Pt pL1 = P, pL2 = Q; // int64_t d1 = (pL2.x - pL1.x)*(pL2.x - pL1.x) + (pL2.y - pL1.y)*(pL2.y - pL1.y); int64_t d1 = distance_square(pL1,pL2); // printf("\ndL = %"PRId64,d1); closest_pair(low+length/2,(length/2) + (length%2)); Pt pR1 = P, pR2 = Q; // int64_t d2 = (pR2.x - pR1.x)*(pR2.x - pR1.x) + (pR2.y - pR1.y)*(pR2.y - pR1.y); int64_t d2 = distance_square(pR1,pR2); // printf("\tdR = %"PRId64,d2); int64_t d = 0; if(d1<d2){ d=d1; P = pL1; Q = pL2; } else { d=d2; P = pR1; Q = pR2; } // printf("\tdmin = %"PRId64,d); // Sy = points in Py within d of L // merge Pt Sy[length],mid; int64_t j =0; mid.x = X[length/2].x; mid.y = X[length/2].y; for(int64_t i = low;i<(low+length);i++){ mid.y = X[i].x; if(is_closer_than(X[i],mid,d)){ Sy[j++] = X[i]; } } //For i = 1,...,|Sy|: //For j = 1,...,15: //d = min( dist(Sy[i], Sy[j]), d ) for(int64_t i = 0;i<j;i++){ for(int64_t k = 0; k<15;k++){ if(is_closer_than(Sy[i],Sy[k],d)){ P = Sy[i]; Q = Sy[k]; int64_t temp = distance_square(Sy[k],Sy[i]); (temp<d)?(d=temp):(d=d); } } } // Return d } // printf("\t Px = %"PRId64",Py = %"PRId64,P.x,P.y); // printf(" Qx = %"PRId64",Qy = %"PRId64,Q.x,Q.y); }
int main(void) { char pass[10+1]="xxxxxxxxxx"; fprintf(stderr,"\n[*] Password generation...\n\n"); bruteforce(pass,0); return 0; }
u_char cisco_decrypt(void) { u_char retval; time_t start, stop; tty_init(); time(&start); /* check if the arg is a valid md5 cisco IOS password */ if (cisco_is_ios_md5crypt(usr_opt.decryptopt.cipher)) cipher_engine = cisco_ios_cipher; /* check if the arg is a valid md5 PIX password */ else if (cisco_is_pix_md5crypt(usr_opt.decryptopt.cipher)) cipher_engine = cisco_pix_cipher; else tty_error(ERR_USAGE, "neither a Cisco IOS nor a PIX password -- `%s'", usr_opt.decryptopt.cipher); retval = (usr_opt.action == decrypt_wl || usr_opt.action == resume_wl) ? wordlist() : bruteforce(); time(&stop); if (usr_opt.verbose) tty_message("scan time: %g second(s)\n\n", difftime(stop, start)); return retval; }
int main() { std::string T = "Hello Hello How are you"; std::string P = "ello"; bruteforce(T, P); return 0; }
int main() { int array[] = {100, 113, 110, 85, 105, 102, 86, 63, 81, 101, 94, 106, 101, 79, 94, 90, 97}; printf("%d\n", bruteforce(array, 17)); printf("%d\n", efficient(array, 17)); return 0; }
int main() { char a[100]; char chars[]="abcdefghijklmnopqrstuvwxyz"; bruteforce(a,10,chars,sizeof(chars)); printf("%lld",p(2,2)); getchar(); return 0; }
void bsq(t_map *map) { long i; if (map == NULL) return; i = -1; bruteforce(map); my_dispmap(map); while (++i < map->row) free(map->map[i]); free(map->map); }
/* Iterate through all possible access codes. * This could take a loooooooooong time. */ inline int bruteforce(unsigned char* t, int deep) { int id = 5 - deep; for(t[id]=0; t[id]<255; t[id]++) { if(deep > 0) if(bruteforce(t, deep - 1) == 0) return 0; if(!yk_write_config(yk, coreconfig, coreconfignum, t)) { print_access_code("Fail", t); } else { print_access_code("\aWin", t); return 0; } } return -1; }
int main(int argc, char *argv[]) { int t = 0; int brute = 1; int opt; printf("Local sendmail 8.11.6 exploit by sorbo ([email protected])\n"); while( (opt = getopt(argc,argv,"t:bh")) != -1) { switch(opt) { case 't': t = atoi(optarg); if(t >= sizeof(targets)/sizeof(struct target_info)) { printf("Invalid target %d\n",t); exit(0); } brute = 0; break; case 'b': brute = 1; break; case 'h': default: usage(argv[0]); } } printf("Attempting to exploit %s\n",targets[t].description); if(brute) { bruteforce(targets[t]); exit(0); } printf("pvpbuf=\t\t0x%x\n",targets[t].pvpbuf); printf("zero=\t\t0x%x\n",targets[t].zero); printf("chunk=\t\t0x%x\n",targets[t].chunk); printf("shellcode=\t0x%x\n",targets[t].ret); t = exploit(targets[t]); if(t) printf("Exploit successfull\n"); else printf("Exploit failed... try adding -b\n"); exit(0); }
static inline void bruteforce(char *pass,byte ind) { for(register byte i=0;i<16;i++) { //speed-hack check if there is more two character consecutive if (ind>=2) if (pass[0] == pass[1] && pass[1] == pass[2]) continue; pass[ind]=characters[i]; if (ind==9) { if(checkpass(pass)) printf("%s\n",pass); } else bruteforce(pass,ind+1); } }
main(int argc, char *argv[]) { char *optionlist = "ba:h:"; int option; unsigned long start = BRUTE_START; unsigned long choose; int u_r_script_kiddy = 0; int Opterr = 1; banner(argv[0]); if(argc < 2) fprintf(stderr,"Use -h for help\n"); while( (option = getopt(argc,argv,optionlist) ) != -1) switch(option) { case 'b': u_r_script_kiddy=1; break; case 'h': banner(argv[0]); break; case 'a': choose = strtoul(optarg,NULL,0); make_buffer(choose); child_process(); exit(0); break; case '?': fprintf(stderr,"Unknown Option \n"); banner(argv[0]); exit(-1); default: banner(argv[0]); exit(-1); } if(u_r_script_kiddy) bruteforce(start); return 0; }
int main(int argc,char *argv[]) { char * option_list = "br:s:"; int option,brute = 0, opterr = 0; long ret,start = D_START; banner(argv[0]); if (argc < 1) exit(-1); while((option = getopt(argc,argv,option_list)) != -1) switch(option) { case 'b': brute = 1; break; case 'r': ret = strtoul(optarg,NULL,0); make_string(ret); tease(); exit(0); break; case 's': start = strtoul(optarg,NULL,0); break; case '?': fprintf(stderr,"[-] option \'%c\' invalid\n",optopt); banner(argv[0]); exit(-1); } if(brute) bruteforce(start); return 0; }
int main(int argc, char **argv) { int cnt, sel; char *offset; long returnaddr; if(argc == 1) { usage((char **)argv[0]); exit(1); } while((cnt = getopt(argc,argv,"t:b:o:")) != EOF) { switch(cnt) { case 't': //target distro sel = atoi(optarg); exploit(target[sel-1].ret,(char **)target[sel-1].path); break; case 'b': //brute force bruteforce((char **)target[sel-1].path); break; case 'o': //offset offset = atoi(optarg); returnaddr=esp()+offset; sel = atoi(optarg); exploit(returnaddr,(char **)target[sel-1].path); break; default: usage(&argv[0]); break; } } return(0); }
int main(int argc, char** argv) { char showmessage = 1; if((argc == 2) && (strcmp(argv[1], "-y") == 0)) showmessage = 0; if(showmessage == 1) { puts("--------------------------------------------"); puts("Hi! You're going to crack the access code of"); puts("a Yubikey. As soon as the appropriate code "); puts("is found, the AES key will be set to zeros."); puts("Brute forcing the code can take a very long "); puts("time, and with long I mean like more than a "); puts("year."); puts("(By the way you can bypass this message by "); puts("passing the -y option to the program.) "); puts("--------------------------------------------"); puts("Type \"start\" to continue."); char acknowledge[256]; fgets(acknowledge, 256, stdin); if(strcmp(acknowledge, "start\n") != 0) { puts("Quitting."); return EXIT_SUCCESS; } } yk = 0; unsigned char access_code[6]; const char* aeshash="00000000000000000000000000000000"; YKP_CONFIG *cfg = ykp_create_config(); YK_STATUS *st = ykds_alloc(); if(!yk_init()) { fputs("Failed to init Yubikey.\n", stderr); return EXIT_FAILURE; } if(!(yk = yk_open_first_key())) { fputs("No Yubikey found.\n", stderr); return EXIT_FAILURE; } if(!yk_get_status(yk,st)) { fputs("Failed to get status of the Yubikey.\n", stderr); return EXIT_FAILURE; } printf("Found Yubikey. Version: %d.%d.%d Touch level: %d\n", ykds_version_major(st), ykds_version_minor(st), ykds_version_build(st), ykds_touch_level(st)); if(!ykp_configure_for(cfg, 1, st)) { printf("Can't set configuration to 1.\n"); return EXIT_FAILURE; } if(ykp_AES_key_from_hex(cfg, aeshash)) { fputs("Bad AES key. WTF did you do to my source?", stderr); return EXIT_FAILURE; } coreconfig = ykp_core_config(cfg); coreconfignum = ykp_config_num(cfg); bruteforce(access_code, 5); if(st) free(st); if(!yk_close_key(yk)) { fputs("Can't close Yubikey! What the hell are you doing over there?", stderr); return EXIT_FAILURE; } if(!yk_release()) { fputs("Can't release Yubikey.", stderr); return EXIT_FAILURE; } if(cfg) ykp_free_config(cfg); return EXIT_SUCCESS; }