p0wny-shell
p0wny-shell copied to clipboard
Add pcntl to exec
If the target has the pcntl extension installed, then you can use the pcntl_exec funtion to execute system commands.
Hello,
I have some remarks and things I do not understand well in your PR:
- What is the purpose of the
$commandFileas it is never executed? - Why forking the process with
pcntl_fork()here? I think we want to block the main process until the command has finished its execution. - Why sleeping two seconds? Is it to wait for the command inside the forked process to finish its execution? What happens if it takes more than 2 seconds to complete?
- This code will work only on Unix-like systems (Linux, BSD,...), it will fails on Windows. A check must be added to be sure to run in a supported environment.
I think we should rework your PR before being able to merge it :)
The pcntl module does not support Windows, which means that the corresponding functions cannot exist on the Windows platform.