We had a server (centos 5.2) with DA (version was the one before 1.36.0) with over 100 sites on them.
- The server was behind a Hardware Based firewall (WatchGuard) with the following ports open to public (80, 110, 143, 25, 21, 53, 443, 2222)
- SSH port 6022 was only open to our IP 202.62.33.2
- The server was running apache 1.3, with php 4.4.9 and mysql 4.
- There was also a software based firewall (APF) configured with BFD. APF was configured and was only allowing the above mentioned ports only including 6022.
- root & admin user ssh was disabled and we created a local user that was allowed to ssh
- php disable_functions=”proc_get_status,proc_nice,proc_open,proc_terminate,proc_close,dl,phpinfo,system,posix_kill,popen,exec,passthru,apache_note,apache_setenv,openlog,closelog,syslog,pcntl_exec,pclose,ini_restore,escapeshellcmd,escapeshellarg,define_syslog_variables”
- mod_evasive, mod_security were installed with apache
- php open_basedir was ON. Cant remember the settings for SAFE mode though
The hacker was able to delete /var/log folder and he also deformed the home page of most / all of the website(s).
When I logged into the server, I was able to see some perl scripts running(perl pull.pl).
Now my question is how in such a closed environment can this thing happen? What other measures can we take to make sure that this doesn’t happen again?
I am suspecting that the root cause is the webserver, but how was the hacker able to upload and run a script as a root user?
Any help would be much appreciated.
PS: i have attached the hacked example page
- The server was behind a Hardware Based firewall (WatchGuard) with the following ports open to public (80, 110, 143, 25, 21, 53, 443, 2222)
- SSH port 6022 was only open to our IP 202.62.33.2
- The server was running apache 1.3, with php 4.4.9 and mysql 4.
- There was also a software based firewall (APF) configured with BFD. APF was configured and was only allowing the above mentioned ports only including 6022.
- root & admin user ssh was disabled and we created a local user that was allowed to ssh
- php disable_functions=”proc_get_status,proc_nice,proc_open,proc_terminate,proc_close,dl,phpinfo,system,posix_kill,popen,exec,passthru,apache_note,apache_setenv,openlog,closelog,syslog,pcntl_exec,pclose,ini_restore,escapeshellcmd,escapeshellarg,define_syslog_variables”
- mod_evasive, mod_security were installed with apache
- php open_basedir was ON. Cant remember the settings for SAFE mode though
The hacker was able to delete /var/log folder and he also deformed the home page of most / all of the website(s).
When I logged into the server, I was able to see some perl scripts running(perl pull.pl).
Now my question is how in such a closed environment can this thing happen? What other measures can we take to make sure that this doesn’t happen again?
I am suspecting that the root cause is the webserver, but how was the hacker able to upload and run a script as a root user?
Any help would be much appreciated.
PS: i have attached the hacked example page