FortiSIEM Rules

PowerShell Commandlet of Well Known Exploitation Framework Detected

Rule ID

PH_Rule_TH_6

Default Status

Disabled

Description

Detects Commandlet names from well-known PowerShell exploitation frameworks, https://adsecurity.org/?p=2921 This rule requires collection of the Windows PowerShell Event Log: Microsoft-Windows-PowerShell/Operational via the FortiSIEM Agent.

Severity

9

Category

Security

MITRE ATT&CK® Tactics

Execution

Execution consists of techniques that result in adversary-controlled code running on a local or remote system. Techniques that run malicious code are often paired with techniques from all other tactics to achieve broader goals, like exploring a network or stealing data. For example, an adversary might use a remote access tool to run a PowerShell script that does Remote System Discovery.

https://attack.mitre.org/tactics/TA0002

MITRE ATT&CK® Techniques


T1059.001

Command and Scripting Interpreter: PowerShell

Adversaries may abuse PowerShell commands and scripts for execution. Adversaries can use PowerShell to perform a number of actions, including discovery of information and execution of code.

https://attack.mitre.org/techniques/T1059/001

Impacts

Other

Data Source

Windows Powershell Operational via Agent

Detection

Correlation

Remediation Guidance

No remediation guidance specified

Time Window

If the following pattern or patterns match an ingested event within the given time window in seconds, trigger an incident.

300 seconds

Trigger Conditions

If the following defined pattern/s occur within a 300 second time window.

Filter

SubPattern Definitions

SubPattern Name: Filter

This is the named definition of the event query, this is important if multiple subpatterns are defined to distinguish them.

SubPattern Query

This is the query logic that matches incoming events

eventType CONTAIN "Win-PowerShell-"  AND ( msg REGEXP (".*Invoke-DllInjection")  OR  msg REGEXP (".*Invoke-Shellcode")  OR  msg REGEXP (".*Invoke-WmiCommand")  OR  msg REGEXP (".*Get-GPPPassword")  OR  msg REGEXP (".*Get-Keystrokes")  OR  msg REGEXP (".*Get-TimedScreenshot")  OR  msg REGEXP (".*Get-VaultCredential")  OR  msg REGEXP (".*Invoke-CredentialInjection")  OR  msg REGEXP (".*Invoke-Mimikatz")  OR  msg REGEXP (".*Invoke-NinjaCopy")  OR  msg REGEXP (".*Invoke-TokenManipulation")  OR  msg REGEXP (".*Out-Minidump")  OR  msg REGEXP (".*VolumeShadowCopyTools")  OR  msg REGEXP (".*Invoke-ReflectivePEInjection")  OR  msg REGEXP (".*Invoke-UserHunter")  OR  msg REGEXP (".*Find-GPOLocation")  OR  msg REGEXP (".*Invoke-ACLScanner")  OR  msg REGEXP (".*Invoke-DowngradeAccount")  OR  msg REGEXP (".*Get-ServiceUnquoted")  OR  msg REGEXP (".*Get-ServiceFilePermission")  OR  msg REGEXP (".*Get-ServicePermission")  OR  msg REGEXP (".*Invoke-ServiceAbuse")  OR  msg REGEXP (".*Install-ServiceBinary")  OR  msg REGEXP (".*Get-RegAutoLogon")  OR  msg REGEXP (".*Get-VulnAutoRun")  OR  msg REGEXP (".*Get-VulnSchTask")  OR  msg REGEXP (".*Get-UnattendedInstallFile")  OR  msg REGEXP (".*Get-ApplicationHost")  OR  msg REGEXP (".*Get-RegAlwaysInstallElevated")  OR  msg REGEXP (".*Get-Unconstrained")  OR  msg REGEXP (".*Add-RegBackdoor")  OR  msg REGEXP (".*Add-ScrnSaveBackdoor")  OR  msg REGEXP (".*Gupt-Backdoor")  OR  msg REGEXP (".*Invoke-ADSBackdoor")  OR  msg REGEXP (".*Enabled-DuplicateToken")  OR  msg REGEXP (".*Invoke-PsUaCme")  OR  msg REGEXP (".*Remove-Update")  OR  msg REGEXP (".*Check-VM")  OR  msg REGEXP (".*Get-LSASecret")  OR  msg REGEXP (".*Get-PassHashes")  OR  msg REGEXP (".*Show-TargetScreen")  OR  msg REGEXP (".*Port-Scan")  OR  msg REGEXP (".*Invoke-PoshRatHttp")  OR  msg REGEXP (".*Invoke-PowerShellTCP")  OR  msg REGEXP (".*Invoke-PowerShellWMI")  OR  msg REGEXP (".*Add-Exfiltration")  OR  msg REGEXP (".*Add-Persistence")  OR  msg REGEXP (".*Do-Exfiltration")  OR  msg REGEXP (".*Start-CaptureServer")  OR  msg REGEXP (".*Get-ChromeDump")  OR  msg REGEXP (".*Get-ClipboardContents")  OR  msg REGEXP (".*Get-FoxDump")  OR  msg REGEXP (".*Get-IndexedItem")  OR  msg REGEXP (".*Get-Screenshot")  OR  msg REGEXP (".*Invoke-Inveigh")  OR  msg REGEXP (".*Invoke-NetRipper")  OR  msg REGEXP (".*Invoke-EgressCheck")  OR  msg REGEXP (".*Invoke-PostExfil")  OR  msg REGEXP (".*Invoke-PSInject")  OR  msg REGEXP (".*Invoke-RunAs")  OR  msg REGEXP (".*MailRaider")  OR  msg REGEXP (".*New-HoneyHash")  OR  msg REGEXP (".*Set-MacAttribute")  OR  msg REGEXP (".*Invoke-DCSync")  OR  msg REGEXP (".*Invoke-PowerDump")  OR  msg REGEXP (".*Exploit-Jboss")  OR  msg REGEXP (".*Invoke-ThunderStruck")  OR  msg REGEXP (".*Invoke-VoiceTroll")  OR  msg REGEXP (".*Set-Wallpaper")  OR  msg REGEXP (".*Invoke-InveighRelay")  OR  msg REGEXP (".*Invoke-PsExec")  OR  msg REGEXP (".*Invoke-SSHCommand")  OR  msg REGEXP (".*Get-SecurityPackages")  OR  msg REGEXP (".*Install-SSP")  OR  msg REGEXP (".*Invoke-BackdoorLNK")  OR  msg REGEXP (".*PowerBreach")  OR  msg REGEXP (".*Get-SiteListPassword")  OR  msg REGEXP (".*Get-System")  OR  msg REGEXP (".*Invoke-BypassUAC")  OR  msg REGEXP (".*Invoke-Tater")  OR  msg REGEXP (".*Invoke-WScriptBypassUAC")  OR  msg REGEXP (".*PowerUp")  OR  msg REGEXP (".*PowerView")  OR  msg REGEXP (".*Get-RickAstley")  OR  msg REGEXP (".*Find-Fruit")  OR  msg REGEXP (".*HTTP-Login")  OR  msg REGEXP (".*Find-TrustedDocuments")  OR  msg REGEXP (".*Invoke-Paranoia")  OR  msg REGEXP (".*Invoke-WinEnum")  OR  msg REGEXP (".*Invoke-ARPScan")  OR  msg REGEXP (".*Invoke-PortScan")  OR  msg REGEXP (".*Invoke-ReverseDNSLookup")  OR  msg REGEXP (".*Invoke-SMBScanner")  OR  msg REGEXP (".*Invoke-Mimikittenz") ) AND  msg NOT REGEXP (".*Get-SystemDriveInfo")

Group by Attributes

This defines how matching events are aggregated, only events with the same matching attribute values are grouped into one unique incident ID

reptDevName,reptDevIpAddr

Aggregate Constraint

This is most typically a numerical constraint that defines when the rule should trigger an incident

COUNT(*) >= 1

Incident Attribute Mapping

This section defines which fields in matching raw events should be mapped to the incident attributes in the resulting incident.

The available raw event attributes to map are limited to the group by attributes and the aggregate event constraint fields for each subpattern

destIpAddr=Filter.reptDevIpAddr,
destName=Filter.reptDevName