Linux Suspicious Shell Command Lines for Exploit/Payload Delivery

Detects Linux command-line strings matching wget/piping, payload staging, permission changes, and socat/HTTP server execution patterns.

FreeReviewedSigma · High · v3
Product
linux
Author
Florian Roth (Nextron Systems) (SigmaHQ), DRL 1.1
Published
2017-08-21
Updated
2026-07-31
title: Linux Suspicious Shell Command Lines for Exploit/Payload Delivery
id: 4fc4637f-472b-4548-a671-ef2eee13b209
status: test
description: This rule flags Linux command lines containing keywords commonly seen in exploit and payload delivery workflows, such as downloading artifacts with wget and executing them via shell or bash, starting local HTTP servers, spawning interactive shells via pty, and using socat for command execution or network bridging. It also matches command fragments associated with common post-exploitation staging and persistence patterns, including base64 decoding into files, setting SUID/permissions on binaries, and writing to system startup locations like /etc/rc.local. The detection relies on process or command-line telemetry that captures the full shell command string to compare against the listed suspicious keyword patterns.
references:
  - https://web.archive.org/web/20170319121015/http://www.threatgeek.com/2017/03/widespread-exploitation-attempts-using-cve-2017-5638.html
  - https://github.com/rapid7/metasploit-framework/blob/eb6535009f5fdafa954525687f09294918b5398d/modules/exploits/multi/http/struts_code_exec_exception_delegator.rb
  - http://pastebin.com/FtygZ1cg
  - https://artkond.com/2017/03/23/pivoting-guide/
  - https://github.com/SigmaHQ/sigma/blob/master/rules/linux/builtin/lnx_shell_susp_commands.yml
author: Florian Roth (Nextron Systems), Huntrule Team
date: 2017-08-21
modified: 2021-11-27
tags:
  - attack.execution
  - attack.t1059.004
logsource:
  product: linux
detection:
  keywords:
    - wget * - http* | perl
    - wget * - http* | sh
    - wget * - http* | bash
    - python -m SimpleHTTPServer
    - -m http.server
    - import pty; pty.spawn*
    - socat exec:*
    - socat -O /tmp/*
    - socat tcp-connect*
    - "*echo binary >>*"
    - "*wget *; chmod +x*"
    - "*wget *; chmod 777 *"
    - "*cd /tmp || cd /var/run || cd /mnt*"
    - "*stop;service iptables stop;*"
    - "*stop;SuSEfirewall2 stop;*"
    - chmod 777 2020*
    - "*>>/etc/rc.local"
    - "*base64 -d /tmp/*"
    - "* | base64 -d *"
    - "*/chmod u+s *"
    - "*chmod +s /tmp/*"
    - "*chmod u+s /tmp/*"
    - "* /tmp/haxhax*"
    - "* /tmp/ns_sploit*"
    - nc -l -p *
    - cp /bin/ksh *
    - cp /bin/sh *
    - "* /tmp/*.b64 *"
    - "*/tmp/ysocereal.jar*"
    - "*/tmp/x *"
    - "*; chmod +x /tmp/*"
    - "*;chmod +x /tmp/*"
  condition: keywords
falsepositives:
  - Unknown
level: high
license: DRL-1.1
related:
  - id: 2aa1440c-9ae9-4d92-84a7-a9e5f5e31695
    type: derived