Detection rules › Sigma

HackTool - SharPersist Execution

Status
test
Severity
high
Log source
product windows, category process_creation
Author
Florian Roth (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects the execution of the hacktool SharPersist - used to deploy various different kinds of persistence mechanisms

MITRE ATT&CK coverage

TacticTechniques
ExecutionT1053 Scheduled Task/Job
PersistenceT1053 Scheduled Task/Job
Privilege EscalationT1053 Scheduled Task/Job

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: HackTool - SharPersist Execution
id: 26488ad0-f9fd-4536-876f-52fea846a2e4
status: test
description: Detects the execution of the hacktool SharPersist - used to deploy various different kinds of persistence mechanisms
references:
    - https://www.mandiant.com/resources/blog/sharpersist-windows-persistence-toolkit
    - https://github.com/mandiant/SharPersist
author: Florian Roth (Nextron Systems)
date: 2022-09-15
modified: 2023-02-04
tags:
    - attack.privilege-escalation
    - attack.execution
    - attack.persistence
    - attack.t1053
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\SharPersist.exe'
        - Product: 'SharPersist'
    selection_cli_1:
        CommandLine|contains:
            - ' -t schtask -c '
            - ' -t startupfolder -c '
    selection_cli_2:
        CommandLine|contains|all:
            - ' -t reg -c '
            - ' -m add'
    selection_cli_3:
        CommandLine|contains|all:
            - ' -t service -c '
            - ' -m add'
    selection_cli_4:
        CommandLine|contains|all:
            - ' -t schtask -c '
            - ' -m add'
    condition: 1 of selection_*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

1 of selection_*

Stage 1: selection_img

selection_img:
    - Image|endswith: '\SharPersist.exe'
    - Product: 'SharPersist'

Stage 2: selection_cli_1

selection_cli_1:
    CommandLine|contains:
        - ' -t schtask -c '
        - ' -t startupfolder -c '

Stage 3: selection_cli_2

selection_cli_2:
    CommandLine|contains|all:
        - ' -t reg -c '
        - ' -m add'

Stage 4: selection_cli_3

selection_cli_3:
    CommandLine|contains|all:
        - ' -t service -c '
        - ' -m add'

Stage 5: selection_cli_4

selection_cli_4:
    CommandLine|contains|all:
        - ' -t schtask -c '
        - ' -m add'

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
CommandLinematch
  • -m add
  • -t reg -c
  • -t schtask -c
  • -t service -c
  • -t startupfolder -c
Imageends_with
  • \SharPersist.exe corpus 2 (sigma 2)
Producteq
  • SharPersist