Generic bpftrace-based RCE/webshell prevention technique for critical Linux network services
Generic bpftrace-based RCE/webshell prevention technique for critical Linux network services. If for whatever reason you can't run it persistently, it could be useful also as a system-wide 'virtual patching' method.
The script focuses on monitoring and killing certain processes based on their parent process names when they invoke execve(), the system call used to execute new programs. I've tested it against different flavors of webshells (weevly, p0wny-shell, popen), httpd CVE-2021-41773, MySQL UDF Command Execution, httpd/nginx backdoors, different vuln webapps (PHP/Java), Kafka, Zimbra, Solr to name a few. Check it out, it's just a few lines of code, the magic is done behind bpftrace:
Read now