Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.76 KB | None | 0 0
  1. /* md5 rappist by _iNFiNiTy__ of Web Hacking Paranoia (c) 2011 */
  2. // only for educational purposes
  3. /* requires knowledge in modern cryptography and cryptanalysis */
  4. #include <iostream>
  5. #include <windows.h>
  6. #include <md5.h>
  7. #include <string>
  8. #include <md5wrapper.h>
  9. #include <md5wrapper.cpp>
  10. #include <md5.cpp>
  11.  
  12. using namespace std;
  13.  
  14. typedef unsigned short int uint;
  15. typedef unsigned char uchar;
  16. typedef md5wrapper md;
  17. void checkPassword(string password);
  18. md md5;
  19. void bruteforce (uint width, uint position, string reversedHash);
  20. char chars[]={'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
  21. string hash;
  22. void bruteforce (uint width, uint position, string reversedHash)
  23. {
  24.      for (uint i=0;i<36;i++) {
  25.          if (position < width-1) {
  26.             bruteforce (width, position + 1, reversedHash+chars[i]);
  27.             }
  28.          checkPassword(reversedHash+chars[i]);
  29.          }
  30.       }
  31. void checkPassword(string reversedHash)
  32. {
  33.      cout << "\nTrying: " << reversedHash;
  34.      if (md5.getHashFromString(reversedHash.c_str()) == hash)
  35.      {
  36.         cout << "We have a match :D : " << reversedHash << endl;
  37.         getchar();
  38.         exit(0);
  39.         }
  40.      }
  41. int main()
  42. {
  43.     system ("color 02");
  44.     system ("title MD5 rappist by _iNFiNiTy__");
  45.     cout << "      MMO           MMO                                           " << endl;
  46.     cout << "     MMOMMO        MMOMMO                                             " << endl;
  47.     cout << "    MMO  MMO      MMO  MMO                                            " << endl;                                    
  48.     cout << "   MMO    MMO    MMO    MMO                                           " << endl;
  49.     cout << "  MMO      MMO  MMO       MMO          MD5 Bruteforcer by:      " << endl;
  50.     cout << " MMO        MMOMMO         MMO     _iNFiNITy__                   " << endl;
  51.     cout << "MMO          MMMMO         MMO                                     " << endl;
  52.     cout << " MMO       MMO   MMO      MMO                                " << endl;
  53.     cout << "  MMO    MMO      MMO    MMO                             " << endl;
  54.     cout << "   MMO  MMO        MMO  MMO                                  " << endl;
  55.     cout << "    MMOMMO          MMOMMO                                   " << endl;
  56.     cout << "     MMO             MMO                                    " << endl;
  57.     md md5;
  58.     cout << "Enter your md5 hash: ";
  59.     getline (cin, hash);
  60.     if (hash.length() != 32)
  61.     {
  62.        cout << "Error!!Invalid Input!" << endl;
  63.        main();
  64.        }
  65.     uint maxChars = 16;
  66.     for (uint i=1;i<maxChars;i++)
  67.     {
  68.         bruteforce (i,0,"");
  69.         }
  70.     getchar();
  71.     return 0;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement