0xspade

URL Fuzzer

Feb 12th, 2017
1,054
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.99 KB | None | 0 0
  1. <?
  2.     //  URL Fuzzer
  3.     //  Search Hidden Directories & your fucking files :O
  4.     //  By Spade
  5.     //  8==Dick Heads - - -
  6.     error_reporting(0);
  7.     set_time_limit(0);
  8.  
  9.     function headers($url){
  10.         // this thing is inspired in Knockpy shit!
  11.         $ulo = @get_headers($url);
  12.  
  13.         if($ulo[1] == "" || !empty($ulo[1])){
  14.             echo $ulo[1]."<br>";
  15.         }
  16.         if($ulo[2] == "" || !empty($ulo[2])){
  17.             echo $ulo[2]."<br>";
  18.         }
  19.         if($ulo[3] == "" || !empty($ulo[3])){
  20.             echo $ulo[3]."<br>";
  21.         }
  22.         if($ulo[4] == "" || !empty($ulo[4])){
  23.             echo $ulo[4]."<br>";
  24.         }
  25.         if($ulo[5] == "" || !empty($ulo[5])){
  26.             echo $ulo[5]."<br>";
  27.         }
  28.         if($ulo[6] == "" || !empty($ulo[6])){
  29.             echo $ulo[6]."<br>";
  30.         }
  31.         if($ulo[7] == "" || !empty($ulo[7])){
  32.             echo $ulo[7]."<br>";
  33.         }
  34.         if($ulo[8] == "" || !empty($ulo[8])){
  35.             echo $ulo[8]."<br>";
  36.         }
  37.     }//end of function
  38.  
  39.     function brutedir($url, $dir) {
  40.         //bring your own wordlist worthless
  41.  
  42.         $urls = $url."/".$dir;
  43.  
  44.         $headers = @get_headers($urls);
  45.         if($headers[0] == "HTTP/1.1 404 Not Found"){
  46.             echo "<font color='red'>[NOT FOUND] {$urls} does not exists..</font>";
  47.         }else if($headers[0] == 'HTTP/1.0 302 Found' && $headers[7] == "HTTP/1.0 404 Not Found"){
  48.             echo "<font color='red'>[NOT FOUND] {$urls} does not exists, Redirected to custom 404 Page..</font>";
  49.             flush();
  50.             @ob_flush();
  51.         }else if($headers[0] == "HTTP/1.0 302 Found"){
  52.             echo "<font color='red'>[NOT FOUND] {$urls} does not exists, Error 302..</font>";
  53.             flush();
  54.             @ob_flush();
  55.         }else if($headers[0] == "HTTP/1.0 301 Moved Permanently"){
  56.             echo "<font color='red'>[MOVED PERMANENTLY] {$urls} does not exists, Error 301..</font>";
  57.             flush();
  58.             @ob_flush();
  59.         }else if($headers[0] == "HTTP/1.1 200 OK"){
  60.             echo "<font color='lime'><a href='{$urls}' target='_blank'>[FOUND] {$urls}</a> does exists..</font>";
  61.             flush();
  62.             @ob_flush();
  63.             sleep(1);
  64.         }elseif(eregi('404', $headers[0])){
  65.             echo "<font color='red'>[NOT FOUND] {$urls} does not exists..</font>";
  66.             flush();
  67.             @ob_flush();
  68.         }elseif(eregi('403', $headers[0])){
  69.             echo "<font color='red'>[FORBIDDEN] {$urls} is forbidden..</font>";
  70.             flush();
  71.             @ob_flush();
  72.         }elseif(eregi('500', $headers[0])){
  73.             echo "<font color='red'>[INTERNAL SERVER ERROR] {$urls} is Server Error..</font>";
  74.             flush();
  75.             @ob_flush();
  76.         }elseif(eregi('301', $headers[0])){
  77.             echo "<font color='gold'>[MOVED PERMANENTLY] {$urls} has been moved..</font>";
  78.             flush();
  79.             @ob_flush();
  80.         }else{
  81.             echo "<font color='gold'>{$headers[0]} >> {$urls} :| </font>";
  82.             flush();
  83.             @ob_flush();
  84.             sleep(1);
  85.         }
  86.     }//end of function
  87.  
  88.     $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_CLIENT_IP'];
  89.     $token = bin2hex(base64_encode(crypt($ip.openssl_random_pseudo_bytes(32), 'spade')));
  90.     setcookie('csrf_token', $token);
  91. ?>
  92. <!DOCTYPE html>
  93. <html>
  94.     <head>
  95.         <meta charset='UTF-8'>
  96.                 <title>-[URL Fuzzer]-</title>
  97.                 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, user-scalable=0">
  98.                 <meta name="apple-mobile-web-app-capable" content="yes">
  99.                 <meta name="Author"       content="Spade | Spade Pirates | Purehackers"/>
  100.                 <meta name="keywords" content="URL Fuzzer, fuzzer, url, directory finder, file finder, where is your file" /><!-- Dagdagan na lang ng keywords next tym -->
  101.                 <meta name="copyright"    content="Spade"/>
  102.                 <meta name="description"  content="Just a URL Fuzzer type thing"/>
  103.                 <meta property="og:title" content="\m/ URL Fuzzer \m/"/>
  104.                 <meta property="og:image" content="http://fullhdpictures.com/wp-content/uploads/2015/11/FBI-Wallpapers-HD.jpg">
  105.  
  106.                 <link rel="shortcut icon" href="https://scontent.fmnl4-6.fna.fbcdn.net/v/t1.0-9/14063981_1156553544409664_2673515992550445874_n.jpg?oh=5185bf70a56b7a495bb49db9c785a129&oe=58BD08E3" />
  107.                 <link href='http://fonts.googleapis.com/css?family=Electrolize' rel='stylesheet'>
  108.                 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  109.                 <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
  110.                 <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
  111.  
  112.                 <style>
  113.                     body { font-family: 'Electrolize'; text-align: center; background: #333 url(http://static.tumblr.com/maopbtg/a5emgtoju/inflicted.png) repeat; color: white;}
  114.                     .title { display: block; margin-bottom: 0; font-size: 300%; overflow-y: hidden;}
  115.                     form { text-align: center; margin-top: 30px;}
  116.                     input, textarea { border: none; font-family: 'Courier';}
  117.                     .result { width: 75%; text-align: left; background: rgba(102, 102, 102, 0.1); position: relative; padding: 25px; border-radius: 10px; margin: auto;}
  118.                     .result a { color: lime; }
  119.                     a { text-decoration: none; }
  120.                     .url { background: transparent; color: white;   font-weight: bold;  font-size: 28px; border-bottom: 3px solid white; text-align: center;
  121.                             padding-left: 10px; padding-right: 10px; padding-top: 5px; padding-bottom: 5px; margin: 10px; width: 37%;}
  122.                     .url:focus { border: none; border-bottom: 3px solid lime; outline: none; }
  123.                     textarea {  background: transparent; padding: 15px; margin: 10px; border-radius: 10px;  border: 3px dashed white; color: white; width: 37%;
  124.                             height: 260px;  font-size: 18px; }
  125.                     textarea:focus { border: 3px dashed lime; outline: none; }
  126.                     .submit { margin: 15px; padding: 10px;  background: #609af7; width: 15%; border: none;  border-radius: 5px; font-size: 20px; color: white; cursor: pointer; outline: none;}
  127.                     .submit:hover { background: #2574f4; outline: none;}
  128.                     .l{ margin-top: 0; }
  129.                     .l a { color: white; }
  130.                     a:hover { color: cornflowerblue; }
  131.                     .footer a { color: white; }
  132.                     .footer {bottom: 0; width: 100%;}
  133.                     #popup { display: none; font-family: 'Electrolize'; border: none;}
  134.                     .what {padding: 5px 15px 5px 15px; margin: auto; line-height: 55px; background: gray; border-radius: 15px; cursor: help;}
  135.                     i { font-size: 12px; }
  136.                 </style>
  137.                 <script>
  138.                     $(document).ready(function() {
  139.                         $('#popup').dialog({
  140.                             autoOpen: false,
  141.                             width: 855,
  142.                             height: 112,
  143.                             resizable: false,
  144.                             draggable: false,
  145.                             height: "auto",
  146.                             show: {
  147.                                 effect:"bounce",
  148.                                 duration: 1000
  149.                                   },
  150.                             hide: {
  151.                                 effect: "explode",
  152.                                 duration: 1000
  153.                                   },
  154.                             modal: true,
  155.                             buttons: {
  156.                                     Ok: function() {
  157.                                             $(this).dialog('close');
  158.                                         }
  159.                                      }
  160.                         });
  161.                         $('.what').click(function() {
  162.                             $('#popup').dialog('open');
  163.                         });
  164.                     });
  165.                 </script>
  166.     </head>
  167.     <body>
  168.         <div id="popup" title="URL Fuzzer">
  169.             <p>The URL Fuzzer can be used to find hidden files and directories on a web server by fuzzing.<br>This is a discovery activity which allows you to discover resources that were not meant to be publicly accessible.<p><br>
  170.             <i>PS: I recommend to put a slash in the end of every word on your directory wordlist. ex: kewl/</i>
  171.         </div>
  172.  
  173.         <h1 class="title">PureHackers URL Fuzzer</h1>
  174.         <hr width="30%">
  175.         <p1 class="l">Developed by: <a class='spade' href='https://spade.byethost4.com/' target="_blank">Spade</a></p1><br>
  176.         <p1 class="what">What is this?</p1><br>
  177.         <form method="POST" autocomplete="off">
  178.             <input class="url" type="url" name="url" placeholder="ex: https://beeg.com/" required maxlength="100" title="Place Hostname Here"/><br>
  179.             <textarea name="dir" placeholder="Paste Your Wordlist here. ex: index.php or admin | one line per word :)" required /></textarea>
  180.             <input type="hidden" name="token" value="<?=$token?>" required /><br>
  181.             <input type="submit" class="submit" value="Let's Start"><br></form>
  182.             <br>
  183.            
  184.             <?
  185.                     if(isset($_POST['url'], $_POST['dir'], $_POST['token'], $_COOKIE['csrf_token'])){
  186.                         $url = filter_var($_POST['url'], FILTER_SANITIZE_URL);
  187.                         $urlx = rtrim($url, "/");
  188.                         $dir = explode("\n", htmlspecialchars($_POST['dir']));
  189.                         $cookie = filter_var(htmlspecialchars($_COOKIE['csrf_token']), FILTER_SANITIZE_STRING);
  190.                         $csrf_token = filter_var(htmlspecialchars($_POST['token']), FILTER_SANITIZE_STRING);
  191.  
  192.                         if($cookie != $token):
  193.                             die("INVALID CSRF TOKEN, Please Refresh the Page and try again!");
  194.                         endif;
  195.  
  196.                         echo "<div class=\"result\"><h2>Fetched Headers</h2><br>";
  197.                         echo headers($urlx);
  198.                         sleep(2);
  199.                         echo "<br><h2>Bruteforce {$url} Directories/Files</h2>";
  200.                         foreach($dir as $dirs):
  201.                             ob_flush();
  202.                             flush();
  203.                             $dirz = @trim(filter_var($dirs, FILTER_SANITIZE_STRING));
  204.                             echo brutedir($urlx,$dirz)."<br>";
  205.                             ob_end_flush();// thanks to my friend at 3xtr4ct cyber army for helping me outta here :v
  206.                         endforeach;
  207.                         echo "</div>";
  208.                     }
  209.                 ?>
  210.        
  211.         <br>
  212.         <div class=footer>
  213.             <p1> Dont have any wordlist of Files and Directories? <a href="http://thireus.frenchdev.com/SharedFiles/WordLists/WordLists-20111129.zip">Go Here</a></p1><br>
  214.             <p1>&copy; Copyright Spade <?=date('Y')?></p1>
  215.         </div>
  216.     </body>
  217. </html>
Add Comment
Please, Sign In to add comment