Advertisement
RieqyNS13

very simple dictionary attack

Dec 31st, 2012
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.66 KB | None | 0 0
  1. <?php
  2. /*Simple Dictionary Attack via Browser
  3. Coded by RieqyNS13
  4. devilzc0de.org*/
  5. error_reporting(0);
  6. set_time_limit(0);
  7. if(isset($_POST['btnSubmit'])){
  8.         if(empty($_POST['txHash'])){
  9.                 $hash = $_POST['txHash'];
  10.                 $string = $_POST['txString'];
  11.         }else{
  12.                 $string = null;
  13.                 $hash = trim($_POST['txHash']);
  14.                 $file = "hash.lst";
  15.                 $fopen = fopen($file, "w");
  16.                 fwrite($fopen, $hash);
  17.                 fclose($fopen);
  18.                 $str = array_unique(str_replace(array("\n", "\r", "\r\n"), "", file("wordlist_hash.lst")));
  19.                 $str2 = array_unique(str_replace(array("\n", "\r", "\r\n"), "", file($file)));
  20.                 foreach($str as $key){
  21.                         foreach($str2 as $key2){
  22.                                 if($key2==md5($key)){
  23.                                     $string.="[MD5]".$key2.":".$key."\n";
  24.                                     }
  25.                                 if($key2==sha1($key)){
  26.                                     $string.="[SHA1]".$key2.":".$key."\n";
  27.                                     }
  28.                                 }
  29.                         }
  30. }
  31.                
  32. }else{
  33.         $hash = null;
  34.         $string = null;
  35.  
  36. }
  37. ?>
  38. <html>
  39. <head>
  40. <title>Dictionary Attack</title>
  41. <style type="text/css">
  42. body, button{
  43. background:#000;
  44. color:#0F0;
  45. font-family:"Courier New";
  46. }
  47. legend, fieldset{
  48. border:dashed 1px #0F0;
  49. }
  50. #menu1{
  51. position:absolute;
  52. left:0px;
  53. top:30px;
  54. }
  55. #menu2{
  56. position:absolute;
  57. right:0px;
  58. top:30px;
  59. }
  60. button{
  61. border:dashed 1px;
  62. bottom:50px;
  63. }
  64. button:hover{
  65. opacity:0.7;
  66. }
  67. textarea{
  68. background:url("../images/DevilzC0de.png") no-repeat center;
  69. border:solid 1px #0F0;
  70. color:#0F0;
  71. font-family:"Courier New";
  72. }
  73. </style>
  74. </head>
  75. <body>
  76. <center>
  77.  
  78. <form method=POST action="<?php $_SERVER['PHP_SELF']; ?>">
  79. <fieldset id="menu1">
  80. <legend>Hash</legend>
  81. <textarea name="txHash" rows="30" cols="50"><?php echo $hash; ?></textarea>
  82. </fieldset>
  83. <button name="btnSubmit" type="submit">Submit</button>
  84. <fieldset id="menu2">
  85. <legend>String</legend>
  86. <textarea name="txString" id="tx" rows="30" cols="50" readonly><?php echo $string; ?></textarea>
  87. </fieldset>
  88. </form>
  89.  
  90. </center>
  91. </body>
  92. </html>
  93.  
  94. <?php
  95. /*Simple Dictionary Attack via Console
  96. Coded by RieqyNS13
  97. devilzc0de.org*/
  98. error_reporting(0);
  99. set_time_limit(0);
  100. $file = "hash.lst";
  101. $str = array_unique(str_replace(array("\n", "\r", "\r\n"), "", file("wordlist_hash.lst")));
  102. $str2 = array_unique(str_replace(array("\n", "\r", "\r\n"), "", file($file)));
  103. foreach($str as $key){
  104.     foreach($str2 as $key2){
  105.         ob_start();
  106.         if($key2==md5($key)){
  107.             echo "[MD5]".$key2.":".$key."\n";
  108.                 }
  109.         $string = ob_get_contents();
  110.         ob_end_clean();
  111.         echo $string;
  112.        
  113.         ob_start();
  114.         if($key2==sha1($key)){
  115.             echo "[SHA1]".$key2.":".$key."\n";
  116.                 }
  117.         $string = ob_get_contents();
  118.         ob_end_clean();
  119.         echo $string;
  120.             }
  121.         }
  122. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement