Skip to content

armgit / AiSOC

Public Imported from GitHub
0

Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.

2.1 KB
Raw Blame
id: sigmahq-sigma-899133d5-4d7c-4a7f-94ee-27355c879d90
name: Python Inline Command Execution
description: Detects execution of python using the "-c" flag. This is could be used
  as a way to launch a reverse shell or execute live python code.
severity: medium
enabled: false
tags:
  mitre:
  - T1059
  categories:
  - endpoint
references:
- https://docs.python.org/3/using/cmdline.html#cmdoption-c
- https://www.revshells.com/
- https://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
logsource:
  category: process_creation
  product: windows
detection:
  selection_img:
  - OriginalFileName: python.exe
  - Image|endswith:
    - python.exe
    - python3.exe
    - python2.exe
  selection_cli:
    CommandLine|contains: ' -c'
  filter_main_python_1:
    ParentImage|startswith:
    - C:\Program Files\Python
    - C:\Program Files (x86)\Python
    ParentImage|endswith: \python.exe
    ParentCommandLine|contains: -E -s -m ensurepip -U --default-pip
  filter_main_python_trace:
    ParentImage|startswith:
    - C:\Program Files\Python
    - C:\Program Files (x86)\Python
    CommandLine|contains|all:
    - -W ignore::DeprecationWarning
    - '[''install'', ''--no-cache-dir'', ''--no-index'', ''--find-links'','
    - '''--upgrade'', ''pip'''
  filter_optional_vscode:
  - ParentImage|endswith: \AppData\Local\Programs\Microsoft VS Code\Code.exe
  - ParentImage:
    - C:\Program Files\Microsoft VS Code\Code.exe
    - C:\Program Files (x86)\Microsoft VS Code\Code.exe
  filter_optional_pip:
    CommandLine|contains|all:
    - <pip-setuptools-caller>
    - exec(compile(
  condition: all of selection_* and not 1 of filter_main_* and not 1 of filter_optional_*
provenance:
  source: SigmaHQ/sigma
  source_id: 899133d5-4d7c-4a7f-94ee-27355c879d90
  source_commit: df5c6a6
  license: DRL-1.1
  license_url: https://github.com/SigmaHQ/Detection-Rule-License
  imported_at: '2026-05-04'
  imported_by: sigma_importer
  upstream_path: rules/windows/process_creation/proc_creation_win_python_inline_command_execution.yml
falsepositives:
- Python libraries that use a flag starting with "-c". Filter according to your environment
notes:
  quarantine_reason: 'upstream status: test'