ivan-sincek/php-reverse-shell

Does Not Work on Older Versions

Dedushkes opened this issue · 3 comments

First, you have syntax error:
$size = fstat($input)['size'];
This code not alloved in PHP 4, need use somethig like:

$fstat_input = fstat($input);
$size = $fstat_input['size'];

And if u fix it in all code syntax be correct. But not work! Im tested on two docker with php4 (misryan/php4 and nouphet/docker-php4) and get error:

AEMONIZE: pcntl_fork() does not exists, moving on...
PROC_ERROR: Cannot start the shell

Hi,

Thank you for submitting the bug.

I have implemented your solution:

$fstat = fstat($input);
$size = $fstat['size'];

Also, with the following fix (less arguments in proc_open()) the shell will work on nouphet/docker-php4:

$process = @proc_open($this->shell, $this->descriptorspec, $pipes/*, '/', null, $this->options*/);

I will push the update soon, after more testing.

Best regards,
Ivan.

Hi,

Thank you once again for submitting the bug.

I have never really tested the scripts on older PHP versions so I took some time and did it now.

I have also made thorough inspection of legacy documentation for PHP versions 4 and 5, as well as latest documentation for PHP versions 7 and 8.

I have fixed all the issues so far.

More info at php-legacy-docs.zend.com/manual/php4/en/function.proc-open.

Best regards,
Ivan.

I will close this issue now.