Shell Exec disabled

1.8k views Asked by At

I'm having a bit of a trouble with the shell exec on my server. After following some tutorials I have changed my php.ini:

safe_mode   Off

disable_functions   pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,    pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,

suhosin.executor.func.blacklist passthru, show_source, system, pcntl_exec, popen, pclose, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, exec

This is my phpinfo() and there is no reference to shell_exec command. I don't know where this suhosin.executor.func.blacklist comes from as it is commented out in my /etc/php5/apache2/conf.d/suhosin.ini.

I'm using zpanel under Ubuntu 12.04. Thank you!

3

There are 3 answers

0
Ben On

It may be helpful to search for suhosin.executor.func.blacklist in all potential php.ini files, e.g.

grep -r suhosin.executor.func.blacklist /etc/php5

The entry may be set from within .htaccess in your application's directory or parent directories, too, e.g.

grep -r suhosin.executor.func.blacklist /var/www/

phpinfo() lists directories for .ini files, e.g.:

Scan this dir for additional .ini files => /foo/bar
Additional .ini files parsed => /foo/bar/php.ini
0
ANDiTKO On

It comes from your Apache VHOST Conf file. Usually located at

/etc/zpanel/configs/apache/httpd-vhosts.conf

If you cannot find your VHOST conf file try Zpanel -> Admin -> Module Admin -> Click on "Apache Config" Then find the "Apache VHOST Conf" path.

Then open that file into any text editor and remove that value for your custom vhost.

0
Tofeeq On

First you need to find the httpd.conf files

# find / -type f -name "httpd.conf"

then open the files one by one and search for shell_exec word or blacklist word

Example

# nano /etc/usrname/configs/apache/httpd-vhosts.conf

Press ctrl+w and type suhosin.executor.func.blacklist and hit enter remove shell_exec from this line and save file, after saving file restart your apache like

# service httpd restart