Posted 25 December 2003 - 04:27 PM
root shell? :huh:
who's the smart that runs php as root?, it is possible run everything, bue in two conditions..
first one: php must have a bug that may be exploitable via overflow, and not DoS lika what appens if you got a loop for example with a bug.. and you only got rootshell if the program is runing as root or suided :)
the snd: you need the shellcode for waht y need to execute, for example, i have found some times ago a little exploit for kernels 2.4.20 that executes a /bin/sh shell
well, interesting, but ive got priveliges on a webserver to run shell commands via http, so i don't need /bin/sh for nothing! i just create my own version (yes some little code ripped :P) to create a user pwned in passwd insted of execute a shell, nice hein? yes i could put a bindshell, but the host is firewalled..i have only sshd and httpd on the target
so to run a shell with php u need:
check if php has a bug or if it is suided
setuid (0);
to get root if is suided
sexec /bin/sh
to execute the shell
and voil.. well just overwritte the index pointer to point to the shellcode in the memory ;)
"smash the stack for fun and proof it" google it :)