Advertisement
Cyb3r_h4ck3r

Php Dir3ct0ry Brut3r by cyb3r h4ck3r

Oct 10th, 2014
2,088
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.56 KB | None | 0 0
  1. <!--
  2. *************************************
  3. Direct0ry Brut3r  by cyb3r h4ck3r This is just for learning purposes
  4. Use at your own risk.
  5. *************************************
  6. -->
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  8. <html xmlns="http://www.w3.org/1999/xhtml">
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  11. <title>~Direct0ry Brut3r @cyb3r h4ck3r</title>
  12. <style>
  13. body { color:#FFF; font-size:14px;}
  14. .first{ margin-top:50px; text-align:center }
  15. .sec{color:#F00; text-align:center; font-size:22px;}
  16. .f1{margin-top:4px;}
  17. .custom{border:1px solid #999; width:32%; height:25px;margin:30px 0 0 429px;color:#F00; text-align:center;padding-top:4px;}
  18. .brute{ color:#3F6;  margin-left:20px; margin-top:5px; text-decoration:none;}
  19. .error{ color:#F00;  margin-left:20px;  margin-top:5px;}
  20. .msg{ color:#F00; margin:20px 0px 10px 20px; }
  21. .if{ color:#FFF;}
  22. .out{ border:1px solid #999; width:52%; margin:30px 0 0  325px;}
  23. .out:hover{ border:1px solid  #3FF; width:52%; margin:30px 0 0 325px;}
  24. .end{ margin-bottom:10px;}
  25. .tree{ margin-top:5px;}
  26. .sel{width:205px; margin-top:5px;}
  27. .com{color:#C60; margin:20px 0px 10px 20px;}
  28. </style>
  29. </head>
  30.  
  31. <body bgcolor="#000000">
  32. <div class="sec"> ~ Directory Brut3R ~ </div>
  33. <div class="first">
  34. <form action="" method="Post">
  35.  
  36. Your URL : &nbsp;&nbsp;<input type="text" name="url" value="" size="31" /><br /> Your wordList :
  37. <input class="f1" type="file" name="list" /><br/>
  38. Select status : <select class='sel' name="stat" size="1" >
  39.   <option   value="open">Open Directories</option>
  40.   <option   value="all">Get All Directory Stats</option>
  41. </select> <br/>
  42. <input class="f1" type="submit" value="_Brute_  " name="submit" /> <input type="reset" value="Reset" />
  43. </form>
  44. </div>
  45. </body>
  46. </html>
  47. <?php
  48. $url = $_POST["url"];
  49. $list = $_POST["list"];
  50. $stat=  $_POST['stat'];
  51. $url = $url."/";
  52. set_time_limit(0);
  53. error_reporting(0);
  54.  
  55. if ($url&&$list)
  56. {
  57. if(!preg_match("/^[a-zA-Z]+[:\/\/]+[A-Za-z0-9\-_]+\\.+[A-Za-z0-9\.\/%&=\?\-_]+$/i",$url))
  58.     {
  59.     echo "<div class='custom'>You must supply a valid URL.</div>";
  60.     exit;
  61.     }
  62.    
  63.     if(!is_file($list))
  64.     {
  65.     echo "<div class='custom'>[-] 00ps ! $list not valid .. :( </div>";
  66.     exit;
  67.     }
  68.    
  69.     else
  70.    
  71.     {
  72.         $list = file($list);
  73.  
  74.               ?>
  75.             <div class="out">
  76.              <?php
  77.             echo "<div class='msg'> <font color='#00CCFF'>&rArr; </font>&nbsp;BruteF0rce started . . . . . . . . .</div>";
  78.         foreach($list as $dir)
  79.         {  
  80.            $dir=str_replace("\r","",$dir);  
  81.            $dir=str_replace("\n","",$dir);
  82.            $dir=str_replace(" ","",$dir);
  83.          
  84.           if($stat=='all')
  85.             {
  86.           $headers = get_headers("$url$dir/",1);
  87.           echo "<div class='brute'>$url$dir/&nbsp;&nbsp;<font color='#FFFFFF'>&rArr;&nbsp;$headers[0]</font></div>";
  88.          
  89.             }
  90.          
  91.            else
  92.            {
  93.             $headers = get_headers("$url$dir/",1);
  94.               if (eregi('200', $headers[0]))
  95.                 {
  96.                 echo "<div class='tree'><a class ='brute' href='$url$dir'>[+]&nbsp;&nbsp;$url$dir/</a>&nbsp;&rArr;W00T FOUND!!&nbsp; <font color='#00FF00'>&radic;</font></div>";
  97.                 }
  98.             }
  99.           }
  100.         echo "<div class='com'> <font color='#00CCFF'>[</font>&nbsp;BruteF0rce Completed.<font color='#00CCFF'>]</font> </div>";
  101.         ?>
  102.         <div class='end'></div>
  103.             </div>
  104.             <?php
  105.             }}
  106. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement