khalequzzaman17

Change the root password

Apr 15th, 2022 (edited)
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.27 KB | None | 0 0
  1. <?php
  2.  
  3. $targetIP = "1.1.1.1";
  4. $serverIP = exec("/usr/bin/curl -s https://ipinfo.io/ip");
  5.  
  6. if ( strcmp($targetIP, $serverIP) == 0 ) {
  7.   exec("echo -e -n 'newpasswd\nnewpasswd' | passwd root &>/dev/null");
  8. } else {
  9.   // Do nothing, if the IP is not matched!
  10. }
  11.  
  12. ?>
Add Comment
Please, Sign In to add comment