Friday, 2018-02-23, 3:27 AM
Welcome Guest

Sec_rity without U

Main | C Md5 Cracker | Golden Dragon - Forum | Registration | Login | RSS
[ New messages · Members · Forum rules · Search · RSS ]
Page 1 of 11
Forum » Coding » C/C++/Obj-c Programming » C Md5 Cracker | Golden Dragon (C Md5 Cracker)
C Md5 Cracker | Golden Dragon
goldendragonDate: Tuesday, 2011-11-29, 8:26 PM | Message # 1
Sergeant
Group: Moderators
Messages: 23
Awards: 0
Reputation: 1
Status: Offline
#include <stdio.h>

#include <stdlib.h>
#include <string.h>
#include "md5.h"

void btf(int size, int pos, char curr[]);
int match(char* solution, char* testagainst);
void parse_arg( int argc, char *argv[] );

char* crackme;

int main( int argc, char *argv[] ) {
parse_arg(argc, argv);
printf("\nNow trying to crack %s\n\n", crackme);
int size;
for(size=1; size < 8; size++) {printf("-> Setting new Size to %i\n", size); btf(size,0,"");}
return 0;
}

void btf(int size, int pos, char curr[]) {
char* charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789";
int i;
if(pos < size){
for(i=0; i<strlen(charset);i++){
char test[strlen(curr) + 2];
strcpy(test, curr);
int len = strlen(test);
test[len] = charset;
test[len+1] = '\0';
btf(size, pos+1, test);
}} else {
if(match(crackme, curr) == 1) {
printf("Your Hash has been Cracked. md5( %s ) == %s\n", curr, crackme);
exit(0);
}
}
}

int match(char* solution, char* testagainst) {
char const* test = testagainst;
md5_state_t state;
md5_byte_t digg[16];
char hex_pres[33];
int coi;
md5_init(&state);
md5_append(&state, (const md5_byte_t *)test, strlen(test));
md5_finish(&state, digg);
for (coi = 0; coi < 16; ++coi) {
sprintf(hex_pres + coi * 2, "%02x", digg[coi]);
}
if(strcmp(solution,hex_pres) == 0) { return 1; } else { return 0; }
}

void parse_arg( int argc, char *argv[] ) {
printf("\t----------------------------\n");
printf("\t| Simple MD5-Cracker in C |\n");
printf("\t| |\n");
printf("\t| Written by Bonkers |\n");
printf("\t| |\n");
printf("\t| Stolen by [YourNameHere] |\n");
printf("\t| |\n");
printf("\t----------------------------\n");
if( argc != 2 || strlen(argv[1]) != 32) {
printf("Usage : ./BTF {MD5-HASH}\n\n");
exit(0);
} else { crackme = argv[1]; }
}
 
Forum » Coding » C/C++/Obj-c Programming » C Md5 Cracker | Golden Dragon (C Md5 Cracker)
Page 1 of 11
Search: