Sigma rule: Python One-Liners with Base64 Decoding - Linux

A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-5d65c0135ed5, updated 2026-03-09T00:00:00.000Z.

Rule

Title
Python One-Liners with Base64 Decoding - Linux
Status
experimental
Level
high
Author
Hugh Ryan (HueCodes), Swachchhanda Shrawan Poudel (Nextron Systems)
Date
2026-03-09
File
rules/linux/process_creation/proc_creation_lnx_python_base64_encoded_execution.yml
Commit
ccbb0369507f796db0b0ae6854c8a2be471b9d84

Detects the use of Python's base64 decoding functions in command line executions on Linux systems.
Malicious scripts often use python one-liners to decode and execute base64-encoded payloads, which is a common technique for obfuscation and evasion.

Log source

product
linux
category
process_creation

Detection

selection_img:
    Image|contains: '/python'
selection_cli:
    CommandLine|contains|all:
        - 'import'
        - 'base64'
        - ' -c'
    CommandLine|contains:
        - '.decode'
        - 'b16decode'
        - 'b32decode'
        - 'b32hexdecode'
        - 'b64decode'
        - 'b85decode'
        - 'z85decode'
condition: all of selection_*

False positives (as the rule lists them)

  • Legitimate use of Python for decoding data, which is uncommon in typical enterprise environments but possible in development or data analysis contexts.

Tags

  • attack.execution
  • attack.stealth
  • attack.t1059.006
  • attack.t1027.010

MITRE ATT&CK ids this rule names

Related rules

References

Read on 2026-11-03T00:58:21.399Z under licence sigma-drl-1.1@d5f4c36a from https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/linux/process_creation/proc_creation_lnx_python_base64_encoded_execution.yml

Sources and licences

  • SigmaHQ

    "Python One-Liners with Base64 Decoding - Linux" by Hugh Ryan (HueCodes), Swachchhanda Shrawan Poudel (Nextron Systems) (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/linux/process_creation/proc_creation_lnx_python_base64_encoded_execution.yml.
    Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-License

    Detection Rule License (DRL) 1.1

Cite this page

Dragons Eye Ransomware Tracker, "Sigma rule: Python One-Liners with Base64 Decoding - Linux",
entity page, dataset version ref-5d65c0135ed5, updated 2026-03-09T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/55e862a8-dd9c-4651-807a-f21fcad56716 (accessed 2026-11-03).
Underlying source: SigmaHQ rule 55e862a8-dd9c-4651-807a-f21fcad56716, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.

Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.