rkm11

Active Member
May 30, 2007
31
0
156
I am looking to secure my server, and I need to know how many scripts are using shell_exec before I block that command. Is there a way I can log the scripts that use this command?

Thanks,
Ryan
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
16
313
Houston, TX
cPanel Access Level
Root Administrator
I am looking to secure my server, and I need to know how many scripts are using shell_exec before I block that command. Is there a way I can log the scripts that use this command?

Thanks,
Ryan
A grep on .php files for shell_exec may do the trick.

If you're unfamiliar with how to do this, there's been quite a few quick shell scripts posted to these forums that make use of grep that could possibly be modified to suit your needs.
 

forum17

Active Member
Mar 30, 2007
29
0
151
I am looking to secure my server, and I need to know how many scripts are using shell_exec before I block that command. Is there a way I can log the scripts that use this command?

Thanks,
Ryan
If you want to locate all script from /home partition which are using shell_exec then try these commands

cd /home
find -type f | xargs grep -l shell_exec

This command will give you list of all files which contains words shell_exec .

Regards,
Angelo S.
http://midnight-cafe.co.uk
 

rkm11

Active Member
May 30, 2007
31
0
156
If you want to locate all script from /home partition which are using shell_exec then try these commands

cd /home
find -type f | xargs grep -l shell_exec

This command will give you list of all files which contains words shell_exec .

Regards,
Angelo S.
http://midnight-cafe.co.uk
Thanks, I didn't know how to use grep with searching directories while at the same time only .php files. What command in addition to this (find -type f | xargs grep -l shell_exec) would search only .php files?

Thanks,
Ryan
 

rkm11

Active Member
May 30, 2007
31
0
156
I think I figured it out!

find -type f -name '*.php' | xargs grep -l shell_exec

Thanks for all the help!