Advertisement
m-a_labz

md5 hash lookuper #cmd

Mar 4th, 2014
859
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 7.60 KB | None | 0 0
  1. #!/usr/bin/perl
  2. # m-a_labz © s4e
  3. use LWP::UserAgent;
  4. use WWW::Mechanize;
  5. use Digest::MD5 qw(md5_hex);
  6. use strict;
  7. my $uag = LWP::UserAgent->new;
  8. $uag->agent('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.4');
  9. $uag->timeout(30);
  10. print "\n[+] Hash Lookuper \n";
  11. print "\t Total Sites : 28\n\n";
  12. a:
  13. print "*  Hash : ";
  14. my $hash = <stdin>;
  15. chomp($hash);
  16. my @hashes;
  17. if ($hash =~ /\.txt/){
  18. open (hashes, "<".$hash) || die "[-] Can't open Hashes list \n";
  19. @hashes = <hashes>;
  20. close hashes;
  21. }else{
  22. @hashes = ($hash);
  23. }
  24. print " + Total Hashes : ".scalar(@hashes)."\n\n";
  25. foreach my $h(@hashes)
  26. {
  27. chomp($h);
  28. $h =~ s/\s//g;
  29. if($h =~ /[a-f0-9]{32}/){
  30. print "* Looking for ".$h."\n\n";
  31. spec2($h);
  32. postcracked($h);
  33. getcracked($h);
  34. nafsiyeh($h);
  35. }else{
  36. print "- ".$h." Not a Valid Md5 \n";
  37. }
  38. }
  39. print "\n\t ------------------------------- \n";
  40. goto a;
  41. sub postcracked{
  42. my @url = ("http://md5.my-addr.com/md5_decrypt-md5_cracker_online/md5_decoder_tool.php","http://www.cloudcracker.net/index.php","http://md5decryption.com/","http://md5online.net/","http://www.freemd5.com/index.php","http://www.hashscan.com/","http://md5pass.info/");
  43. my @names = ("http://md5.my-addr.com/","http://www.cloudcracker.net/","http://md5decryption.com/","http://md5online.net/","http://www.freemd5.com/","http://www.hashscan.com/","http://md5pass.info/");
  44. my @posts = ("md5=".$_[0],"inputbox=".$_[0]."&submit=Crack+MD5+Hash%21","hash=".$_[0]."\&submit=Decrypt+It\%21","pass=".$_[0]."\&option=hash2text\&send=Submit","md5=".$_[0]."&crackencryption=decryption","hash=".$_[0],"hash=".$_[0]."&get_pass=Get+Pass");
  45. my @regexs = ("Hashed string<\/span>\: (.*?)<\/div>","value=\"(.*?)\" \/>             ","Decrypted Text\: <\/b>(.*?)<\/font>","<br>pass : <b>(.*?)<\/b><\/p><\/table>","<h2>MD5 Decryption Result:<br>(.*?)<\/h2>","<td><font color=\"green\"><b>(.*?)<\/b><\/font><\/td><\/tr>","Password - <b>(.*?)<\/b>");
  46. my @pnotfound = ("not found in database<\/div>","Sorry\, password not found\.","Sorry\, this MD5 hash wasn\'t found in our database","not found in our database\.<\/p><\/center><\/table>","<h2>There is no data\.<\/h2>","<p><font color=\"orange\">MD5 hash not found in our wordlist\.<\/font><\/p>","\nNot found! ");
  47. my $counter;
  48.  
  49. for ($counter=0; $counter<$#url + 1; $counter++){
  50. my $req = HTTP::Request->new(POST => $url[$counter]);
  51. $req->content_type('application/x-www-form-urlencoded');
  52. $req->content($posts[$counter]);
  53. my $res = $uag->request($req);
  54. if ($res->is_success) {
  55. if ($res->content !~ m/$pnotfound[$counter]/i)
  56. {
  57. if($res->content =~ m/$regexs[$counter]/i){
  58. print "\t+ ".$names[$counter] ."   Password : ".$1."\n";
  59. next;
  60. }
  61. elsif ($res->status_line =~ /404,501,301/) {
  62. print "\t- ".$names[$counter] ."   Seem to be down \n";
  63. }
  64. else{
  65. print "\t- ".$names[$counter] ."   Error \n";
  66. }
  67. }
  68. else{
  69. print "\t- ".$names[$counter] ."   Password Not Found \n";
  70. }
  71. }
  72. }
  73. }
  74. sub spec2 {
  75. my $site = "http://md5online.org/";
  76. $hash = $_[0];
  77. my $req = HTTP::Request->new(GET => $site);
  78. $req->header(Accept => 'text/xml,application/xml,application/xhtml+xml,text/html');
  79. my $res = $uag->request($req);
  80. if ($res->content =~ /<input type=\"hidden\" name=\"a\" value=\"(.*?)\">/){$a = $1;}else{print $res->content."\n";}
  81. my $req = HTTP::Request->new(POST => $site);
  82. $req->content_type('application/x-www-form-urlencoded');
  83. my $post = "md5=".$hash."&search=1&action=decrypt&a=".$a;
  84. $req->content($post);
  85. my $res = $uag->request($req);
  86. if($res->content =~ m/Found : <b>(.*?)<\/b>/i){
  87. my $f = $1;
  88. chomp($f);
  89. if (md5_hex($f) =~ $_[0] )
  90. { print "\t+ ".$site."   Password : ".$f."\n";
  91. }else{
  92. print "\t- ".$site ."   Password Not Found \n";
  93. }
  94. }
  95. else{
  96. print "\t- ".$site ."   Password Not Found \n";
  97. }
  98. }
  99. sub getcracked{
  100. my @geturls = ("http://hashes.org/api.php?do=check&hash1=".$_[0],"http://md5.rednoize.com/?p&s=md5&q=".$_[0],"http://md5decoder.org/".$_[0],"http://netmd5crack.com/cgi-bin/Crack.py?InputHash=".$_[0],"http://www.md5rainbow.com/".$_[0],"http://md5decoder.com/".$_[0],"http://all-the-numbers.com/MD5-Message-Digest-5/".$_[0].".html","http://md5reverse.insdy.net/decrypt_md5/".$_[0],"http://".$_[0].".haq4u.com/","http://md5cracker.com/qkhash.php?option=plaintext&pass=".$_[0],"http://www.md5-hash.com/md5-hashing-decrypt/".$_[0],"http://md5geek.com/".$_[0],"http://hash-decrypt.pl/decrypt/".$_[0],"http://md5cracker.altervista.org/search.php?hash=".$_[0],"https://api.leakdb.net/?t=".$_[0],"http://hashdatabase.info/crack?hash=".$_[0],"http://www.stringfunction.com/md5-decrypter.html?st=".$_[0]);
  101. my @getnames = ("http://hashes.org/","http://md5.rednoize.com/","http://md5decoder.org/","http://netmd5crack.com/","http://www.md5rainbow.com/","http://md5decoder.com/","http://all-the-numbers.com/","http://md5reverse.insdy.net/","http://haq4u.com/","http://md5cracker.com/","http://www.md5-hash.com/","http://md5geek.com/","http://hash-decrypt.pl/","http://md5cracker.altervista.org/","http://leakdb.net/","http://hashdatabase.info/","http://www.stringfunction.com/");
  102. my @getregexs = ("<found>true<\/found><plain>(.*?)<\/plain>","\"(.*?)\"\n","Phrase\: \"(.*?)\" hashed","<\/td><td class=\"border\">(.*?)<\/td><\/tr><\/table>\n<i>","</h1>\n(.*?)<br/>","<center>(.*?)<\/center><\/h1>","This is MD5 hash for word \"(.*?)\"\.","   <title>MD5 Reverse \: ".$_[0]." - (.*?)<\/title>","\.haq4u.com\">(.*?)<\/a><\/br>","Plain Text\: (.*?)\n","<strong class=\"result\">(.*?)<\/strong><\/p>","\">(.*?)\n<\/span","Found a match\: (.*?)\n<\/p>","<tr><td width=200>".$_[0]."<\/td><td width=200>(.*?)<\/td>","plaintext=(.*?)\n","<td><strong>(.*?)<\/strong><\/td>","textarea_md5_decrypter\">(.*?)<\/textarea>");
  103. my @gnotfound = ("<found>false<\/found>","bool\(false\)","\:\~\:no\:\~\:","Sorry\, we don\'t have that hash in our database\.","<p>Sorry\, no reverse string was found\.<\/p>","No match found\. Please try another one\:","<nobr>".$_[0]."<\/nobr><\/h1>Hash string stat\:<p>","MD5 sum not found\.<\/em>","\:\~\:no\:\~\:","Not Found","<\/strong> not found in our database\.<\/h3>","<div class=\"not\-found\">","We\'re sorry but the hash you gave","<font color=\#FF0000>Hash Not Found<\/font>","\:\~\:no\:\~\:","Sorry this string is not in our database <br \/>","Sorry\, we were unable to find the original");
  104. my $counter;
  105. for ($counter=0; $counter<$#geturls + 1; $counter++)
  106. {
  107. my $req = HTTP::Request->new(GET => $geturls[$counter]);
  108. $req->header(Accept => 'text/xml,application/xml,application/xhtml+xml,text/html');
  109. my $res = $uag->request($req);
  110. if ($res->is_success) {
  111. if ($res->content !~ m/$gnotfound[$counter]/i)
  112. {
  113. if($res->content =~ m/$getregexs[$counter]/i){
  114. print "\t+ ".$getnames[$counter] ."   Password : ".$1."\n";
  115. next;
  116. }
  117. elsif ($res->status_line =~ /404,501,301/) {
  118. print "\t- ".$getnames[$counter] ."   Seem to be down \n";
  119. }
  120. else{
  121. print "\t- ".$getnames[$counter] ."   Error \n";
  122. }
  123. }
  124. else{
  125. print "\t- ".$getnames[$counter] ."   Password Not Found \n";
  126. }
  127. }
  128. }
  129. }
  130.  
  131.  
  132.  
  133. sub nafsiyeh{
  134. my @nurl = ("http://md5.gromweb.com/query/".$_[0],"http://md5.darkbyte.ru/api.php?q=".$_[0],"http://reversemd5.com/get?md5=".$_[0]);
  135. my @nnames = ("http://md5.gromweb.com/","http://md5.darkbyte.ru/","http://reversemd5.com/");
  136. my $counter;
  137.  
  138. for ($counter=0; $counter<$#nurl + 1; $counter++){
  139. my $req = HTTP::Request->new(GET => $nurl[$counter]);
  140. $req->header(Accept => 'text/xml,application/xml,application/xhtml+xml,text/html');
  141. my $res = $uag->request($req);
  142. if ($res->is_success) {
  143.     if(length($res->content) > 1){
  144. print "\t+ ".$nnames[$counter] ."   Password : ".$res->content."\n";
  145. next;
  146. }
  147. else{
  148. print "\t- ".$nnames[$counter] ."   Password Not Found \n";
  149. }
  150. }else{
  151. print "\t- ".$nnames[$counter] ."   Password Not Found \n";
  152. }
  153. }
  154. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement