Query: write Sigma for Detects specific combinations of encoding methods in PowerShell via the commandline
Matching passage: Sigma rule: Detects specific combinations of encoding methods in PowerShell via the commandline. Logsource: windows / process_creation. Rule: title: Potential Encoded PowerShell Patterns In CommandLine id: cdf05894-89e7-4ead-b2b0-0a5f97a90f2f related: - id: 5b572dcf-254b-425c-a8c5-d9af6bea35a6 type: similar status: test description: Detects specific combinations of encoding methods in PowerShell via the commandline references: - https://speakerdeck.com/heirhabarov/hunting-for-powershell-abuse?slide=65 author: Teymur Kheirkhabarov (idea), Vasiliy Burov (rule), oscd.community, Tim Shelton date: 2020-10-11 modified: 2023-01-26 tags: - attack.stealth - attack.t1027 - attack.execution - attack.t1059.001 logsource: category: process_creation product: windows detection: selection_img: - Image|endswith: - \powershell.exe - \pwsh.exe - OriginalFileName: - PowerShell.EXE - pwsh.dll selection_to_1: CommandLine|contains: - ToInt - ToDecimal - ToByte - ToUint - ToSingle - ToSByte selection_to_2: CommandLine|contains: - ToChar - ToString - String selection_gen_1: CommandLine|contains|all: - char - join selection_gen_2: CommandLine|contains|all: - split - join condition: selection_img and (all of selection_to_* or 1 of selection_gen_*) falsepositives: - Unknown level: low
Near-miss passage: Sigma rule: Detects the creation of a suspicious ADS (Alternate Data Stream) file by software other than browsers. Logsource: windows / create_stream_hash. Rule: title: Creation Of a Suspicious ADS File Outside a Browser Download id: 573df571-a223-43bc-846e-3f98da481eca status: test description: Detects the creation of a suspicious ADS (Alternate Data Stream) file by software other than browsers references: - https://www.bleepingcomputer.com/news/security/exploited-windows-zero-day-lets-javascript-files-bypass-security-warnings/ author: frack113 date: 2022-10-22 modified: 2023-06-12 tags: - attack.stealth logsource: product: windows category: create_stream_hash detection: selection: Contents|startswith: '[ZoneTransfer] ZoneId=3' TargetFilename|endswith: :Zone.Identifier TargetFilename|contains: - .exe - .scr - .bat - .cmd - .docx - .hta - .jse - .lnk - .pptx - .ps - .reg - .sct - .vb - .wsc - .wsf - .xlsx filter_optional_brave: Image|endswith: \brave.exe filter_optional_chrome: Image: - C:\Program Files\Google\Chrome\Application\chrome.exe - C:\Program Files (x86)\Google\Chrome\Application\chrome.exe filter_optional_firefox: Image: - C:\Program Files\Mozilla Firefox\firefox.exe - C:\Program Files (x86)\Mozilla Firefox\firefox.exe filter_optional_ie: Image: - C:\Program Files (x86)\Internet Explorer\iexplore.exe - C:\Program Files\Internet Explorer\iexplore.exe filter_optional_maxthon: Image|endswith: \maxthon.exe filter_optional_edge_1: - Image|startswith: C:\Program Files (x86)\Microsoft\EdgeWebView\Application\ - Image|endswith: \WindowsApps\MicrosoftEdge.exe - Image: - C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe - C:\Program Files\Microsoft\Edge\Application\msedge.exe filter_optional_edge_2: Image|startswith: - C:\Program Files (x86)\Microsoft\EdgeCore\ - C:\Program Files\Microsoft\EdgeCore\ Image|endswith: - \msedge.exe - \msedgewebview2.exe filter_optional_opera: Image|endswith: \opera.exe filter_optional_safari: Image|endswith: \safari.exe filter_optional_seamonkey: Image|endswith: \seamonkey.exe filter_optional_vivaldi: Image|endswith: \vivaldi.exe filter_optional_whale: Image|endswith: \whale.exe filter_optional_snipping_tool: Image|startswith: C:\Program Files\WindowsApps\Microsoft.ScreenSketch_ Image|endswith: \SnippingTool\SnippingTool.exe TargetFilename|startswith: C:\Users\ TargetFilename|contains|all: - \AppData\Local\Packages\Microsoft.ScreenSketch_ - '\TempState\Screenshot ' TargetFilename|endswith: .png:Zone.Identifier condition: selection and not 1 of filter_optional_* falsepositives: - Other legitimate browsers not currently included in the filter (please add them) - Legitimate d