Detection rules › Sigma

Potential Perl Reverse Shell Execution

Status
test
Severity
high
Log source
category process_creation, product linux
Author
@d4ns4n_, Nasreddine Bencherchali (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects execution of the perl binary with the "-e" flag and common strings related to potential reverse shell activity

Known false positives

  • Unlikely

MITRE ATT&CK coverage

TacticTechniques
ExecutionNo specific technique

Telemetry coverage

PlatformRecord / event type
LinuxEvent ID 1: Process Create

Rule body

title: Potential Perl Reverse Shell Execution
id: 259df6bc-003f-4306-9f54-4ff1a08fa38e
status: test
description: Detects execution of the perl binary with the "-e" flag and common strings related to potential reverse shell activity
references:
    - https://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
    - https://www.revshells.com/
author: '@d4ns4n_, Nasreddine Bencherchali (Nextron Systems)'
date: 2023-04-07
tags:
    - attack.execution
logsource:
    category: process_creation
    product: linux
detection:
    selection_img:
        Image|endswith: '/perl'
        CommandLine|contains: ' -e '
    selection_content:
        - CommandLine|contains|all:
              - 'fdopen('
              - '::Socket::INET'
        - CommandLine|contains|all:
              - 'Socket'
              - 'connect'
              - 'open'
              - 'exec'
    condition: all of selection_*
falsepositives:
    - Unlikely
level: high

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_img

selection_img:
    Image|endswith: '/perl'
    CommandLine|contains: ' -e '

Stage 2: selection_content

selection_content:
    - CommandLine|contains|all:
          - 'fdopen('
          - '::Socket::INET'
    - CommandLine|contains|all:
          - 'Socket'
          - 'connect'
          - 'open'
          - 'exec'

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLinematch
  • -e
  • ::Socket::INET
  • Socket
  • connect
  • exec
  • fdopen(
  • open
field:"CommandLine" kind:match
Imageends_with
  • /perl
field:"Image" kind:ends_with value:"/perl"