Persistence (TA0003)(external, opens in a new tab or window)
Initial Access (TA0001)(external, opens in a new tab or window)
Lateral Movement (TA0008)(external, opens in a new tab or window)
text code block:file where host.os.type == "linux" and event.action != "deletion" and ( process.name in ( "nginx", "apache2", "httpd", "caddy", "lighttpd", "httpd.worker", "httpd-worker", "httpd-prefork", "php-cgi", "php-fcgi", "php-cgi.cagefs", "frankenphp", "lshttpd", "litespeed", "openlitespeed", "fcgiwrap", "uwsgi", "daphne", "uvicorn", "hypercorn", "granian", "waitress-serve", "flask", "puma", "unicorn", "unicorn_rails", "thin", "rackup", "mongrel_rails", "starman", "plackup", "twiggy", "hypnotoad", "starlet", "unitd", "unitd-debug", "java", "node", "nodejs" ) or process.name like ( "php-fpm*", "lsphp*", "gunicorn*", "*.cgi", "*.fcgi", "mono*", "xsp*", "mod-mono-server*", "fastcgi-mono-server*", "python*", "ruby*", "perl*", "lua*" ) ) and file.extension in~ ( "php", "phtml", "pht", "php3", "php4", "php5", "php7", "phar", "asp", "aspx", "ashx", "asmx", "ascx", "cshtml", "jsp", "jspx", "jsx", "jspf", "tag", "tagx", "war", "ear", "js", "mjs", "cjs", "ts", "mts", "cts", "tsx", "razor", "py", "wsgi", "cgi", "fcgi", "pyc", "erb", "ru", "psgi", "lua", "luac", "sh", "elf" ) and file.Ext.header_bytes like ( "ffd8ff*", // JPEG / JPG "89504e470d0a1a0a*", // PNG "47494638*", // GIF (GIF87a / GIF89a) "00000100*", // ICO "00000200*", // CUR "424d*", // BMP "49492a00*", // TIFF (little endian) "4d4d002a*", // TIFF (big endian) "52494646*", // RIFF container (WEBP/AVI/etc) "255044462d*", // PDF "7f454c46*" // ELF )
Install detection rules in Elastic Security
Detect Potential Polyglot Bypass File Created by Web Server in the Elastic Security detection engine by installing this rule into your Elastic Stack.
To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).