Privilege Escalation (TA0004)(external, opens in a new tab or window)
text code block:event.category:process and host.os.type:linux and event.type:change and event.action:uid_change and user.id:0 and not process.parent.user.id:0 and not process.parent.group.id:0 and process.name:python* and process.working_directory:(/tmp* or /var/tmp* or /dev/shm* or /home/* or /run/user* or /var/run/user* or /var/www*) and process.parent.working_directory:(/tmp* or /var/tmp* or /dev/shm* or /home/* or /run/user* or /var/run/user* or /var/www*) and process.command_line:*
Install detection rules in Elastic Security
Detect Suspicious UID Change to Root via Python 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).