I am trying to execute the following command through PHP using shell_exec() function:
sudo -u USERNAME -pPASSWORD echo "SOME-STRING" > /dev/tcp/127.0.0.1/64444
but nothing happens (if I copy/paste it manually to the terminal it works). There is also nothing in the $output of the shell_exec() function.
So with that command I am trying to send a string over TCP through a different user with sudo privileges.
EDIT #1: The full PHP command looks like this:
shell_exec('sudo -u USERNAME -pPASSWORD echo "RLSET|79-192.168.1.33-0-1" > /dev/tcp/127.0.0.1/64444');
EDIT #2: I've also checked the phpinfo() function and safe_mode is off also the shell_exec() function is not on the disallowed functions list.
EDIT #4: My PHP PATH variable contains the following locations:
/usr/local/bin:/usr/bin:/bin
I'm lost here, any and all help would be appreciated.