repl.it
@18mm/

Fast visual brute force password cracker

C

No description

fork
loading
Files
  • main.c
  • crack.c
  • obh.h
  • print.c
  • strings.c
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include "obh.h"

int main(void) {
  long long *crack_val;
  char buff[ABN], *c;
  bool valid_password = false;
  int mode = -1;
  bool crackin = true;
  
  print(serve_string(0));
  
  while (crackin) {
    print(serve_string(12));
    while (mode == -1) {
      printf("(>) ");
      fgets(buff, ABN, stdin);
      if (*buff == '0')
        mode = 0;
      else if (*buff == '1')
        mode = 1;
      else if (*buff == '2')
        mode = 2;
      else {
        putchar('\n');
        print(serve_string(13));
      }
    }
    putchar('\n');
    
    while(!valid_password) {
      print(serve_string(1));
      printf("(>) ");
      fgets(buff, ABN, stdin);
      if (strlen(buff) <= MAX_LEN && strlen(buff) > 0) {
        for (c = buff; *c; c++) {
          if (*c == '\n')
            *c = '\0';
          if ((!isprint(*c) || isspace(*c))
              && *c != '\0') {
            print(serve_string(9));
            break;
          }
        }
        if (*c == '\0')
          valid_password = true;
      }
      else
        print(serve_string(11));
    }
    
    printf("\n\ncrackin'...\n\n");
    
    if (mode == 0)
      crack_val = slow_mode_crack(buff);
    else if (mode == 1)
      crack_val = crack_password(buff);
    else if (mode == 2)
      crack_val = super_fast_crack(buff);
      
    printf("\n%s %lld %s %lld %s", 
            serve_string(5), crack_val[1],
            serve_string(7), crack_val[2],
            serve_string(8));
            
    valid_password = false;
    mode = -1;
    printf("\n\nAnother? (y or n):\n(>) ");
    fgets(buff, ABN, stdin);
    if (*buff != 'y')
      crackin = false;
  }
  
  return 0;
}
?