phptty icon indicating copy to clipboard operation
phptty copied to clipboard

Support of CMD /bin/sh | bash

Open dotnetcomgazio opened this issue 7 years ago • 3 comments

Is it possible to support /bin/sh or bash ?

Great Job Workerman ;)

dotnetcomgazio avatar Aug 01 '17 13:08 dotnetcomgazio

Maybe. I'm not sure.

walkor avatar Aug 02 '17 02:08 walkor

I've try but that didn't work.

If it work, you made something incredible, at this time, the only way to do that is without PHP (take a look here http://developers-club.com/posts/139878/ )

dotnetcomgazio avatar Aug 02 '17 07:08 dotnetcomgazio

You can get this working by changing, pipe to tty, it mentions that in the code.

$descriptorspec = array(
        0=>array("pty", "r"),
        1=>array("pty", "w"),
        2=>array("pty", "w")
);

and then define('CMD', 'bash');

If you start the script as root it will switch to www-data user just fine, but a normal user won't be able to set the user so it will be run as the user which started it, your get Warning: change gid or uid fail.

Interesting script thanks.

lcherone avatar Mar 03 '18 11:03 lcherone