heroui logo

Inline Python Execution - Spawn Shell Via OS System Library

Sigma Rules

View Source
Summary
This detection rule aims to identify potentially malicious activities involving the execution of inline Python code with the goal of spawning a shell through the 'os.system' command. Specifically, it watches for the use of the '-c' option in Python commands, which allows executing arbitrary commands in the shell environment. The rule searches for process creation events on Linux systems where the command line contains both the references to the target Python binary and suspicious shell commands like '/bin/bash', '/bin/sh', etc. By combining these checks, the rule minimizes false positives while effectively highlighting misuse of Python capabilities that can lead to unauthorized access or code execution within the Linux environment.
Categories
  • Linux
  • Endpoint
Data Sources
  • Process
Created: 2024-09-02