SOAR

Panther

3,750 rules · Sigma detections in Panther syntax
The same Sigma detection corpus, machine-rendered into Panther query syntax and ready to paste. Switch platforms above for identical coverage in another language, or choose Sigma (generic) for the portable YAML.
Download all 3,742 rules (.zip, 1.7 MB) Every Panther query in this view, packaged to deploy.
Using these Sigma rules
Deploy. Pick your SIEM above and paste the rendered query straight into a saved search or detection rule, or expand any rule to convert its generic YAML inline to the language you run.
Adapt. Map the field names to your log schema - Sigma assumes a normalised taxonomy - and tune thresholds and timeframes to your own baseline before you trust the alert.
Validate. Every rule is mapped to ATT&CK, so run the matching Atomic Red Team test on /atomic to confirm the rule actually fires before you rely on it.

Detection rules

50 shown of 3,750
high
Potential Windows Defender AV Bypass Via Dump64.EXE Rename
Detects when a user is potentially trying to bypass the Windows Defender AV by renaming a tool to dump64.exe and placing it in the Visual Studio folder. Currently the rule is covering only usage of procdump but other utilities can be added in order to increase coverage.
status test author Austin Songer @austinsonger, Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems) id 129966c9-de17-4334-a123-8b58172e664d
panther query
def rule(event):
    if all(
        [
            event.deep_get("Image", default="").startswith(":\\Program Files"),
            "\\Microsoft Visual Studio\\" in event.deep_get("Image", default=""),
            event.deep_get("Image", default="").endswith("\\dump64.exe"),
            any(
                [
                    event.deep_get("OriginalFileName", default="") == "procdump",
                    any(
                        [
                            " -ma " in event.deep_get("CommandLine", default=""),
                            " -mp " in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potential Windows Defender AV Bypass Via Dump64.EXE Rename
id: 129966c9-de17-4334-a123-8b58172e664d
status: test
description: |
    Detects when a user is potentially trying to bypass the Windows Defender AV by renaming a tool to dump64.exe and placing it in the Visual Studio folder.
    Currently the rule is covering only usage of procdump but other utilities can be added in order to increase coverage.
references:
    - https://twitter.com/mrd0x/status/1460597833917251595
author: Austin Songer @austinsonger, Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
date: 2021-11-26
modified: 2024-06-21
tags:
    - attack.credential-access
    - attack.t1003.001
logsource:
    product: windows
    category: process_creation
detection:
    selection_dump:
        Image|startswith: ':\Program Files'
        Image|contains: '\Microsoft Visual Studio\'
        Image|endswith: '\dump64.exe'
    selection_tools_procdump:
        - OriginalFileName: 'procdump'
        - CommandLine|contains:
              - ' -ma ' # Full Dump
              - ' -mp ' # Mini Plus
    condition: selection_dump and 1 of selection_tools_*
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
Potential Windows Defender Tampering Via Wmic.EXE
Detects potential tampering with Windows Defender settings such as adding exclusion using wmic
status test author frack113 id 51cbac1e-eee3-4a90-b1b7-358efb81fa0a
panther query
def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("OriginalFileName", default="") == "wmic.exe",
                    event.deep_get("Image", default="").endswith("\\WMIC.exe"),
                ]
            ),
            "/Namespace:\\\\root\\Microsoft\\Windows\\Defender"
            in event.deep_get("CommandLine", default=""),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potential Windows Defender Tampering Via Wmic.EXE
id: 51cbac1e-eee3-4a90-b1b7-358efb81fa0a
status: test
description: Detects potential tampering with Windows Defender settings such as adding exclusion using wmic
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/5c1e6f1b4fafd01c8d1ece85f510160fc1275fbf/atomics/T1562.001/T1562.001.md
    - https://www.bleepingcomputer.com/news/security/gootkit-malware-bypasses-windows-defender-by-setting-path-exclusions/
    - https://www.bleepingcomputer.com/news/security/iobit-forums-hacked-to-spread-ransomware-to-its-members/
author: frack113
date: 2022-12-11
modified: 2023-02-14
tags:
    - attack.execution
    - attack.defense-impairment
    - attack.t1047
    - attack.t1685
logsource:
    product: windows
    category: process_creation
detection:
    selection_img:
        - OriginalFileName: 'wmic.exe'
        - Image|endswith: '\WMIC.exe'
    selection_cli:
        CommandLine|contains: '/Namespace:\\\\root\\Microsoft\\Windows\\Defender'
    condition: all of selection_*
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
Potential Winnti Dropper Activity
Detects files dropped by Winnti as described in RedMimicry Winnti playbook
status test author Alexander Rausch id 130c9e58-28ac-4f83-8574-0a4cc913b97e
panther query
def rule(event):
    if any(
        [
            event.deep_get("TargetFilename", default="").endswith("\\gthread-3.6.dll"),
            event.deep_get("TargetFilename", default="").endswith("\\sigcmm-2.4.dll"),
            event.deep_get("TargetFilename", default="").endswith("\\Windows\\Temp\\tmp.bat"),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potential Winnti Dropper Activity
id: 130c9e58-28ac-4f83-8574-0a4cc913b97e
status: test
description: Detects files dropped by Winnti as described in RedMimicry Winnti playbook
references:
    - https://redmimicry.com/posts/redmimicry-winnti/#dropper
author: Alexander Rausch
date: 2020-06-24
modified: 2023-01-05
tags:
    - attack.stealth
    - attack.t1027
logsource:
    product: windows
    category: file_event
detection:
    selection:
        TargetFilename|endswith:
            - '\gthread-3.6.dll'
            - '\sigcmm-2.4.dll'
            - '\Windows\Temp\tmp.bat'
    condition: selection
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
Potential WizardUpdate Malware Infection
Detects the execution traces of the WizardUpdate malware. WizardUpdate is a macOS trojan that attempts to infiltrate macOS machines to steal data and it is associated with other types of malicious payloads, increasing the chances of multiple infections on a device.
status test author Tim Rauch (rule), Elastic (idea) id f68c4a4f-19ef-4817-952c-50dce331f4b0
panther query
def rule(event):
    if any(
        [
            all(
                [
                    event.deep_get("Image", default="").endswith("/sh"),
                    "=$(curl " in event.deep_get("CommandLine", default=""),
                    "eval" in event.deep_get("CommandLine", default=""),
                ]
            ),
            all(
                [
                    event.deep_get("Image", default="").endswith("/curl"),
                    "_intermediate_agent_" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potential WizardUpdate Malware Infection
id: f68c4a4f-19ef-4817-952c-50dce331f4b0
status: test
description: Detects the execution traces of the WizardUpdate malware. WizardUpdate is a macOS trojan that attempts to infiltrate macOS machines to steal data and it is associated with other types of malicious payloads, increasing the chances of multiple infections on a device.
references:
    - https://github.com/elastic/protections-artifacts/commit/746086721fd385d9f5c6647cada1788db4aea95f#diff-c68a1fcbf7a3f80c87225d7fdc031f691e9f3b6a14a36754be00762bfe6eae97
    - https://malpedia.caad.fkie.fraunhofer.de/details/osx.xcsset
    - https://www.microsoft.com/security/blog/2022/02/02/the-evolution-of-a-mac-trojan-updateagents-progression/
author: Tim Rauch (rule), Elastic (idea)
date: 2022-10-17
tags:
    - attack.command-and-control
logsource:
    category: process_creation
    product: macos
detection:
    selection_1:
        Image|endswith: '/sh'
        CommandLine|contains|all:
            - '=$(curl '
            - 'eval'
    selection_2:
        Image|endswith: '/curl'
        CommandLine|contains: '_intermediate_agent_'
    condition: 1 of selection_*
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
Potential XXE Exploitation Attempt In JVM Based Application
Detects XML parsing issues, if the application expects to work with XML make sure that the parser is initialized safely.
status test author Moti Harmats id c4e06896-e27c-4583-95ac-91ce2279345d
panther query
import json


def rule(event):
    if any(
        [
            "SAXParseException" in json.dumps(event.to_dict()),
            "DOMException" in json.dumps(event.to_dict()),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potential XXE Exploitation Attempt In JVM Based Application
id: c4e06896-e27c-4583-95ac-91ce2279345d
status: test
description: Detects XML parsing issues, if the application expects to work with XML make sure that the parser is initialized safely.
references:
    - https://rules.sonarsource.com/java/RSPEC-2755
    - https://owasp.org/www-community/vulnerabilities/XML_External_Entity_(XXE)_Processing
    - https://www.wix.engineering/post/threat-and-vulnerability-hunting-with-application-server-error-logs
author: Moti Harmats
date: 2023-02-11
tags:
    - attack.initial-access
    - attack.t1190
logsource:
    category: application
    product: jvm
    definition: 'Requirements: application error logs must be collected (with LOG_LEVEL=ERROR and above)'
detection:
    keywords:
        - 'SAXParseException'
        - 'DOMException'
    condition: keywords
falsepositives:
    - If the application expects to work with XML there may be parsing issues that don't necessarily mean XXE.
level: high
Convert to SIEM query
high
Potential Zerologon (CVE-2020-1472) Exploitation
Detects potential Netlogon Elevation of Privilege Vulnerability aka Zerologon (CVE-2020-1472)
status test author Aleksandr Akhremchik, @aleqs4ndr, ocsd.community id dd7876d8-0f09-11eb-adc1-0242ac120002
panther query
def rule(event):
    if all(
        [
            event.deep_get("EventID", default="") == 4742,
            event.deep_get("SubjectUserName", default="") == "ANONYMOUS LOGON",
            event.deep_get("TargetUserName", default="") == "%DC-MACHINE-NAME%",
            not event.deep_get("PasswordLastSet", default="") == "-",
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potential Zerologon (CVE-2020-1472) Exploitation
id: dd7876d8-0f09-11eb-adc1-0242ac120002
status: test
description: Detects potential Netlogon Elevation of Privilege Vulnerability aka Zerologon (CVE-2020-1472)
references:
    - https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2020-1472
    - https://www.logpoint.com/en/blog/detecting-zerologon-vulnerability-in-logpoint/
author: Aleksandr Akhremchik, @aleqs4ndr, ocsd.community
date: 2020-10-15
modified: 2023-12-15
tags:
    - attack.privilege-escalation
    - attack.t1068
    - cve.2020-1472
logsource:
    product: windows
    service: security
detection:
    selection:
        EventID: 4742
        SubjectUserName: 'ANONYMOUS LOGON'
        TargetUserName|expand: '%DC-MACHINE-NAME%' # DC machine account name that ends with '$'
    filter_main:
        PasswordLastSet: '-'
    condition: selection and not filter_main
falsepositives:
    - Automatic DC computer account password change
    - Legitimate DC computer account password change
level: high
Convert to SIEM query
high
Potential appverifUI.DLL Sideloading
Detects potential DLL sideloading of "appverifUI.dll"
status test author X__Junior (Nextron Systems) id ee6cea48-c5b6-4304-a332-10fc6446f484
panther query
def rule(event):
    if all(
        [
            event.deep_get("ImageLoaded", default="").endswith("\\appverifUI.dll"),
            not all(
                [
                    event.deep_get("Image", default="")
                    in [
                        "C:\\Windows\\SysWOW64\\appverif.exe",
                        "C:\\Windows\\System32\\appverif.exe",
                    ],
                    any(
                        [
                            event.deep_get("ImageLoaded", default="").startswith(
                                "C:\\Windows\\System32\\"
                            ),
                            event.deep_get("ImageLoaded", default="").startswith(
                                "C:\\Windows\\SysWOW64\\"
                            ),
                            event.deep_get("ImageLoaded", default="").startswith(
                                "C:\\Windows\\WinSxS\\"
                            ),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potential appverifUI.DLL Sideloading
id: ee6cea48-c5b6-4304-a332-10fc6446f484
status: test
description: Detects potential DLL sideloading of "appverifUI.dll"
references:
    - https://web.archive.org/web/20220519091349/https://fatrodzianko.com/2020/02/15/dll-side-loading-appverif-exe/
author: X__Junior (Nextron Systems)
date: 2023-06-20
tags:
    - attack.persistence
    - attack.privilege-escalation
    - attack.execution
    - attack.stealth
    - attack.t1574.001
logsource:
    category: image_load
    product: windows
detection:
    selection:
        ImageLoaded|endswith: '\appverifUI.dll'
    filter_main_legit_path:
        Image:
            - 'C:\Windows\SysWOW64\appverif.exe'
            - 'C:\Windows\System32\appverif.exe'
        ImageLoaded|startswith:
            - 'C:\Windows\System32\'
            - 'C:\Windows\SysWOW64\'
            - 'C:\Windows\WinSxS\'
    condition: selection and not 1 of filter_main_*
falsepositives:
    - Unlikely
level: high
Convert to SIEM query
high
Potentially Suspicious ASP.NET Compilation Via AspNetCompiler
Detects execution of "aspnet_compiler.exe" with potentially suspicious paths for compilation.
status test author Nasreddine Bencherchali (Nextron Systems) id 9f50fe98-fe5c-4a2d-86c7-fad7f63ed622
panther query
def rule(event):
    if all(
        [
            any(
                [
                    ":\\Windows\\Microsoft.NET\\Framework\\" in event.deep_get("Image", default=""),
                    ":\\Windows\\Microsoft.NET\\Framework64\\"
                    in event.deep_get("Image", default=""),
                    ":\\Windows\\Microsoft.NET\\FrameworkArm\\"
                    in event.deep_get("Image", default=""),
                    ":\\Windows\\Microsoft.NET\\FrameworkArm64\\"
                    in event.deep_get("Image", default=""),
                ]
            ),
            event.deep_get("Image", default="").endswith("\\aspnet_compiler.exe"),
            any(
                [
                    "\\Users\\Public\\" in event.deep_get("CommandLine", default=""),
                    "\\AppData\\Local\\Temp\\" in event.deep_get("CommandLine", default=""),
                    "\\AppData\\Local\\Roaming\\" in event.deep_get("CommandLine", default=""),
                    ":\\Temp\\" in event.deep_get("CommandLine", default=""),
                    ":\\Windows\\Temp\\" in event.deep_get("CommandLine", default=""),
                    ":\\Windows\\System32\\Tasks\\" in event.deep_get("CommandLine", default=""),
                    ":\\Windows\\Tasks\\" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potentially Suspicious ASP.NET Compilation Via AspNetCompiler
id: 9f50fe98-fe5c-4a2d-86c7-fad7f63ed622 # Susp Paths
related:
    - id: 9ccba514-7cb6-4c5c-b377-700758f2f120 # SuspChild
      type: similar
    - id: 4c7f49ee-2638-43bb-b85b-ce676c30b260 # TMP File
      type: similar
    - id: a01b8329-5953-4f73-ae2d-aa01e1f35f00 # Exec
      type: similar
status: test
description: Detects execution of "aspnet_compiler.exe" with potentially suspicious paths for compilation.
references:
    - https://lolbas-project.github.io/lolbas/Binaries/Aspnet_Compiler/
    - https://ijustwannared.team/2020/08/01/the-curious-case-of-aspnet_compiler-exe/
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-08-14
modified: 2025-02-24
tags:
    - attack.execution
    - attack.stealth
    - attack.t1127
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        Image|contains:
            - ':\Windows\Microsoft.NET\Framework\'
            - ':\Windows\Microsoft.NET\Framework64\'
            - ':\Windows\Microsoft.NET\FrameworkArm\'
            - ':\Windows\Microsoft.NET\FrameworkArm64\'
        Image|endswith: '\aspnet_compiler.exe'
        CommandLine|contains:
            # Note: add other potential suspicious paths
            - '\Users\Public\'
            - '\AppData\Local\Temp\'
            - '\AppData\Local\Roaming\'
            - ':\Temp\'
            - ':\Windows\Temp\'
            - ':\Windows\System32\Tasks\'
            - ':\Windows\Tasks\'
    condition: selection
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
Potentially Suspicious Call To Win32_NTEventlogFile Class
Detects usage of the WMI class "Win32_NTEventlogFile" in a potentially suspicious way (delete, backup, change permissions, etc.) from a PowerShell script
status test author Nasreddine Bencherchali (Nextron Systems) id caf201a9-c2ce-4a26-9c3a-2b9525413711
panther query
def rule(event):
    if all(
        [
            "Win32_NTEventlogFile" in event.deep_get("CommandLine", default=""),
            any(
                [
                    ".BackupEventlog(" in event.deep_get("CommandLine", default=""),
                    ".ChangeSecurityPermissions(" in event.deep_get("CommandLine", default=""),
                    ".ChangeSecurityPermissionsEx(" in event.deep_get("CommandLine", default=""),
                    ".ClearEventLog(" in event.deep_get("CommandLine", default=""),
                    ".Delete(" in event.deep_get("CommandLine", default=""),
                    ".DeleteEx(" in event.deep_get("CommandLine", default=""),
                    ".Rename(" in event.deep_get("CommandLine", default=""),
                    ".TakeOwnerShip(" in event.deep_get("CommandLine", default=""),
                    ".TakeOwnerShipEx(" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potentially Suspicious Call To Win32_NTEventlogFile Class
id: caf201a9-c2ce-4a26-9c3a-2b9525413711
related:
    - id: e2812b49-bae0-4b21-b366-7c142eafcde2
      type: similar
status: test
description: Detects usage of the WMI class "Win32_NTEventlogFile" in a potentially suspicious way (delete, backup, change permissions, etc.) from a PowerShell script
references:
    - https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/aa394225(v=vs.85)
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-07-13
tags:
    - attack.defense-impairment
logsource:
    category: process_creation
    product: windows
detection:
    selection_class:
        CommandLine|contains: 'Win32_NTEventlogFile'
    selection_function:
        CommandLine|contains:
            - '.BackupEventlog('
            - '.ChangeSecurityPermissions('
            - '.ChangeSecurityPermissionsEx('
            - '.ClearEventLog('
            - '.Delete('
            - '.DeleteEx('
            - '.Rename('
            - '.TakeOwnerShip('
            - '.TakeOwnerShipEx('
    condition: all of selection_*
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
Potentially Suspicious Child Process Of Regsvr32
Detects potentially suspicious child processes of "regsvr32.exe".
status test author elhoim, Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems) id 6f0947a4-1c5e-4e0d-8ac7-53159b8f23ca
panther query
def rule(event):
    if all(
        [
            event.deep_get("ParentImage", default="").endswith("\\regsvr32.exe"),
            any(
                [
                    event.deep_get("Image", default="").endswith("\\calc.exe"),
                    event.deep_get("Image", default="").endswith("\\cscript.exe"),
                    event.deep_get("Image", default="").endswith("\\explorer.exe"),
                    event.deep_get("Image", default="").endswith("\\mshta.exe"),
                    event.deep_get("Image", default="").endswith("\\net.exe"),
                    event.deep_get("Image", default="").endswith("\\net1.exe"),
                    event.deep_get("Image", default="").endswith("\\nltest.exe"),
                    event.deep_get("Image", default="").endswith("\\notepad.exe"),
                    event.deep_get("Image", default="").endswith("\\powershell.exe"),
                    event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                    event.deep_get("Image", default="").endswith("\\reg.exe"),
                    event.deep_get("Image", default="").endswith("\\schtasks.exe"),
                    event.deep_get("Image", default="").endswith("\\werfault.exe"),
                    event.deep_get("Image", default="").endswith("\\wscript.exe"),
                ]
            ),
            not all(
                [
                    event.deep_get("Image", default="").endswith("\\werfault.exe"),
                    " -u -p " in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potentially Suspicious Child Process Of Regsvr32
id: 6f0947a4-1c5e-4e0d-8ac7-53159b8f23ca
related:
    - id: 8e2b24c9-4add-46a0-b4bb-0057b4e6187d
      type: obsolete
status: test
description: Detects potentially suspicious child processes of "regsvr32.exe".
references:
    - https://redcanary.com/blog/intelligence-insights-april-2022/
    - https://www.echotrail.io/insights/search/regsvr32.exe
    - https://www.ired.team/offensive-security/code-execution/t1117-regsvr32-aka-squiblydoo
author: elhoim, Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
date: 2022-05-05
modified: 2023-05-26
tags:
    - attack.stealth
    - attack.t1218.010
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        ParentImage|endswith: '\regsvr32.exe'
        Image|endswith:
            - '\calc.exe'
            - '\cscript.exe'
            - '\explorer.exe'
            - '\mshta.exe'
            - '\net.exe'
            - '\net1.exe'
            - '\nltest.exe'
            - '\notepad.exe'
            - '\powershell.exe'
            - '\pwsh.exe'
            - '\reg.exe'
            - '\schtasks.exe'
            - '\werfault.exe'
            - '\wscript.exe'
    filter_main_werfault:
        Image|endswith: '\werfault.exe'
        CommandLine|contains: ' -u -p '
    condition: selection and not 1 of filter_main_*
falsepositives:
    - Unlikely, but can rarely occur. Apply additional filters accordingly.
level: high
Convert to SIEM query
high
Potentially Suspicious Child Processes Spawned by ConHost
Detects suspicious child processes related to Windows Shell utilities spawned by `conhost.exe`, which could indicate malicious activity using trusted system components.
status experimental author Swachchhanda Shrawan Poudel (Nextron Systems) id dfa03a09-8b92-4d83-8e74-f72839b1c407
panther query
def rule(event):
    if all(
        [
            event.deep_get("ParentImage", default="").endswith("\\conhost.exe"),
            any(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\cmd.exe"),
                            event.deep_get("Image", default="").endswith("\\cscript.exe"),
                            event.deep_get("Image", default="").endswith("\\mshta.exe"),
                            event.deep_get("Image", default="").endswith("\\powershell_ise.exe"),
                            event.deep_get("Image", default="").endswith("\\powershell.exe"),
                            event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                            event.deep_get("Image", default="").endswith("\\regsvr32.exe"),
                            event.deep_get("Image", default="").endswith("\\wscript.exe"),
                        ]
                    ),
                    event.deep_get("OriginalFileName", default="")
                    in [
                        "cmd.exe",
                        "cscript.exe",
                        "mshta.exe",
                        "powershell_ise.exe",
                        "powershell.exe",
                        "pwsh.dll",
                        "regsvr32.exe",
                        "wscript.exe",
                    ],
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potentially Suspicious Child Processes Spawned by ConHost
id: dfa03a09-8b92-4d83-8e74-f72839b1c407
related:
    - id: 7dc2dedd-7603-461a-bc13-15803d132355
      type: similar
status: experimental
description: Detects suspicious child processes related to Windows Shell utilities spawned by `conhost.exe`, which could indicate malicious activity using trusted system components.
references:
    - https://tria.ge/241015-l98snsyeje/behavioral2
author: Swachchhanda Shrawan Poudel (Nextron Systems)
date: 2025-02-05
tags:
    - attack.stealth
    - attack.t1202
    - attack.t1218
logsource:
    category: process_creation
    product: windows
detection:
    selection_parent:
        ParentImage|endswith: '\conhost.exe'
    selection_child:
        - Image|endswith:
              - '\cmd.exe'             # Windows Command Prompt
              - '\cscript.exe'         # Windows Script Host (used for scripting exploits)
              - '\mshta.exe'           # MSHTA (HTML Application Host, often abused)
              - '\powershell_ise.exe'  # PowerShell ISE
              - '\powershell.exe'      # Windows PowerShell
              - '\pwsh.exe'            # PowerShell Core
              - '\regsvr32.exe'        # Windows Registry Server (commonly used for exploits)
              - '\wscript.exe'         # Windows Script Host (for executing scripts)
        - OriginalFileName:
              - 'cmd.exe'
              - 'cscript.exe'
              - 'mshta.exe'
              - 'powershell_ise.exe'
              - 'powershell.exe'
              - 'pwsh.dll'
              - 'regsvr32.exe'
              - 'wscript.exe'
    condition: all of selection_*
falsepositives:
    - Legitimate administrative tasks using `conhost.exe` to spawn child processes such as `cmd.exe`, `powershell.exe`, or `regsvr32.exe`.
level: high
Convert to SIEM query
high
Potentially Suspicious Command Executed Via Run Dialog Box - Registry
Detects execution of commands via the run dialog box on Windows by checking values of the "RunMRU" registry key. This technique was seen being abused by threat actors to deceive users into pasting and executing malicious commands, often disguised as CAPTCHA verification steps.
status test author Ahmed Farouk, Nasreddine Bencherchali id a7df0e9e-91a5-459a-a003-4cde67c2ff5d
panther query
def rule(event):
    if all(
        [
            "\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RunMRU"
            in event.deep_get("TargetObject", default=""),
            any(
                [
                    all(
                        [
                            any(
                                [
                                    "powershell" in event.deep_get("Details", default=""),
                                    "pwsh" in event.deep_get("Details", default=""),
                                ]
                            ),
                            any(
                                [
                                    " -e " in event.deep_get("Details", default=""),
                                    " -ec " in event.deep_get("Details", default=""),
                                    " -en " in event.deep_get("Details", default=""),
                                    " -enc " in event.deep_get("Details", default=""),
                                    " -enco" in event.deep_get("Details", default=""),
                                    "ftp" in event.deep_get("Details", default=""),
                                    "Hidden" in event.deep_get("Details", default=""),
                                    "http" in event.deep_get("Details", default=""),
                                    "iex" in event.deep_get("Details", default=""),
                                    "Invoke-" in event.deep_get("Details", default=""),
                                ]
                            ),
                        ]
                    ),
                    all(
                        [
                            "wmic" in event.deep_get("Details", default=""),
                            any(
                                [
                                    "shadowcopy" in event.deep_get("Details", default=""),
                                    "process call create" in event.deep_get("Details", default=""),
                                ]
                            ),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potentially Suspicious Command Executed Via Run Dialog Box - Registry
id: a7df0e9e-91a5-459a-a003-4cde67c2ff5d
related:
    - id: f9d091f6-f1c7-4873-a24f-050b4a02b4dd
      type: derived
status: test
description: |
    Detects execution of commands via the run dialog box on Windows by checking values of the "RunMRU" registry key.
    This technique was seen being abused by threat actors to deceive users into pasting and executing malicious commands, often disguised as CAPTCHA verification steps.
references:
    - https://medium.com/@ahmed.moh.farou2/fake-captcha-campaign-on-arabic-pirated-movie-sites-delivers-lumma-stealer-4f203f7adabf
    - https://medium.com/@shaherzakaria8/downloading-trojan-lumma-infostealer-through-capatcha-1f25255a0e71
    - https://www.forensafe.com/blogs/runmrukey.html
    - https://redcanary.com/blog/threat-intelligence/intelligence-insights-october-2024/
author: Ahmed Farouk, Nasreddine Bencherchali
date: 2024-11-01
tags:
    - attack.execution
    - attack.t1059.001
logsource:
    product: windows
    category: registry_set
detection:
    selection_key:
        TargetObject|contains: '\Microsoft\Windows\CurrentVersion\Explorer\RunMRU'
    selection_powershell_command:
        Details|contains:
            - 'powershell'
            - 'pwsh'
    selection_powershell_susp_keywords:
        Details|contains:
            - ' -e '
            - ' -ec '
            - ' -en '
            - ' -enc '
            - ' -enco'
            - 'ftp'
            - 'Hidden'
            - 'http'
            - 'iex'
            - 'Invoke-'
    selection_wmic_command:
        Details|contains: 'wmic'
    selection_wmic_susp_keywords:
        Details|contains:
            - 'shadowcopy'
            - 'process call create'
    condition: selection_key and (all of selection_powershell_* or all of selection_wmic_*)
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
Potentially Suspicious DLL Registered Via Odbcconf.EXE
Detects execution of "odbcconf" with the "REGSVR" action where the DLL in question doesn't contain a ".dll" extension. Which is often used as a method to evade defenses.
status test author Nasreddine Bencherchali (Nextron Systems) id ba4cfc11-d0fa-4d94-bf20-7c332c412e76
panther query
def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\odbcconf.exe"),
                    event.deep_get("OriginalFileName", default="") == "odbcconf.exe",
                ]
            ),
            "REGSVR " in event.deep_get("CommandLine", default=""),
            not ".dll" in event.deep_get("CommandLine", default=""),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potentially Suspicious DLL Registered Via Odbcconf.EXE
id: ba4cfc11-d0fa-4d94-bf20-7c332c412e76
related:
    - id: 9f0a8bf3-a65b-440a-8c1e-5cb1547c8e70
      type: derived
status: test
description: Detects execution of "odbcconf" with the "REGSVR" action where the DLL in question doesn't contain a ".dll" extension. Which is often used as a method to evade defenses.
references:
    - https://learn.microsoft.com/en-us/sql/odbc/odbcconf-exe?view=sql-server-ver16
    - https://lolbas-project.github.io/lolbas/Binaries/Odbcconf/
    - https://www.trendmicro.com/en_us/research/17/h/backdoor-carrying-emails-set-sights-on-russian-speaking-businesses.html
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-05-22
tags:
    - attack.stealth
    - attack.t1218.008
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\odbcconf.exe'
        - OriginalFileName: 'odbcconf.exe'
    selection_cli:
        # Note: The "/A" flag is not required to call a specific action
        CommandLine|contains: 'REGSVR '
    filter_main_dll_ext:
        CommandLine|contains: '.dll'
    condition: all of selection_* and not 1 of filter_main_*
falsepositives:
    - Unlikely
level: high
Convert to SIEM query
high
Potentially Suspicious Event Viewer Child Process
Detects uncommon or suspicious child processes of "eventvwr.exe" which might indicate a UAC bypass attempt
status test author Florian Roth (Nextron Systems) id be344333-921d-4c4d-8bb8-e584cf584780
panther query
def rule(event):
    if all(
        [
            event.deep_get("ParentImage", default="").endswith("\\eventvwr.exe"),
            not any(
                [
                    event.deep_get("Image", default="").endswith(":\\Windows\\System32\\mmc.exe"),
                    event.deep_get("Image", default="").endswith(
                        ":\\Windows\\System32\\WerFault.exe"
                    ),
                    event.deep_get("Image", default="").endswith(
                        ":\\Windows\\SysWOW64\\WerFault.exe"
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potentially Suspicious Event Viewer Child Process
id: be344333-921d-4c4d-8bb8-e584cf584780
related:
    - id: 7c81fec3-1c1d-43b0-996a-46753041b1b6
      type: derived
status: test
description: Detects uncommon or suspicious child processes of "eventvwr.exe" which might indicate a UAC bypass attempt
references:
    - https://enigma0x3.net/2016/08/15/fileless-uac-bypass-using-eventvwr-exe-and-registry-hijacking/
    - https://www.hybrid-analysis.com/sample/e122bc8bf291f15cab182a5d2d27b8db1e7019e4e96bb5cdbd1dfe7446f3f51f?environmentId=100
author: Florian Roth (Nextron Systems)
date: 2017-03-19
modified: 2023-09-28
tags:
    - attack.privilege-escalation
    - attack.t1548.002
    - car.2019-04-001
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        ParentImage|endswith: '\eventvwr.exe'
    filter_main_generic:
        Image|endswith:
            - ':\Windows\System32\mmc.exe'
            - ':\Windows\System32\WerFault.exe'
            - ':\Windows\SysWOW64\WerFault.exe'
    condition: selection and not 1 of filter_main_*
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
Potentially Suspicious Execution From Parent Process In Public Folder
Detects a potentially suspicious execution of a parent process located in the "\Users\Public" folder executing a child process containing references to shell or scripting binaries and commandlines.
status test author Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems) id 69bd9b97-2be2-41b6-9816-fb08757a4d1a
panther query
def rule(event):
    if all(
        [
            ":\\Users\\Public\\" in event.deep_get("ParentImage", default=""),
            any(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\bitsadmin.exe"),
                            event.deep_get("Image", default="").endswith("\\certutil.exe"),
                            event.deep_get("Image", default="").endswith("\\cmd.exe"),
                            event.deep_get("Image", default="").endswith("\\cscript.exe"),
                            event.deep_get("Image", default="").endswith("\\mshta.exe"),
                            event.deep_get("Image", default="").endswith("\\powershell.exe"),
                            event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                            event.deep_get("Image", default="").endswith("\\regsvr32.exe"),
                            event.deep_get("Image", default="").endswith("\\rundll32.exe"),
                            event.deep_get("Image", default="").endswith("\\wscript.exe"),
                        ]
                    ),
                    any(
                        [
                            "bitsadmin" in event.deep_get("CommandLine", default=""),
                            "certutil" in event.deep_get("CommandLine", default=""),
                            "cscript" in event.deep_get("CommandLine", default=""),
                            "mshta" in event.deep_get("CommandLine", default=""),
                            "powershell" in event.deep_get("CommandLine", default=""),
                            "regsvr32" in event.deep_get("CommandLine", default=""),
                            "rundll32" in event.deep_get("CommandLine", default=""),
                            "wscript" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potentially Suspicious Execution From Parent Process In Public Folder
id: 69bd9b97-2be2-41b6-9816-fb08757a4d1a
status: test
description: |
    Detects a potentially suspicious execution of a parent process located in the "\Users\Public" folder executing a child process containing references to shell or scripting binaries and commandlines.
references:
    - https://redcanary.com/blog/blackbyte-ransomware/
author: Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
date: 2022-02-25
modified: 2024-07-12
tags:
    - attack.execution
    - attack.stealth
    - attack.t1564
    - attack.t1059
logsource:
    category: process_creation
    product: windows
detection:
    selection_parent:
        ParentImage|contains: ':\Users\Public\'
    selection_child:
        - Image|endswith:
              - '\bitsadmin.exe'
              - '\certutil.exe'
              - '\cmd.exe'
              - '\cscript.exe'
              - '\mshta.exe'
              - '\powershell.exe'
              - '\pwsh.exe'
              - '\regsvr32.exe'
              - '\rundll32.exe'
              - '\wscript.exe'
        - CommandLine|contains:
              - 'bitsadmin'
              - 'certutil'
              - 'cscript'
              - 'mshta'
              - 'powershell'
              - 'regsvr32'
              - 'rundll32'
              - 'wscript'
    condition: all of selection_*
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
Potentially Suspicious File Download From File Sharing Domain Via PowerShell.EXE
Detects potentially suspicious file downloads from file sharing domains using PowerShell.exe
status test author Nasreddine Bencherchali (Nextron Systems) id b6e04788-29e1-4557-bb14-77f761848ab8
panther query
def rule(event):
    if all(
        [
            any(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\powershell.exe"),
                            event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                        ]
                    ),
                    event.deep_get("OriginalFileName", default="")
                    in ["PowerShell.EXE", "pwsh.dll"],
                ]
            ),
            any(
                [
                    "anonfiles.com" in event.deep_get("CommandLine", default=""),
                    "cdn.discordapp.com" in event.deep_get("CommandLine", default=""),
                    "ddns.net" in event.deep_get("CommandLine", default=""),
                    "dl.dropboxusercontent.com" in event.deep_get("CommandLine", default=""),
                    "ghostbin.co" in event.deep_get("CommandLine", default=""),
                    "glitch.me" in event.deep_get("CommandLine", default=""),
                    "gofile.io" in event.deep_get("CommandLine", default=""),
                    "hastebin.com" in event.deep_get("CommandLine", default=""),
                    "mediafire.com" in event.deep_get("CommandLine", default=""),
                    "mega.nz" in event.deep_get("CommandLine", default=""),
                    "onrender.com" in event.deep_get("CommandLine", default=""),
                    "pages.dev" in event.deep_get("CommandLine", default=""),
                    "paste.ee" in event.deep_get("CommandLine", default=""),
                    "pastebin.com" in event.deep_get("CommandLine", default=""),
                    "pastebin.pl" in event.deep_get("CommandLine", default=""),
                    "pastetext.net" in event.deep_get("CommandLine", default=""),
                    "pixeldrain.com" in event.deep_get("CommandLine", default=""),
                    "privatlab.com" in event.deep_get("CommandLine", default=""),
                    "privatlab.net" in event.deep_get("CommandLine", default=""),
                    "send.exploit.in" in event.deep_get("CommandLine", default=""),
                    "sendspace.com" in event.deep_get("CommandLine", default=""),
                    "storage.googleapis.com" in event.deep_get("CommandLine", default=""),
                    "storjshare.io" in event.deep_get("CommandLine", default=""),
                    "supabase.co" in event.deep_get("CommandLine", default=""),
                    "temp.sh" in event.deep_get("CommandLine", default=""),
                    "transfer.sh" in event.deep_get("CommandLine", default=""),
                    "trycloudflare.com" in event.deep_get("CommandLine", default=""),
                    "ufile.io" in event.deep_get("CommandLine", default=""),
                    "w3spaces.com" in event.deep_get("CommandLine", default=""),
                    "workers.dev" in event.deep_get("CommandLine", default=""),
                ]
            ),
            any(
                [
                    ".DownloadString(" in event.deep_get("CommandLine", default=""),
                    ".DownloadFile(" in event.deep_get("CommandLine", default=""),
                    "Invoke-WebRequest " in event.deep_get("CommandLine", default=""),
                    "iwr " in event.deep_get("CommandLine", default=""),
                    "wget " in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potentially Suspicious File Download From File Sharing Domain Via PowerShell.EXE
id: b6e04788-29e1-4557-bb14-77f761848ab8
status: test
description: Detects potentially suspicious file downloads from file sharing domains using PowerShell.exe
references:
    - https://labs.withsecure.com/publications/fin7-target-veeam-servers
    - https://github.com/WithSecureLabs/iocs/blob/344203de742bb7e68bd56618f66d34be95a9f9fc/FIN7VEEAM/iocs.csv
    - https://www.microsoft.com/en-us/security/blog/2024/01/17/new-ttps-observed-in-mint-sandstorm-campaign-targeting-high-profile-individuals-at-universities-and-research-orgs/
    - https://www.huntress.com/blog/slashandgrab-screen-connect-post-exploitation-in-the-wild-cve-2024-1709-cve-2024-1708
author: Nasreddine Bencherchali (Nextron Systems)
date: 2024-02-23
modified: 2024-12-10
tags:
    - attack.execution
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith:
              - '\powershell.exe'
              - '\pwsh.exe'
        - OriginalFileName:
              - 'PowerShell.EXE'
              - 'pwsh.dll'
    selection_websites:
        CommandLine|contains:
            # Note: You might want to baseline the github domain before including it
            # - '.githubusercontent.com'       # Includes both gists and github repositories / Michael Haag (idea).
            - 'anonfiles.com'
            - 'cdn.discordapp.com'
            - 'ddns.net'
            - 'dl.dropboxusercontent.com'
            - 'ghostbin.co'
            # - 'github.com'  See note above
            - 'glitch.me'
            - 'gofile.io'
            - 'hastebin.com'
            - 'mediafire.com'
            - 'mega.nz'
            - 'onrender.com'
            - 'pages.dev'
            - 'paste.ee'
            - 'pastebin.com'
            - 'pastebin.pl'
            - 'pastetext.net'
            - 'pixeldrain.com'
            - 'privatlab.com'
            - 'privatlab.net'
            - 'send.exploit.in'
            - 'sendspace.com'
            - 'storage.googleapis.com'
            - 'storjshare.io'
            - 'supabase.co'
            - 'temp.sh'
            - 'transfer.sh'
            - 'trycloudflare.com'
            - 'ufile.io'
            - 'w3spaces.com'
            - 'workers.dev'
    selection_download:
        CommandLine|contains:
            - '.DownloadString('
            - '.DownloadFile('
            - 'Invoke-WebRequest '
            - 'iwr '
            - 'wget '
    condition: all of selection_*
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
Potentially Suspicious File Download From ZIP TLD
Detects the download of a file with a potentially suspicious extension from a .zip top level domain.
status test author Florian Roth (Nextron Systems) id 0bb4bbeb-fe52-4044-b40c-430a04577ebe
panther query
def rule(event):
    if all(
        [
            ".zip/" in event.deep_get("Contents", default=""),
            any(
                [
                    ".bat:Zone" in event.deep_get("TargetFilename", default=""),
                    ".dat:Zone" in event.deep_get("TargetFilename", default=""),
                    ".dll:Zone" in event.deep_get("TargetFilename", default=""),
                    ".doc:Zone" in event.deep_get("TargetFilename", default=""),
                    ".docm:Zone" in event.deep_get("TargetFilename", default=""),
                    ".exe:Zone" in event.deep_get("TargetFilename", default=""),
                    ".hta:Zone" in event.deep_get("TargetFilename", default=""),
                    ".pptm:Zone" in event.deep_get("TargetFilename", default=""),
                    ".ps1:Zone" in event.deep_get("TargetFilename", default=""),
                    ".rar:Zone" in event.deep_get("TargetFilename", default=""),
                    ".rtf:Zone" in event.deep_get("TargetFilename", default=""),
                    ".sct:Zone" in event.deep_get("TargetFilename", default=""),
                    ".vbe:Zone" in event.deep_get("TargetFilename", default=""),
                    ".vbs:Zone" in event.deep_get("TargetFilename", default=""),
                    ".ws:Zone" in event.deep_get("TargetFilename", default=""),
                    ".wsf:Zone" in event.deep_get("TargetFilename", default=""),
                    ".xll:Zone" in event.deep_get("TargetFilename", default=""),
                    ".xls:Zone" in event.deep_get("TargetFilename", default=""),
                    ".xlsm:Zone" in event.deep_get("TargetFilename", default=""),
                    ".zip:Zone" in event.deep_get("TargetFilename", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potentially Suspicious File Download From ZIP TLD
id: 0bb4bbeb-fe52-4044-b40c-430a04577ebe
status: test
description: Detects the download of a file with a potentially suspicious extension from a .zip top level domain.
references:
    - https://twitter.com/cyb3rops/status/1659175181695287297
    - https://fabian-voith.de/2020/06/25/sysmon-v11-1-reads-alternate-data-streams/
author: Florian Roth (Nextron Systems)
date: 2023-05-18
tags:
    - attack.stealth
logsource:
    product: windows
    category: create_stream_hash
detection:
    selection:
        Contents|contains: '.zip/'
        TargetFilename|contains:
            - '.bat:Zone'
            - '.dat:Zone'
            - '.dll:Zone'
            - '.doc:Zone'
            - '.docm:Zone'
            - '.exe:Zone'
            - '.hta:Zone'
            - '.pptm:Zone'
            - '.ps1:Zone'
            - '.rar:Zone'
            - '.rtf:Zone'
            - '.sct:Zone'
            - '.vbe:Zone'
            - '.vbs:Zone'
            - '.ws:Zone'
            - '.wsf:Zone'
            - '.xll:Zone'
            - '.xls:Zone'
            - '.xlsm:Zone'
            - '.zip:Zone'
    condition: selection
falsepositives:
    - Legitimate file downloads from a websites and web services that uses the ".zip" top level domain.
level: high
Convert to SIEM query
high
Potentially Suspicious GoogleUpdate Child Process
Detects potentially suspicious child processes of "GoogleUpdate.exe"
status test author Nasreddine Bencherchali (Nextron Systems) id 84b1ecf9-6eff-4004-bafb-bae5c0e251b2
panther query
def rule(event):
    if all(
        [
            event.deep_get("ParentImage", default="").endswith("\\GoogleUpdate.exe"),
            not any(
                [
                    any(
                        [
                            "\\Google" in event.deep_get("Image", default=""),
                            any(
                                [
                                    event.deep_get("Image", default="").endswith("\\setup.exe"),
                                    event.deep_get("Image", default="").endswith(
                                        "chrome_updater.exe"
                                    ),
                                    event.deep_get("Image", default="").endswith(
                                        "chrome_installer.exe"
                                    ),
                                ]
                            ),
                        ]
                    ),
                    event.deep_get("Image", default="") == "",
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potentially Suspicious GoogleUpdate Child Process
id: 84b1ecf9-6eff-4004-bafb-bae5c0e251b2
related:
    - id: bdbab15a-3826-48fa-a1b7-723cd8f32fcc
      type: derived
status: test
description: Detects potentially suspicious child processes of "GoogleUpdate.exe"
references:
    - https://www.ncsc.gov.uk/static-assets/documents/malware-analysis-reports/goofy-guineapig/NCSC-MAR-Goofy-Guineapig.pdf
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-05-15
modified: 2023-05-22
tags:
    - attack.stealth
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        ParentImage|endswith: '\GoogleUpdate.exe'
    filter_main_known_legit:
        # Some other legit child process might exist. It's better to make a baseline before running this in production
        - Image|contains: '\Google' # Example: GoogleUpdate.exe, GoogleCrashHandler.exe, GoogleUpdateComRegisterShell64.exe
        - Image|endswith:
              - '\setup.exe'
              - 'chrome_updater.exe'
              - 'chrome_installer.exe'
    filter_main_image_null:
        Image: null
    condition: selection and not 1 of filter_main_*
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
Potentially Suspicious Malware Callback Communication
Detects programs that connect to known malware callback ports based on statistical analysis from two different sandbox system databases
status test author Florian Roth (Nextron Systems) id 4b89abaa-99fe-4232-afdd-8f9aa4d20382
panther query
import ipaddress


def rule(event):
    if all(
        [
            event.deep_get("Initiated", default="") == "true",
            event.deep_get("DestinationPort", default="")
            in [
                100,
                198,
                200,
                243,
                473,
                666,
                700,
                743,
                777,
                1443,
                1515,
                1777,
                1817,
                1904,
                1960,
                2443,
                2448,
                3360,
                3675,
                3939,
                4040,
                4433,
                4438,
                4443,
                4444,
                4455,
                5445,
                5552,
                5649,
                6625,
                7210,
                7777,
                8143,
                8843,
                9631,
                9943,
                10101,
                12102,
                12103,
                12322,
                13145,
                13394,
                13504,
                13505,
                13506,
                13507,
                14102,
                14103,
                14154,
                49180,
                65520,
                65535,
            ],
            not any(
                [
                    ipaddress.ip_address(event.deep_get("DestinationIp", default=""))
                    in ipaddress.ip_network("127.0.0.0/8"),
                    ipaddress.ip_address(event.deep_get("DestinationIp", default=""))
                    in ipaddress.ip_network("10.0.0.0/8"),
                    ipaddress.ip_address(event.deep_get("DestinationIp", default=""))
                    in ipaddress.ip_network("172.16.0.0/12"),
                    ipaddress.ip_address(event.deep_get("DestinationIp", default=""))
                    in ipaddress.ip_network("192.168.0.0/16"),
                    ipaddress.ip_address(event.deep_get("DestinationIp", default=""))
                    in ipaddress.ip_network("169.254.0.0/16"),
                    ipaddress.ip_address(event.deep_get("DestinationIp", default=""))
                    in ipaddress.ip_network("::1/128"),
                    ipaddress.ip_address(event.deep_get("DestinationIp", default=""))
                    in ipaddress.ip_network("fe80::/10"),
                    ipaddress.ip_address(event.deep_get("DestinationIp", default=""))
                    in ipaddress.ip_network("fc00::/7"),
                ]
            ),
            not any(
                [
                    event.deep_get("Image", default="").startswith("C:\\Program Files\\"),
                    event.deep_get("Image", default="").startswith("C:\\Program Files (x86)\\"),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potentially Suspicious Malware Callback Communication
id: 4b89abaa-99fe-4232-afdd-8f9aa4d20382
related:
    - id: 6d8c3d20-a5e1-494f-8412-4571d716cf5c
      type: similar
status: test
description: |
    Detects programs that connect to known malware callback ports based on statistical analysis from two different sandbox system databases
references:
    - https://docs.google.com/spreadsheets/d/17pSTDNpa0sf6pHeRhusvWG6rThciE8CsXTSlDUAZDyo
author: Florian Roth (Nextron Systems)
date: 2017-03-19
modified: 2024-03-12
tags:
    - attack.persistence
    - attack.command-and-control
    - attack.t1571
logsource:
    category: network_connection
    product: windows
detection:
    selection:
        Initiated: 'true'
        DestinationPort:
            - 100
            - 198
            - 200
            - 243
            - 473
            - 666
            - 700
            - 743
            - 777
            - 1443
            - 1515
            - 1777
            - 1817
            - 1904
            - 1960
            - 2443
            - 2448
            - 3360
            - 3675
            - 3939
            - 4040
            - 4433
            - 4438
            - 4443
            - 4444
            - 4455
            - 5445
            - 5552
            - 5649
            - 6625
            - 7210
            - 7777
            - 8143
            - 8843
            - 9631
            - 9943
            - 10101
            - 12102
            - 12103
            - 12322
            - 13145
            - 13394
            - 13504
            - 13505
            - 13506
            - 13507
            - 14102
            - 14103
            - 14154
            - 49180
            - 65520
            - 65535
    filter_main_local_ranges:
        DestinationIp|cidr:
            - '127.0.0.0/8'
            - '10.0.0.0/8'
            - '172.16.0.0/12'
            - '192.168.0.0/16'
            - '169.254.0.0/16'
            - '::1/128'  # IPv6 loopback
            - 'fe80::/10'  # IPv6 link-local addresses
            - 'fc00::/7'  # IPv6 private addresses
    filter_optional_sys_directories:
        Image|startswith:
            - 'C:\Program Files\'
            - 'C:\Program Files (x86)\'
    condition: selection and not 1 of filter_main_* and not 1 of filter_optional_*
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
Potentially Suspicious Malware Callback Communication - Linux
Detects programs that connect to known malware callback ports based on threat intelligence reports.
status test author hasselj id dbfc7c98-04ab-4ab7-aa94-c74d22aa7376
panther query
import ipaddress


def rule(event):
    if all(
        [
            event.deep_get("Initiated", default="") == "true",
            event.deep_get("DestinationPort", default="")
            in [888, 999, 2200, 2222, 4000, 4444, 6789, 8531, 50501, 51820],
            not any(
                [
                    ipaddress.ip_address(event.deep_get("DestinationIp", default=""))
                    in ipaddress.ip_network("127.0.0.0/8"),
                    ipaddress.ip_address(event.deep_get("DestinationIp", default=""))
                    in ipaddress.ip_network("10.0.0.0/8"),
                    ipaddress.ip_address(event.deep_get("DestinationIp", default=""))
                    in ipaddress.ip_network("172.16.0.0/12"),
                    ipaddress.ip_address(event.deep_get("DestinationIp", default=""))
                    in ipaddress.ip_network("192.168.0.0/16"),
                    ipaddress.ip_address(event.deep_get("DestinationIp", default=""))
                    in ipaddress.ip_network("169.254.0.0/16"),
                    ipaddress.ip_address(event.deep_get("DestinationIp", default=""))
                    in ipaddress.ip_network("::1/128"),
                    ipaddress.ip_address(event.deep_get("DestinationIp", default=""))
                    in ipaddress.ip_network("fe80::/10"),
                    ipaddress.ip_address(event.deep_get("DestinationIp", default=""))
                    in ipaddress.ip_network("fc00::/7"),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potentially Suspicious Malware Callback Communication - Linux
id: dbfc7c98-04ab-4ab7-aa94-c74d22aa7376
related:
    - id: 4b89abaa-99fe-4232-afdd-8f9aa4d20382
      type: derived
status: test
description: |
    Detects programs that connect to known malware callback ports based on threat intelligence reports.
references:
    - https://www.mandiant.com/resources/blog/triton-actor-ttp-profile-custom-attack-tools-detections
    - https://www.mandiant.com/resources/blog/ukraine-and-sandworm-team
    - https://www.elastic.co/guide/en/security/current/potential-non-standard-port-ssh-connection.html
    - https://thehackernews.com/2024/01/systembc-malwares-c2-server-analysis.html
    - https://www.cybereason.com/blog/sliver-c2-leveraged-by-many-threat-actors
author: hasselj
date: 2024-05-10
tags:
    - attack.persistence
    - attack.command-and-control
    - attack.t1571
logsource:
    category: network_connection
    product: linux
detection:
    selection:
        Initiated: 'true'
        DestinationPort:
            - 888
            - 999
            - 2200
            - 2222
            - 4000
            - 4444
            - 6789
            - 8531
            - 50501
            - 51820
    filter_main_local_ranges:
        DestinationIp|cidr:
            - '127.0.0.0/8'
            - '10.0.0.0/8'
            - '172.16.0.0/12'
            - '192.168.0.0/16'
            - '169.254.0.0/16'
            - '::1/128'         # IPv6 loopback
            - 'fe80::/10'       # IPv6 link-local addresses
            - 'fc00::/7'        # IPv6 private addresses
    condition: selection and not 1 of filter_main_*
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
Potentially Suspicious ODBC Driver Registered
Detects the registration of a new ODBC driver where the driver is located in a potentially suspicious location
status test author Nasreddine Bencherchali (Nextron Systems) id e4d22291-f3d5-4b78-9a0c-a1fbaf32a6a4
panther query
def rule(event):
    if all(
        [
            "\\SOFTWARE\\ODBC\\ODBCINST.INI\\" in event.deep_get("TargetObject", default=""),
            any(
                [
                    event.deep_get("TargetObject", default="").endswith("\\Driver"),
                    event.deep_get("TargetObject", default="").endswith("\\Setup"),
                ]
            ),
            any(
                [
                    ":\\PerfLogs\\" in event.deep_get("Details", default=""),
                    ":\\ProgramData\\" in event.deep_get("Details", default=""),
                    ":\\Temp\\" in event.deep_get("Details", default=""),
                    ":\\Users\\Public\\" in event.deep_get("Details", default=""),
                    ":\\Windows\\Registration\\CRMLog" in event.deep_get("Details", default=""),
                    ":\\Windows\\System32\\com\\dmp\\" in event.deep_get("Details", default=""),
                    ":\\Windows\\System32\\FxsTmp\\" in event.deep_get("Details", default=""),
                    ":\\Windows\\System32\\Microsoft\\Crypto\\RSA\\MachineKeys\\"
                    in event.deep_get("Details", default=""),
                    ":\\Windows\\System32\\spool\\drivers\\color\\"
                    in event.deep_get("Details", default=""),
                    ":\\Windows\\System32\\spool\\PRINTERS\\"
                    in event.deep_get("Details", default=""),
                    ":\\Windows\\System32\\spool\\SERVERS\\"
                    in event.deep_get("Details", default=""),
                    ":\\Windows\\System32\\Tasks_Migrated\\"
                    in event.deep_get("Details", default=""),
                    ":\\Windows\\System32\\Tasks\\Microsoft\\Windows\\SyncCenter\\"
                    in event.deep_get("Details", default=""),
                    ":\\Windows\\SysWOW64\\com\\dmp\\" in event.deep_get("Details", default=""),
                    ":\\Windows\\SysWOW64\\FxsTmp\\" in event.deep_get("Details", default=""),
                    ":\\Windows\\SysWOW64\\Tasks\\Microsoft\\Windows\\PLA\\System\\"
                    in event.deep_get("Details", default=""),
                    ":\\Windows\\SysWOW64\\Tasks\\Microsoft\\Windows\\SyncCenter\\"
                    in event.deep_get("Details", default=""),
                    ":\\Windows\\Tasks\\" in event.deep_get("Details", default=""),
                    ":\\Windows\\Temp\\" in event.deep_get("Details", default=""),
                    ":\\Windows\\Tracing\\" in event.deep_get("Details", default=""),
                    "\\AppData\\Local\\Temp\\" in event.deep_get("Details", default=""),
                    "\\AppData\\Roaming\\" in event.deep_get("Details", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potentially Suspicious ODBC Driver Registered
id: e4d22291-f3d5-4b78-9a0c-a1fbaf32a6a4
status: test
description: Detects the registration of a new ODBC driver where the driver is located in a potentially suspicious location
references:
    - https://www.hexacorn.com/blog/2020/08/23/odbcconf-lolbin-trifecta/
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-05-23
modified: 2023-08-17
tags:
    - attack.credential-access
    - attack.persistence
    - attack.t1003
logsource:
    category: registry_set
    product: windows
detection:
    selection:
        TargetObject|contains: '\SOFTWARE\ODBC\ODBCINST.INI\'
        TargetObject|endswith:
            - '\Driver'
            - '\Setup'
        Details|contains:
            - ':\PerfLogs\'
            - ':\ProgramData\'
            - ':\Temp\'
            - ':\Users\Public\'
            - ':\Windows\Registration\CRMLog'
            - ':\Windows\System32\com\dmp\'
            - ':\Windows\System32\FxsTmp\'
            - ':\Windows\System32\Microsoft\Crypto\RSA\MachineKeys\'
            - ':\Windows\System32\spool\drivers\color\'
            - ':\Windows\System32\spool\PRINTERS\'
            - ':\Windows\System32\spool\SERVERS\'
            - ':\Windows\System32\Tasks_Migrated\'
            - ':\Windows\System32\Tasks\Microsoft\Windows\SyncCenter\'
            - ':\Windows\SysWOW64\com\dmp\'
            - ':\Windows\SysWOW64\FxsTmp\'
            - ':\Windows\SysWOW64\Tasks\Microsoft\Windows\PLA\System\'
            - ':\Windows\SysWOW64\Tasks\Microsoft\Windows\SyncCenter\'
            - ':\Windows\Tasks\'
            - ':\Windows\Temp\'
            - ':\Windows\Tracing\'
            - '\AppData\Local\Temp\'
            - '\AppData\Roaming\'
    condition: selection
falsepositives:
    - Unlikely
level: high
Convert to SIEM query
high
Potentially Suspicious Office Document Executed From Trusted Location
Detects the execution of an Office application that points to a document that is located in a trusted location. Attackers often used this to avoid macro security and execute their malicious code.
status test author Nasreddine Bencherchali (Nextron Systems) id f99abdf0-6283-4e71-bd2b-b5c048a94743
panther query
def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("ParentImage", default="").endswith("\\explorer.exe"),
                    event.deep_get("ParentImage", default="").endswith("\\dopus.exe"),
                ]
            ),
            any(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\EXCEL.EXE"),
                            event.deep_get("Image", default="").endswith("\\POWERPNT.EXE"),
                            event.deep_get("Image", default="").endswith("\\WINWORD.exe"),
                        ]
                    ),
                    event.deep_get("OriginalFileName", default="")
                    in ["Excel.exe", "POWERPNT.EXE", "WinWord.exe"],
                ]
            ),
            any(
                [
                    "\\AppData\\Roaming\\Microsoft\\Templates"
                    in event.deep_get("CommandLine", default=""),
                    "\\AppData\\Roaming\\Microsoft\\Word\\Startup\\"
                    in event.deep_get("CommandLine", default=""),
                    "\\Microsoft Office\\root\\Templates\\"
                    in event.deep_get("CommandLine", default=""),
                    "\\Microsoft Office\\Templates\\" in event.deep_get("CommandLine", default=""),
                ]
            ),
            not any(
                [
                    event.deep_get("CommandLine", default="").endswith(".dotx"),
                    event.deep_get("CommandLine", default="").endswith(".xltx"),
                    event.deep_get("CommandLine", default="").endswith(".potx"),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potentially Suspicious Office Document Executed From Trusted Location
id: f99abdf0-6283-4e71-bd2b-b5c048a94743
status: test
description: Detects the execution of an Office application that points to a document that is located in a trusted location. Attackers often used this to avoid macro security and execute their malicious code.
references:
    - Internal Research
    - https://twitter.com/Max_Mal_/status/1633863678909874176
    - https://techcommunity.microsoft.com/t5/microsoft-365-blog/new-security-hardening-policies-for-trusted-documents/ba-p/3023465
    - https://twitter.com/_JohnHammond/status/1588155401752788994
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-06-21
modified: 2023-10-18
tags:
    - attack.stealth
    - attack.t1202
logsource:
    category: process_creation
    product: windows
detection:
    selection_parent:
        # Note: we add a parent shell to reduce FP. Add additional 3rd party shells that you might use
        ParentImage|endswith:
            - '\explorer.exe'
            - '\dopus.exe'
    selection_img:
        - Image|endswith:
              - '\EXCEL.EXE'
              - '\POWERPNT.EXE'
              - '\WINWORD.exe'
        - OriginalFileName:
              - 'Excel.exe'
              - 'POWERPNT.EXE'
              - 'WinWord.exe'
    selection_trusted_location:
        CommandLine|contains:
            # Note: these are the default locations. Admins/Users could add additional ones that you need to cover
            - '\AppData\Roaming\Microsoft\Templates'
            - '\AppData\Roaming\Microsoft\Word\Startup\'
            - '\Microsoft Office\root\Templates\'
            - '\Microsoft Office\Templates\'
    filter_main_dotx:
        # Note: We add this filter to avoid curious people clicking on template files
        CommandLine|endswith:
            - '.dotx'
            - '.xltx'
            - '.potx'
    condition: all of selection_* and not 1 of filter_main_*
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
Potentially Suspicious Regsvr32 HTTP IP Pattern
Detects regsvr32 execution to download and install DLLs located remotely where the address is an IP address.
status test author Florian Roth (Nextron Systems) id 2dd2c217-bf68-437a-b57c-fe9fd01d5de8
panther query
def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\regsvr32.exe"),
                    event.deep_get("OriginalFileName", default="") == "REGSVR32.EXE",
                ]
            ),
            any(
                [
                    " /i:http://1" in event.deep_get("CommandLine", default=""),
                    " /i:http://2" in event.deep_get("CommandLine", default=""),
                    " /i:http://3" in event.deep_get("CommandLine", default=""),
                    " /i:http://4" in event.deep_get("CommandLine", default=""),
                    " /i:http://5" in event.deep_get("CommandLine", default=""),
                    " /i:http://6" in event.deep_get("CommandLine", default=""),
                    " /i:http://7" in event.deep_get("CommandLine", default=""),
                    " /i:http://8" in event.deep_get("CommandLine", default=""),
                    " /i:http://9" in event.deep_get("CommandLine", default=""),
                    " /i:https://1" in event.deep_get("CommandLine", default=""),
                    " /i:https://2" in event.deep_get("CommandLine", default=""),
                    " /i:https://3" in event.deep_get("CommandLine", default=""),
                    " /i:https://4" in event.deep_get("CommandLine", default=""),
                    " /i:https://5" in event.deep_get("CommandLine", default=""),
                    " /i:https://6" in event.deep_get("CommandLine", default=""),
                    " /i:https://7" in event.deep_get("CommandLine", default=""),
                    " /i:https://8" in event.deep_get("CommandLine", default=""),
                    " /i:https://9" in event.deep_get("CommandLine", default=""),
                    " -i:http://1" in event.deep_get("CommandLine", default=""),
                    " -i:http://2" in event.deep_get("CommandLine", default=""),
                    " -i:http://3" in event.deep_get("CommandLine", default=""),
                    " -i:http://4" in event.deep_get("CommandLine", default=""),
                    " -i:http://5" in event.deep_get("CommandLine", default=""),
                    " -i:http://6" in event.deep_get("CommandLine", default=""),
                    " -i:http://7" in event.deep_get("CommandLine", default=""),
                    " -i:http://8" in event.deep_get("CommandLine", default=""),
                    " -i:http://9" in event.deep_get("CommandLine", default=""),
                    " -i:https://1" in event.deep_get("CommandLine", default=""),
                    " -i:https://2" in event.deep_get("CommandLine", default=""),
                    " -i:https://3" in event.deep_get("CommandLine", default=""),
                    " -i:https://4" in event.deep_get("CommandLine", default=""),
                    " -i:https://5" in event.deep_get("CommandLine", default=""),
                    " -i:https://6" in event.deep_get("CommandLine", default=""),
                    " -i:https://7" in event.deep_get("CommandLine", default=""),
                    " -i:https://8" in event.deep_get("CommandLine", default=""),
                    " -i:https://9" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Potentially Suspicious Regsvr32 HTTP IP Pattern
id: 2dd2c217-bf68-437a-b57c-fe9fd01d5de8
status: test
description: Detects regsvr32 execution to download and install DLLs located remotely where the address is an IP address.
references:
    - https://twitter.com/mrd0x/status/1461041276514623491
    - https://twitter.com/tccontre18/status/1480950986650832903
    - https://lolbas-project.github.io/lolbas/Binaries/Regsvr32/
author: Florian Roth (Nextron Systems)
date: 2022-01-11
modified: 2023-05-24
tags:
    - attack.stealth
    - attack.t1218.010
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\regsvr32.exe'
        - OriginalFileName: 'REGSVR32.EXE'
    selection_ip:
        CommandLine|contains:
            - ' /i:http://1'
            - ' /i:http://2'
            - ' /i:http://3'
            - ' /i:http://4'
            - ' /i:http://5'
            - ' /i:http://6'
            - ' /i:http://7'
            - ' /i:http://8'
            - ' /i:http://9'
            - ' /i:https://1'
            - ' /i:https://2'
            - ' /i:https://3'
            - ' /i:https://4'
            - ' /i:https://5'
            - ' /i:https://6'
            - ' /i:https://7'
            - ' /i:https://8'
            - ' /i:https://9'
            - ' -i:http://1'
            - ' -i:http://2'
            - ' -i:http://3'
            - ' -i:http://4'
            - ' -i:http://5'
            - ' -i:http://6'
            - ' -i:http://7'
            - ' -i:http://8'
            - ' -i:http://9'
            - ' -i:https://1'
            - ' -i:https://2'
            - ' -i:https://3'
            - ' -i:https://4'
            - ' -i:https://5'
            - ' -i:https://6'
            - ' -i:https://7'
            - ' -i:https://8'
            - ' -i:https://9'
    condition: all of selection_*
falsepositives:
    - FQDNs that start with a number such as "7-Zip"
level: high
Convert to SIEM query
high
PowerShell ADRecon Execution
Detects execution of ADRecon.ps1 for AD reconnaissance which has been reported to be actively used by FIN7
status test author Bhabesh Raj id bf72941a-cba0-41ea-b18c-9aca3925690d
panther query
def rule(event):
    if any(
        [
            "Function Get-ADRExcelComOb" in event.deep_get("ScriptBlockText", default=""),
            "Get-ADRGPO" in event.deep_get("ScriptBlockText", default=""),
            "Get-ADRDomainController" in event.deep_get("ScriptBlockText", default=""),
            "ADRecon-Report.xlsx" in event.deep_get("ScriptBlockText", default=""),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell ADRecon Execution
id: bf72941a-cba0-41ea-b18c-9aca3925690d
status: test
description: Detects execution of ADRecon.ps1 for AD reconnaissance which has been reported to be actively used by FIN7
references:
    - https://github.com/sense-of-security/ADRecon/blob/11881a24e9c8b207f31b56846809ce1fb189bcc9/ADRecon.ps1
    - https://bi-zone.medium.com/from-pentest-to-apt-attack-cybercriminal-group-fin7-disguises-its-malware-as-an-ethical-hackers-c23c9a75e319
author: Bhabesh Raj
date: 2021-07-16
modified: 2022-09-06
tags:
    - attack.discovery
    - attack.execution
    - attack.t1059.001
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection:
        ScriptBlockText|contains:
            - 'Function Get-ADRExcelComOb'
            - 'Get-ADRGPO'
            - 'Get-ADRDomainController'
            - 'ADRecon-Report.xlsx' # Default
    condition: selection
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
PowerShell Base64 Encoded FromBase64String Cmdlet
Detects usage of a base64 encoded "FromBase64String" cmdlet in a process command line
status test author Florian Roth (Nextron Systems) id fdb62a13-9a81-4e5c-a38f-ea93a16f6d7c
panther query
def rule(event):
    if any(
        [
            any(
                [
                    "OjpGcm9tQmFzZTY0U3RyaW5n" in event.deep_get("CommandLine", default=""),
                    "o6RnJvbUJhc2U2NFN0cmluZ" in event.deep_get("CommandLine", default=""),
                    "6OkZyb21CYXNlNjRTdHJpbm" in event.deep_get("CommandLine", default=""),
                ]
            ),
            any(
                [
                    "OgA6AEYAcgBvAG0AQgBhAHMAZQA2ADQAUwB0AHIAaQBuAGcA"
                    in event.deep_get("CommandLine", default=""),
                    "oAOgBGAHIAbwBtAEIAYQBzAGUANgA0AFMAdAByAGkAbgBnA"
                    in event.deep_get("CommandLine", default=""),
                    "6ADoARgByAG8AbQBCAGEAcwBlADYANABTAHQAcgBpAG4AZw"
                    in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Base64 Encoded FromBase64String Cmdlet
id: fdb62a13-9a81-4e5c-a38f-ea93a16f6d7c
status: test
description: Detects usage of a base64 encoded "FromBase64String" cmdlet in a process command line
references:
    - Internal Research
author: Florian Roth (Nextron Systems)
date: 2019-08-24
modified: 2023-04-06
tags:
    - attack.stealth
    - attack.t1140
    - attack.execution
    - attack.t1059.001
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        - CommandLine|base64offset|contains: '::FromBase64String'
        # UTF-16 LE
        - CommandLine|contains:
              - 'OgA6AEYAcgBvAG0AQgBhAHMAZQA2ADQAUwB0AHIAaQBuAGcA'
              - 'oAOgBGAHIAbwBtAEIAYQBzAGUANgA0AFMAdAByAGkAbgBnA'
              - '6ADoARgByAG8AbQBCAGEAcwBlADYANABTAHQAcgBpAG4AZw'
    condition: selection
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
PowerShell Base64 Encoded IEX Cmdlet
Detects usage of a base64 encoded "IEX" cmdlet in a process command line
status test author Florian Roth (Nextron Systems) id 88f680b8-070e-402c-ae11-d2914f2257f1
panther query
def rule(event):
    if any(
        [
            any(
                [
                    any(
                        [
                            "SUVYIChb" in event.deep_get("CommandLine", default=""),
                            "lFWCAoW" in event.deep_get("CommandLine", default=""),
                            "JRVggKF" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            "aWV4IChb" in event.deep_get("CommandLine", default=""),
                            "lleCAoW" in event.deep_get("CommandLine", default=""),
                            "pZXggKF" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            "aWV4IChOZX" in event.deep_get("CommandLine", default=""),
                            "lleCAoTmV3" in event.deep_get("CommandLine", default=""),
                            "pZXggKE5ld" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            "SUVYIChOZX" in event.deep_get("CommandLine", default=""),
                            "lFWCAoTmV3" in event.deep_get("CommandLine", default=""),
                            "JRVggKE5ld" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            "SUVYKF" in event.deep_get("CommandLine", default=""),
                            "lFWChb" in event.deep_get("CommandLine", default=""),
                            "JRVgoW" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            "aWV4KF" in event.deep_get("CommandLine", default=""),
                            "lleChb" in event.deep_get("CommandLine", default=""),
                            "pZXgoW" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            "aWV4KE5ld" in event.deep_get("CommandLine", default=""),
                            "lleChOZX" in event.deep_get("CommandLine", default=""),
                            "pZXgoTmV3" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            "SUVYKE5ld" in event.deep_get("CommandLine", default=""),
                            "lFWChOZX" in event.deep_get("CommandLine", default=""),
                            "JRVgoTmV3" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            "SUVYKCgn" in event.deep_get("CommandLine", default=""),
                            "lFWCgoJ" in event.deep_get("CommandLine", default=""),
                            "JRVgoKC" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            "aWV4KCgn" in event.deep_get("CommandLine", default=""),
                            "lleCgoJ" in event.deep_get("CommandLine", default=""),
                            "pZXgoKC" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
            any(
                [
                    "SQBFAFgAIAAoAFsA" in event.deep_get("CommandLine", default=""),
                    "kARQBYACAAKABbA" in event.deep_get("CommandLine", default=""),
                    "JAEUAWAAgACgAWw" in event.deep_get("CommandLine", default=""),
                    "aQBlAHgAIAAoAFsA" in event.deep_get("CommandLine", default=""),
                    "kAZQB4ACAAKABbA" in event.deep_get("CommandLine", default=""),
                    "pAGUAeAAgACgAWw" in event.deep_get("CommandLine", default=""),
                    "aQBlAHgAIAAoAE4AZQB3A" in event.deep_get("CommandLine", default=""),
                    "kAZQB4ACAAKABOAGUAdw" in event.deep_get("CommandLine", default=""),
                    "pAGUAeAAgACgATgBlAHcA" in event.deep_get("CommandLine", default=""),
                    "SQBFAFgAIAAoAE4AZQB3A" in event.deep_get("CommandLine", default=""),
                    "kARQBYACAAKABOAGUAdw" in event.deep_get("CommandLine", default=""),
                    "JAEUAWAAgACgATgBlAHcA" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Base64 Encoded IEX Cmdlet
id: 88f680b8-070e-402c-ae11-d2914f2257f1
status: test
description: Detects usage of a base64 encoded "IEX" cmdlet in a process command line
references:
    - Internal Research
author: Florian Roth (Nextron Systems)
date: 2019-08-23
modified: 2023-04-06
tags:
    - attack.execution
    - attack.t1059.001
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        - CommandLine|base64offset|contains:
              - 'IEX (['
              - 'iex (['
              - 'iex (New'
              - 'IEX (New'
              - 'IEX(['
              - 'iex(['
              - 'iex(New'
              - 'IEX(New'
              - "IEX(('"
              - "iex(('"
        # UTF16 LE
        - CommandLine|contains:
              - 'SQBFAFgAIAAoAFsA'
              - 'kARQBYACAAKABbA'
              - 'JAEUAWAAgACgAWw'
              - 'aQBlAHgAIAAoAFsA'
              - 'kAZQB4ACAAKABbA'
              - 'pAGUAeAAgACgAWw'
              - 'aQBlAHgAIAAoAE4AZQB3A'
              - 'kAZQB4ACAAKABOAGUAdw'
              - 'pAGUAeAAgACgATgBlAHcA'
              - 'SQBFAFgAIAAoAE4AZQB3A'
              - 'kARQBYACAAKABOAGUAdw'
              - 'JAEUAWAAgACgATgBlAHcA'
    condition: selection
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
PowerShell Base64 Encoded Invoke Keyword
Detects UTF-8 and UTF-16 Base64 encoded powershell 'Invoke-' calls
status test author pH-T (Nextron Systems), Harjot Singh, @cyb3rjy0t id 6385697e-9f1b-40bd-8817-f4a91f40508e
panther query
def rule(event):
    if all(
        [
            any(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\powershell.exe"),
                            event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                        ]
                    ),
                    event.deep_get("OriginalFileName", default="")
                    in ["PowerShell.EXE", "pwsh.dll"],
                ]
            ),
            " -e" in event.deep_get("CommandLine", default=""),
            any(
                [
                    "SQBuAHYAbwBrAGUALQ" in event.deep_get("CommandLine", default=""),
                    "kAbgB2AG8AawBlAC0A" in event.deep_get("CommandLine", default=""),
                    "JAG4AdgBvAGsAZQAtA" in event.deep_get("CommandLine", default=""),
                    "SW52b2tlL" in event.deep_get("CommandLine", default=""),
                    "ludm9rZS" in event.deep_get("CommandLine", default=""),
                    "JbnZva2Ut" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Base64 Encoded Invoke Keyword
id: 6385697e-9f1b-40bd-8817-f4a91f40508e
related:
    - id: fd6e2919-3936-40c9-99db-0aa922c356f7
      type: obsolete
status: test
description: Detects UTF-8 and UTF-16 Base64 encoded powershell 'Invoke-' calls
references:
    - https://thedfirreport.com/2022/05/09/seo-poisoning-a-gootloader-story/
author: pH-T (Nextron Systems), Harjot Singh, @cyb3rjy0t
date: 2022-05-20
modified: 2023-04-06
tags:
    - attack.execution
    - attack.stealth
    - attack.t1059.001
    - attack.t1027
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith:
              - '\powershell.exe'
              - '\pwsh.exe'
        - OriginalFileName:
              - 'PowerShell.EXE'
              - 'pwsh.dll'
    selection_cli_enc:
        CommandLine|contains: ' -e'
    selection_cli_invoke:
        CommandLine|contains:
            # Invoke-
            # UTF-16LE
            - 'SQBuAHYAbwBrAGUALQ'
            - 'kAbgB2AG8AawBlAC0A'
            - 'JAG4AdgBvAGsAZQAtA'
            # UTF-8
            - 'SW52b2tlL'
            - 'ludm9rZS'
            - 'JbnZva2Ut'
    condition: all of selection_*
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
PowerShell Base64 Encoded Reflective Assembly Load
Detects base64 encoded .NET reflective loading of Assembly
status test author Christian Burkard (Nextron Systems), pH-T (Nextron Systems) id 62b7ccc9-23b4-471e-aa15-6da3663c4d59
panther query
def rule(event):
    if any(
        [
            "WwBSAGUAZgBsAGUAYwB0AGkAbwBuAC4AQQBzAHMAZQBtAGIAbAB5AF0AOgA6AEwAbwBhAGQAKA"
            in event.deep_get("CommandLine", default=""),
            "sAUgBlAGYAbABlAGMAdABpAG8AbgAuAEEAcwBzAGUAbQBiAGwAeQBdADoAOgBMAG8AYQBkACgA"
            in event.deep_get("CommandLine", default=""),
            "bAFIAZQBmAGwAZQBjAHQAaQBvAG4ALgBBAHMAcwBlAG0AYgBsAHkAXQA6ADoATABvAGEAZAAoA"
            in event.deep_get("CommandLine", default=""),
            "AFsAcgBlAGYAbABlAGMAdABpAG8AbgAuAGEAcwBzAGUAbQBiAGwAeQBdADoAOgAoACIATABvAGEAZAAiAC"
            in event.deep_get("CommandLine", default=""),
            "BbAHIAZQBmAGwAZQBjAHQAaQBvAG4ALgBhAHMAcwBlAG0AYgBsAHkAXQA6ADoAKAAiAEwAbwBhAGQAIgAp"
            in event.deep_get("CommandLine", default=""),
            "AWwByAGUAZgBsAGUAYwB0AGkAbwBuAC4AYQBzAHMAZQBtAGIAbAB5AF0AOgA6ACgAIgBMAG8AYQBkACIAK"
            in event.deep_get("CommandLine", default=""),
            "WwBSAGUAZgBsAGUAYwB0AGkAbwBuAC4AQQBzAHMAZQBtAGIAbAB5AF0AOgA6ACgAIgBMAG8AYQBkACIAKQ"
            in event.deep_get("CommandLine", default=""),
            "sAUgBlAGYAbABlAGMAdABpAG8AbgAuAEEAcwBzAGUAbQBiAGwAeQBdADoAOgAoACIATABvAGEAZAAiACkA"
            in event.deep_get("CommandLine", default=""),
            "bAFIAZQBmAGwAZQBjAHQAaQBvAG4ALgBBAHMAcwBlAG0AYgBsAHkAXQA6ADoAKAAiAEwAbwBhAGQAIgApA"
            in event.deep_get("CommandLine", default=""),
            "WwByAGUAZgBsAGUAYwB0AGkAbwBuAC4AYQBzAHMAZQBtAGIAbAB5AF0AOgA6AEwAbwBhAGQAKA"
            in event.deep_get("CommandLine", default=""),
            "sAcgBlAGYAbABlAGMAdABpAG8AbgAuAGEAcwBzAGUAbQBiAGwAeQBdADoAOgBMAG8AYQBkACgA"
            in event.deep_get("CommandLine", default=""),
            "bAHIAZQBmAGwAZQBjAHQAaQBvAG4ALgBhAHMAcwBlAG0AYgBsAHkAXQA6ADoATABvAGEAZAAoA"
            in event.deep_get("CommandLine", default=""),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Base64 Encoded Reflective Assembly Load
id: 62b7ccc9-23b4-471e-aa15-6da3663c4d59
related:
    - id: 9c0295ce-d60d-40bd-bd74-84673b7592b1
      type: similar
status: test
description: Detects base64 encoded .NET reflective loading of Assembly
references:
    - https://github.com/Neo23x0/Raccine/blob/20a569fa21625086433dcce8bb2765d0ea08dcb6/yara/mal_revil.yar
    - https://thedfirreport.com/2022/05/09/seo-poisoning-a-gootloader-story/
author: Christian Burkard (Nextron Systems), pH-T (Nextron Systems)
date: 2022-03-01
modified: 2023-01-30
tags:
    - attack.execution
    - attack.stealth
    - attack.t1059.001
    - attack.t1027
    - attack.t1620
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        CommandLine|contains:
            # [Reflection.Assembly]::Load(
            - 'WwBSAGUAZgBsAGUAYwB0AGkAbwBuAC4AQQBzAHMAZQBtAGIAbAB5AF0AOgA6AEwAbwBhAGQAKA'
            - 'sAUgBlAGYAbABlAGMAdABpAG8AbgAuAEEAcwBzAGUAbQBiAGwAeQBdADoAOgBMAG8AYQBkACgA'
            - 'bAFIAZQBmAGwAZQBjAHQAaQBvAG4ALgBBAHMAcwBlAG0AYgBsAHkAXQA6ADoATABvAGEAZAAoA'
            # [reflection.assembly]::("Load")
            - 'AFsAcgBlAGYAbABlAGMAdABpAG8AbgAuAGEAcwBzAGUAbQBiAGwAeQBdADoAOgAoACIATABvAGEAZAAiAC'
            - 'BbAHIAZQBmAGwAZQBjAHQAaQBvAG4ALgBhAHMAcwBlAG0AYgBsAHkAXQA6ADoAKAAiAEwAbwBhAGQAIgAp'
            - 'AWwByAGUAZgBsAGUAYwB0AGkAbwBuAC4AYQBzAHMAZQBtAGIAbAB5AF0AOgA6ACgAIgBMAG8AYQBkACIAK'
            # [Reflection.Assembly]::("Load")
            - 'WwBSAGUAZgBsAGUAYwB0AGkAbwBuAC4AQQBzAHMAZQBtAGIAbAB5AF0AOgA6ACgAIgBMAG8AYQBkACIAKQ'
            - 'sAUgBlAGYAbABlAGMAdABpAG8AbgAuAEEAcwBzAGUAbQBiAGwAeQBdADoAOgAoACIATABvAGEAZAAiACkA'
            - 'bAFIAZQBmAGwAZQBjAHQAaQBvAG4ALgBBAHMAcwBlAG0AYgBsAHkAXQA6ADoAKAAiAEwAbwBhAGQAIgApA'
            # [reflection.assembly]::Load(
            - 'WwByAGUAZgBsAGUAYwB0AGkAbwBuAC4AYQBzAHMAZQBtAGIAbAB5AF0AOgA6AEwAbwBhAGQAKA'
            - 'sAcgBlAGYAbABlAGMAdABpAG8AbgAuAGEAcwBzAGUAbQBiAGwAeQBdADoAOgBMAG8AYQBkACgA'
            - 'bAHIAZQBmAGwAZQBjAHQAaQBvAG4ALgBhAHMAcwBlAG0AYgBsAHkAXQA6ADoATABvAGEAZAAoA'
    condition: selection
falsepositives:
    - Unlikely
level: high
Convert to SIEM query
high
PowerShell Base64 Encoded WMI Classes
Detects calls to base64 encoded WMI class such as "Win32_ShadowCopy", "Win32_ScheduledJob", etc.
status test author Christian Burkard (Nextron Systems), Nasreddine Bencherchali (Nextron Systems) id 1816994b-42e1-4fb1-afd2-134d88184f71
panther query
def rule(event):
    if all(
        [
            any(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\powershell.exe"),
                            event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                        ]
                    ),
                    event.deep_get("OriginalFileName", default="")
                    in ["PowerShell.EXE", "pwsh.dll"],
                ]
            ),
            any(
                [
                    any(
                        [
                            "VwBpAG4AMwAyAF8AUwBoAGEAZABvAHcAYwBvAHAAeQ"
                            in event.deep_get("CommandLine", default=""),
                            "cAaQBuADMAMgBfAFMAaABhAGQAbwB3AGMAbwBwAHkA"
                            in event.deep_get("CommandLine", default=""),
                            "XAGkAbgAzADIAXwBTAGgAYQBkAG8AdwBjAG8AcAB5A"
                            in event.deep_get("CommandLine", default=""),
                            "V2luMzJfU2hhZG93Y29we" in event.deep_get("CommandLine", default=""),
                            "dpbjMyX1NoYWRvd2NvcH" in event.deep_get("CommandLine", default=""),
                            "XaW4zMl9TaGFkb3djb3B5" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            "VwBpAG4AMwAyAF8AUwBjAGgAZQBkAHUAbABlAGQASgBvAGIA"
                            in event.deep_get("CommandLine", default=""),
                            "cAaQBuADMAMgBfAFMAYwBoAGUAZAB1AGwAZQBkAEoAbwBiA"
                            in event.deep_get("CommandLine", default=""),
                            "XAGkAbgAzADIAXwBTAGMAaABlAGQAdQBsAGUAZABKAG8AYg"
                            in event.deep_get("CommandLine", default=""),
                            "V2luMzJfU2NoZWR1bGVkSm9i" in event.deep_get("CommandLine", default=""),
                            "dpbjMyX1NjaGVkdWxlZEpvY" in event.deep_get("CommandLine", default=""),
                            "XaW4zMl9TY2hlZHVsZWRKb2" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            "VwBpAG4AMwAyAF8AUAByAG8AYwBlAHMAcw"
                            in event.deep_get("CommandLine", default=""),
                            "cAaQBuADMAMgBfAFAAcgBvAGMAZQBzAHMA"
                            in event.deep_get("CommandLine", default=""),
                            "XAGkAbgAzADIAXwBQAHIAbwBjAGUAcwBzA"
                            in event.deep_get("CommandLine", default=""),
                            "V2luMzJfUHJvY2Vzc" in event.deep_get("CommandLine", default=""),
                            "dpbjMyX1Byb2Nlc3" in event.deep_get("CommandLine", default=""),
                            "XaW4zMl9Qcm9jZXNz" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            "VwBpAG4AMwAyAF8AVQBzAGUAcgBBAGMAYwBvAHUAbgB0A"
                            in event.deep_get("CommandLine", default=""),
                            "cAaQBuADMAMgBfAFUAcwBlAHIAQQBjAGMAbwB1AG4AdA"
                            in event.deep_get("CommandLine", default=""),
                            "XAGkAbgAzADIAXwBVAHMAZQByAEEAYwBjAG8AdQBuAHQA"
                            in event.deep_get("CommandLine", default=""),
                            "V2luMzJfVXNlckFjY291bn" in event.deep_get("CommandLine", default=""),
                            "dpbjMyX1VzZXJBY2NvdW50" in event.deep_get("CommandLine", default=""),
                            "XaW4zMl9Vc2VyQWNjb3Vud" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            "VwBpAG4AMwAyAF8ATABvAGcAZwBlAGQATwBuAFUAcwBlAHIA"
                            in event.deep_get("CommandLine", default=""),
                            "cAaQBuADMAMgBfAEwAbwBnAGcAZQBkAE8AbgBVAHMAZQByA"
                            in event.deep_get("CommandLine", default=""),
                            "XAGkAbgAzADIAXwBMAG8AZwBnAGUAZABPAG4AVQBzAGUAcg"
                            in event.deep_get("CommandLine", default=""),
                            "V2luMzJfTG9nZ2VkT25Vc2Vy" in event.deep_get("CommandLine", default=""),
                            "dpbjMyX0xvZ2dlZE9uVXNlc" in event.deep_get("CommandLine", default=""),
                            "XaW4zMl9Mb2dnZWRPblVzZX" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Base64 Encoded WMI Classes
id: 1816994b-42e1-4fb1-afd2-134d88184f71
related:
    - id: 47688f1b-9f51-4656-b013-3cc49a166a36
      type: obsolete
status: test
description: Detects calls to base64 encoded WMI class such as "Win32_ShadowCopy", "Win32_ScheduledJob", etc.
references:
    - https://github.com/Neo23x0/Raccine/blob/20a569fa21625086433dcce8bb2765d0ea08dcb6/yara/mal_revil.yar
author: Christian Burkard (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
date: 2023-01-30
tags:
    - attack.execution
    - attack.stealth
    - attack.t1059.001
    - attack.t1027
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith:
              - '\powershell.exe'
              - '\pwsh.exe'
        - OriginalFileName:
              - 'PowerShell.EXE'
              - 'pwsh.dll'
    selection_cli_shadowcopy:
        # Win32_ShadowCopy
        CommandLine|contains:
            - 'VwBpAG4AMwAyAF8AUwBoAGEAZABvAHcAYwBvAHAAeQ'
            - 'cAaQBuADMAMgBfAFMAaABhAGQAbwB3AGMAbwBwAHkA'
            - 'XAGkAbgAzADIAXwBTAGgAYQBkAG8AdwBjAG8AcAB5A'
            - 'V2luMzJfU2hhZG93Y29we'
            - 'dpbjMyX1NoYWRvd2NvcH'
            - 'XaW4zMl9TaGFkb3djb3B5'
    selection_cli_scheduledJob:
        # Win32_ScheduledJob
        CommandLine|contains:
            - 'VwBpAG4AMwAyAF8AUwBjAGgAZQBkAHUAbABlAGQASgBvAGIA'
            - 'cAaQBuADMAMgBfAFMAYwBoAGUAZAB1AGwAZQBkAEoAbwBiA'
            - 'XAGkAbgAzADIAXwBTAGMAaABlAGQAdQBsAGUAZABKAG8AYg'
            - 'V2luMzJfU2NoZWR1bGVkSm9i'
            - 'dpbjMyX1NjaGVkdWxlZEpvY'
            - 'XaW4zMl9TY2hlZHVsZWRKb2'
    selection_cli_process:
        # Win32_Process
        CommandLine|contains:
            - 'VwBpAG4AMwAyAF8AUAByAG8AYwBlAHMAcw'
            - 'cAaQBuADMAMgBfAFAAcgBvAGMAZQBzAHMA'
            - 'XAGkAbgAzADIAXwBQAHIAbwBjAGUAcwBzA'
            - 'V2luMzJfUHJvY2Vzc'
            - 'dpbjMyX1Byb2Nlc3'
            - 'XaW4zMl9Qcm9jZXNz'
    selection_cli_useraccount:
        # Win32_UserAccount
        CommandLine|contains:
            - 'VwBpAG4AMwAyAF8AVQBzAGUAcgBBAGMAYwBvAHUAbgB0A'
            - 'cAaQBuADMAMgBfAFUAcwBlAHIAQQBjAGMAbwB1AG4AdA'
            - 'XAGkAbgAzADIAXwBVAHMAZQByAEEAYwBjAG8AdQBuAHQA'
            - 'V2luMzJfVXNlckFjY291bn'
            - 'dpbjMyX1VzZXJBY2NvdW50'
            - 'XaW4zMl9Vc2VyQWNjb3Vud'
    selection_cli_loggedonuser:
        # Win32_LoggedOnUser
        CommandLine|contains:
            - 'VwBpAG4AMwAyAF8ATABvAGcAZwBlAGQATwBuAFUAcwBlAHIA'
            - 'cAaQBuADMAMgBfAEwAbwBnAGcAZQBkAE8AbgBVAHMAZQByA'
            - 'XAGkAbgAzADIAXwBMAG8AZwBnAGUAZABPAG4AVQBzAGUAcg'
            - 'V2luMzJfTG9nZ2VkT25Vc2Vy'
            - 'dpbjMyX0xvZ2dlZE9uVXNlc'
            - 'XaW4zMl9Mb2dnZWRPblVzZX'
    condition: selection_img and 1 of selection_cli_*
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
PowerShell Called from an Executable Version Mismatch
Detects PowerShell called from an executable by the version mismatch method
status test author Sean Metcalf (source), Florian Roth (Nextron Systems) id c70e019b-1479-4b65-b0cc-cd0c6093a599
panther query
def rule(event):
    if all(
        [
            any(
                [
                    "EngineVersion=2." in event.deep_get("Data", default=""),
                    "EngineVersion=4." in event.deep_get("Data", default=""),
                    "EngineVersion=5." in event.deep_get("Data", default=""),
                ]
            ),
            "HostVersion=3." in event.deep_get("Data", default=""),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Called from an Executable Version Mismatch
id: c70e019b-1479-4b65-b0cc-cd0c6093a599
status: test
description: Detects PowerShell called from an executable by the version mismatch method
references:
    - https://adsecurity.org/?p=2921
author: Sean Metcalf (source), Florian Roth (Nextron Systems)
date: 2017-03-05
modified: 2023-10-27
tags:
    - attack.execution
    - attack.t1059.001
logsource:
    product: windows
    category: ps_classic_start
detection:
    selection_engine:
        Data|contains:
            - 'EngineVersion=2.'
            - 'EngineVersion=4.'
            - 'EngineVersion=5.'
    selection_host:
        Data|contains: 'HostVersion=3.'
    condition: all of selection_*
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
PowerShell Credential Prompt
Detects PowerShell calling a credential prompt
status test author John Lambert (idea), Florian Roth (Nextron Systems) id ca8b77a9-d499-4095-b793-5d5f330d450e
panther query
def rule(event):
    if "PromptForCredential" in event.deep_get("ScriptBlockText", default=""):
        return True
    return False
view Sigma YAML
title: PowerShell Credential Prompt
id: ca8b77a9-d499-4095-b793-5d5f330d450e
status: test
description: Detects PowerShell calling a credential prompt
references:
    - https://twitter.com/JohnLaTwC/status/850381440629981184
    - https://t.co/ezOTGy1a1G
author: John Lambert (idea), Florian Roth (Nextron Systems)
date: 2017-04-09
modified: 2022-12-25
tags:
    - attack.credential-access
    - attack.execution
    - attack.t1059.001
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection:
        ScriptBlockText|contains: 'PromptForCredential'
    condition: selection
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
PowerShell Defender Threat Severity Default Action Set to 'Allow' or 'NoAction'
Detects the use of PowerShell to execute the 'Set-MpPreference' cmdlet to configure Windows Defender's threat severity default action to 'Allow' (value '6') or 'NoAction' (value '9'). This is a highly suspicious configuration change that effectively disables Defender's ability to automatically mitigate threats of a certain severity level. An attacker might use this technique via the command line to bypass defenses before executing payloads.
status experimental author Matt Anderson (Huntress) id 1e8a9b4d-3c2a-4f9b-8d1e-7c6a5b4f3d2e
panther query
def rule(event):
    if all(
        [
            "Set-MpPreference" in event.deep_get("CommandLine", default=""),
            any(
                [
                    "-LowThreatDefaultAction" in event.deep_get("CommandLine", default=""),
                    "-ModerateThreatDefaultAction" in event.deep_get("CommandLine", default=""),
                    "-HighThreatDefaultAction" in event.deep_get("CommandLine", default=""),
                    "-SevereThreatDefaultAction" in event.deep_get("CommandLine", default=""),
                    "-ltdefac " in event.deep_get("CommandLine", default=""),
                    "-mtdefac " in event.deep_get("CommandLine", default=""),
                    "-htdefac " in event.deep_get("CommandLine", default=""),
                    "-stdefac " in event.deep_get("CommandLine", default=""),
                ]
            ),
            any(
                [
                    "Allow" in event.deep_get("CommandLine", default=""),
                    "6" in event.deep_get("CommandLine", default=""),
                    "NoAction" in event.deep_get("CommandLine", default=""),
                    "9" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Defender Threat Severity Default Action Set to 'Allow' or 'NoAction'
id: 1e8a9b4d-3c2a-4f9b-8d1e-7c6a5b4f3d2e
related:
    - id: 5a9e1b2c-8f7d-4a1e-9b3c-0f6d7e5a4b1f
      type: similar
status: experimental
description: |
    Detects the use of PowerShell to execute the 'Set-MpPreference' cmdlet to configure Windows Defender's threat severity default action to 'Allow' (value '6') or 'NoAction' (value '9').
    This is a highly suspicious configuration change that effectively disables Defender's ability to automatically mitigate threats of a certain severity level.
    An attacker might use this technique via the command line to bypass defenses before executing payloads.
references:
    - https://learn.microsoft.com/en-us/powershell/module/defender/set-mppreference
    - https://learn.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/security-malware-windows-defender-threatseveritydefaultaction
    - https://research.splunk.com/endpoint/7215831c-8252-4ae3-8d43-db588e82f952
    - https://gist.github.com/Dump-GUY/8daef859f382b895ac6fd0cf094555d2
    - https://thedfirreport.com/2021/10/18/icedid-to-xinglocker-ransomware-in-24-hours/
author: 'Matt Anderson (Huntress)'
date: 2025-07-11
tags:
    - attack.defense-impairment
    - attack.t1685
logsource:
    category: process_creation
    product: windows
detection:
    selection_cmdlet:
        CommandLine|contains: 'Set-MpPreference'
    selection_action:
        CommandLine|contains:
            - '-LowThreatDefaultAction'
            - '-ModerateThreatDefaultAction'
            - '-HighThreatDefaultAction'
            - '-SevereThreatDefaultAction'
            - '-ltdefac '
            - '-mtdefac '
            - '-htdefac '
            - '-stdefac '
    selection_value:
        CommandLine|contains:
            - 'Allow'
            - '6'
            - 'NoAction'
            - '9'
    condition: all of selection_*
falsepositives:
    - Highly unlikely
level: high
Convert to SIEM query
high
PowerShell Download and Execution Cradles
Detects PowerShell download and execution cradles.
status test author Florian Roth (Nextron Systems) id 85b0b087-eddf-4a2b-b033-d771fa2b9775
panther query
def rule(event):
    if all(
        [
            any(
                [
                    ".DownloadString(" in event.deep_get("CommandLine", default=""),
                    ".DownloadFile(" in event.deep_get("CommandLine", default=""),
                    "Invoke-WebRequest " in event.deep_get("CommandLine", default=""),
                    "iwr " in event.deep_get("CommandLine", default=""),
                    "Invoke-RestMethod " in event.deep_get("CommandLine", default=""),
                    "irm " in event.deep_get("CommandLine", default=""),
                ]
            ),
            any(
                [
                    ";iex $" in event.deep_get("CommandLine", default=""),
                    "| IEX" in event.deep_get("CommandLine", default=""),
                    "|IEX " in event.deep_get("CommandLine", default=""),
                    "I`E`X" in event.deep_get("CommandLine", default=""),
                    "I`EX" in event.deep_get("CommandLine", default=""),
                    "IE`X" in event.deep_get("CommandLine", default=""),
                    "iex " in event.deep_get("CommandLine", default=""),
                    "IEX (" in event.deep_get("CommandLine", default=""),
                    "IEX(" in event.deep_get("CommandLine", default=""),
                    "Invoke-Expression" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Download and Execution Cradles
id: 85b0b087-eddf-4a2b-b033-d771fa2b9775
status: test
description: Detects PowerShell download and execution cradles.
references:
    - https://github.com/VirtualAlllocEx/Payload-Download-Cradles/blob/88e8eca34464a547c90d9140d70e9866dcbc6a12/Download-Cradles.cmd
    - https://labs.withsecure.com/publications/fin7-target-veeam-servers
author: Florian Roth (Nextron Systems)
date: 2022-03-24
modified: 2025-07-18
tags:
    - attack.execution
    - attack.t1059
logsource:
    product: windows
    category: process_creation
detection:
    selection_download:
        CommandLine|contains:
            - '.DownloadString('
            - '.DownloadFile('
            - 'Invoke-WebRequest '
            - 'iwr '
            - 'Invoke-RestMethod '
            - 'irm '  # powershell -ep bypass -w h -c irm test.domain/ffe | iex
    selection_iex:
        CommandLine|contains:
            - ';iex $'
            - '| IEX'
            - '|IEX '
            - 'I`E`X'
            - 'I`EX'
            - 'IE`X'
            - 'iex '
            - 'IEX ('
            - 'IEX('
            - 'Invoke-Expression'
    condition: all of selection_*
falsepositives:
    - Some PowerShell installers were seen using similar combinations. Apply filters accordingly
level: high
Convert to SIEM query
high
PowerShell Execution With Potential Decryption Capabilities
Detects PowerShell commands that decrypt an ".LNK" "file to drop the next stage of the malware.
status test author X__Junior (Nextron Systems), Nasreddine Bencherchali (Nextron Systems) id 434c08ba-8406-4d15-8b24-782cb071a691
panther query
import re


def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\powershell.exe"),
                    event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                ]
            ),
            event.deep_get("OriginalFileName", default="") in ["PowerShell.EXE", "pwsh.dll"],
            any(
                [
                    "Get-ChildItem " in event.deep_get("CommandLine", default=""),
                    "dir " in event.deep_get("CommandLine", default=""),
                    "gci " in event.deep_get("CommandLine", default=""),
                    "ls " in event.deep_get("CommandLine", default=""),
                ]
            ),
            any(
                [
                    "Get-Content " in event.deep_get("CommandLine", default=""),
                    "gc " in event.deep_get("CommandLine", default=""),
                    "cat " in event.deep_get("CommandLine", default=""),
                    "type " in event.deep_get("CommandLine", default=""),
                    "ReadAllBytes" in event.deep_get("CommandLine", default=""),
                ]
            ),
            any(
                [
                    all(
                        [
                            " ^| " in event.deep_get("CommandLine", default=""),
                            re.match(r"^.*\\.*.lnk.*$", event.deep_get("CommandLine", default="")),
                            "-Recurse" in event.deep_get("CommandLine", default=""),
                            "-Skip " in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    all(
                        [
                            " -ExpandProperty " in event.deep_get("CommandLine", default=""),
                            re.match(r"^.*\\.*.lnk.*$", event.deep_get("CommandLine", default="")),
                            "WriteAllBytes" in event.deep_get("CommandLine", default=""),
                            " .length " in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Execution With Potential Decryption Capabilities
id: 434c08ba-8406-4d15-8b24-782cb071a691
status: test
description: Detects PowerShell commands that decrypt an ".LNK" "file to drop the next stage of the malware.
references:
    - https://research.checkpoint.com/2023/chinese-threat-actors-targeting-europe-in-smugx-campaign/
author: X__Junior (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
date: 2023-06-30
modified: 2023-12-05
tags:
    - attack.execution
logsource:
    product: windows
    category: process_creation
detection:
    selection_img:
        Image|endswith:
            - '\powershell.exe'
            - '\pwsh.exe'
        OriginalFileName:
            - 'PowerShell.EXE'
            - 'pwsh.dll'
    selection_cli_dir:
        CommandLine|contains:
            - "Get-ChildItem "
            - "dir "
            - "gci "
            - "ls "
    selection_cli_gc:
        CommandLine|contains:
            - "Get-Content "
            - "gc "
            - 'cat '
            - 'type '
            - 'ReadAllBytes'
    selection_cli_specific:
        - CommandLine|contains|all:
              - ' ^| '
              - '\*.lnk'
              - '-Recurse'
              - '-Skip '
        - CommandLine|contains|all:
              - ' -ExpandProperty '
              - '\*.lnk'
              - 'WriteAllBytes'
              - ' .length '
    condition: all of selection_*
falsepositives:
    - Unlikely
level: high
Convert to SIEM query
high
PowerShell Get-Process LSASS
Detects a "Get-Process" cmdlet and it's aliases on lsass process, which is in almost all cases a sign of malicious activity
status test author Florian Roth (Nextron Systems) id b2815d0d-7481-4bf0-9b6c-a4c48a94b349
panther query
def rule(event):
    if any(
        [
            "Get-Process lsas" in event.deep_get("CommandLine", default=""),
            "ps lsas" in event.deep_get("CommandLine", default=""),
            "gps lsas" in event.deep_get("CommandLine", default=""),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Get-Process LSASS
id: b2815d0d-7481-4bf0-9b6c-a4c48a94b349
status: test
description: Detects a "Get-Process" cmdlet and it's aliases on lsass process, which is in almost all cases a sign of malicious activity
references:
    - https://web.archive.org/web/20220205033028/https://twitter.com/PythonResponder/status/1385064506049630211
author: Florian Roth (Nextron Systems)
date: 2021-04-23
modified: 2023-01-05
tags:
    - attack.credential-access
    - attack.t1552.004
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        CommandLine|contains:
            # You can add more permutation as you see fit
            - 'Get-Process lsas'
            - 'ps lsas'
            - 'gps lsas'
    condition: selection
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
PowerShell Get-Process LSASS in ScriptBlock
Detects a Get-Process command on lsass process, which is in almost all cases a sign of malicious activity
status test author Florian Roth (Nextron Systems) id 84c174ab-d3ef-481f-9c86-a50d0b8e3edb
panther query
def rule(event):
    if "Get-Process lsass" in event.deep_get("ScriptBlockText", default=""):
        return True
    return False
view Sigma YAML
title: PowerShell Get-Process LSASS in ScriptBlock
id: 84c174ab-d3ef-481f-9c86-a50d0b8e3edb
status: test
description: Detects a Get-Process command on lsass process, which is in almost all cases a sign of malicious activity
references:
    - https://web.archive.org/web/20220205033028/https://twitter.com/PythonResponder/status/1385064506049630211
author: Florian Roth (Nextron Systems)
date: 2021-04-23
modified: 2022-12-25
tags:
    - attack.credential-access
    - attack.t1003.001
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection:
        ScriptBlockText|contains: 'Get-Process lsass'
    condition: selection
falsepositives:
    - Legitimate certificate exports invoked by administrators or users (depends on processes in the environment - filter if unusable)
level: high
Convert to SIEM query
high
PowerShell Logging Disabled Via Registry Key Tampering
Detects changes to the registry for the currently logged-in user. In order to disable PowerShell module logging, script block logging or transcription and script execution logging
status test author frack113 id fecfd1a1-cc78-4313-a1ea-2ee2e8ec27a7
panther query
def rule(event):
    if all(
        [
            any(
                [
                    "\\Microsoft\\Windows\\PowerShell\\"
                    in event.deep_get("TargetObject", default=""),
                    "\\Microsoft\\PowerShellCore\\" in event.deep_get("TargetObject", default=""),
                ]
            ),
            any(
                [
                    event.deep_get("TargetObject", default="").endswith(
                        "\\ModuleLogging\\EnableModuleLogging"
                    ),
                    event.deep_get("TargetObject", default="").endswith(
                        "\\ScriptBlockLogging\\EnableScriptBlockLogging"
                    ),
                    event.deep_get("TargetObject", default="").endswith(
                        "\\ScriptBlockLogging\\EnableScriptBlockInvocationLogging"
                    ),
                    event.deep_get("TargetObject", default="").endswith(
                        "\\Transcription\\EnableTranscripting"
                    ),
                    event.deep_get("TargetObject", default="").endswith(
                        "\\Transcription\\EnableInvocationHeader"
                    ),
                    event.deep_get("TargetObject", default="").endswith("\\EnableScripts"),
                ]
            ),
            event.deep_get("Details", default="") == "DWORD (0x00000000)",
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Logging Disabled Via Registry Key Tampering
id: fecfd1a1-cc78-4313-a1ea-2ee2e8ec27a7
status: test
description: Detects changes to the registry for the currently logged-in user. In order to disable PowerShell module logging, script block logging or transcription and script execution logging
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1112/T1112.md#atomic-test-32---windows-powershell-logging-disabled
author: frack113
date: 2022-04-02
modified: 2023-08-17
tags:
    - attack.stealth
    - attack.defense-impairment
    - attack.t1564.001
    - attack.t1112
    - attack.persistence
logsource:
    category: registry_set
    product: windows
detection:
    selection:
        TargetObject|contains:
            - '\Microsoft\Windows\PowerShell\' # PowerShell 5
            - '\Microsoft\PowerShellCore\' # PowerShell 7
        TargetObject|endswith:
            - '\ModuleLogging\EnableModuleLogging'
            - '\ScriptBlockLogging\EnableScriptBlockLogging'
            - '\ScriptBlockLogging\EnableScriptBlockInvocationLogging'
            - '\Transcription\EnableTranscripting'
            - '\Transcription\EnableInvocationHeader'
            - '\EnableScripts'
        Details: 'DWORD (0x00000000)'
    condition: selection
falsepositives:
    - Unknown
level: high
regression_tests_path: regression_data/rules/windows/registry/registry_set/registry_set_powershell_logging_disabled/info.yml
simulation:
    - type: atomic-red-team
      name: Disable PowerShell Logging via Registry
      technique: T1112
      atomic_guid: 95b25212-91a7-42ff-9613-124aca6845a8
Convert to SIEM query
high
PowerShell PSAttack
Detects the use of PSAttack PowerShell hack tool
status test author Sean Metcalf (source), Florian Roth (Nextron Systems) id b7ec41a4-042c-4f31-a5db-d0fcde9fa5c5
panther query
def rule(event):
    if "PS ATTACK!!!" in event.deep_get("ScriptBlockText", default=""):
        return True
    return False
view Sigma YAML
title: PowerShell PSAttack
id: b7ec41a4-042c-4f31-a5db-d0fcde9fa5c5
status: test
description: Detects the use of PSAttack PowerShell hack tool
references:
    - https://adsecurity.org/?p=2921
author: Sean Metcalf (source), Florian Roth (Nextron Systems)
date: 2017-03-05
modified: 2022-12-25
tags:
    - attack.execution
    - attack.t1059.001
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection:
        ScriptBlockText|contains: 'PS ATTACK!!!'
    condition: selection
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
PowerShell SAM Copy
Detects suspicious PowerShell scripts accessing SAM hives
status test author Florian Roth (Nextron Systems) id 1af57a4b-460a-4738-9034-db68b880c665
panther query
def rule(event):
    if all(
        [
            "\\HarddiskVolumeShadowCopy" in event.deep_get("CommandLine", default=""),
            "System32\\config\\sam" in event.deep_get("CommandLine", default=""),
            any(
                [
                    "Copy-Item" in event.deep_get("CommandLine", default=""),
                    "cp $_." in event.deep_get("CommandLine", default=""),
                    "cpi $_." in event.deep_get("CommandLine", default=""),
                    "copy $_." in event.deep_get("CommandLine", default=""),
                    ".File]::Copy(" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell SAM Copy
id: 1af57a4b-460a-4738-9034-db68b880c665
status: test
description: Detects suspicious PowerShell scripts accessing SAM hives
references:
    - https://twitter.com/splinter_code/status/1420546784250769408
author: Florian Roth (Nextron Systems)
date: 2021-07-29
modified: 2023-01-06
tags:
    - attack.credential-access
    - attack.t1003.002
logsource:
    category: process_creation
    product: windows
detection:
    selection_1:
        CommandLine|contains|all:
            - '\HarddiskVolumeShadowCopy'
            - 'System32\config\sam'
    selection_2:
        CommandLine|contains:
            - 'Copy-Item'
            - 'cp $_.'
            - 'cpi $_.'
            - 'copy $_.'
            - '.File]::Copy('
    condition: all of selection*
falsepositives:
    - Some rare backup scenarios
    - PowerShell scripts fixing HiveNightmare / SeriousSAM ACLs
level: high
Convert to SIEM query
high
PowerShell Script Change Permission Via Set-Acl
Detects PowerShell execution to set the ACL of a file or a folder
status test author Nasreddine Bencherchali (Nextron Systems) id bdeb2cff-af74-4094-8426-724dc937f20a
panther query
def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("OriginalFileName", default="")
                    in ["PowerShell.EXE", "pwsh.dll"],
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\powershell.exe"),
                            event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                        ]
                    ),
                ]
            ),
            "Set-Acl " in event.deep_get("CommandLine", default=""),
            "-AclObject " in event.deep_get("CommandLine", default=""),
            "-Path " in event.deep_get("CommandLine", default=""),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Script Change Permission Via Set-Acl
id: bdeb2cff-af74-4094-8426-724dc937f20a
related:
    - id: cae80281-ef23-44c5-873b-fd48d2666f49 # PsScript Low
      type: derived
    - id: 0944e002-e3f6-4eb5-bf69-3a3067b53d73 # ProcCreation Susp
      type: derived
    - id: 3bf1d859-3a7e-44cb-8809-a99e066d3478 # PsScript High
      type: derived
status: test
description: Detects PowerShell execution to set the ACL of a file or a folder
references:
    - https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-acl?view=powershell-5.1
    - https://github.com/redcanaryco/atomic-red-team/blob/74438b0237d141ee9c99747976447dc884cb1a39/atomics/T1505.005/T1505.005.md
author: Nasreddine Bencherchali (Nextron Systems)
date: 2022-10-18
tags:
    - attack.stealth
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - OriginalFileName:
              - 'PowerShell.EXE'
              - 'pwsh.dll'
        - Image|endswith:
              - '\powershell.exe'
              - '\pwsh.exe'
    selection_cmdlet:
        CommandLine|contains|all:
            - 'Set-Acl '
            - '-AclObject '
            - '-Path '
    condition: all of selection_*
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
PowerShell Scripts Installed as Services
Detects powershell script installed as a Service
status test author oscd.community, Natalia Shornikova id a2e5019d-a658-4c6a-92bf-7197b54e2cae
panther query
def rule(event):
    if all(
        [
            event.deep_get("Provider_Name", default="") == "Service Control Manager",
            event.deep_get("EventID", default="") == 7045,
            any(
                [
                    "powershell" in event.deep_get("ImagePath", default=""),
                    "pwsh" in event.deep_get("ImagePath", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Scripts Installed as Services
id: a2e5019d-a658-4c6a-92bf-7197b54e2cae
status: test
description: Detects powershell script installed as a Service
references:
    - https://speakerdeck.com/heirhabarov/hunting-for-powershell-abuse
author: oscd.community, Natalia Shornikova
date: 2020-10-06
modified: 2022-12-25
tags:
    - attack.execution
    - attack.t1569.002
logsource:
    product: windows
    service: system
detection:
    selection:
        Provider_Name: 'Service Control Manager'
        EventID: 7045
        ImagePath|contains:
            - 'powershell'
            - 'pwsh'
    condition: selection
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
PowerShell Scripts Installed as Services - Security
Detects powershell script installed as a Service
status test author oscd.community, Natalia Shornikova id 2a926e6a-4b81-4011-8a96-e36cc8c04302
panther query
def rule(event):
    if all(
        [
            event.deep_get("EventID", default="") == 4697,
            any(
                [
                    "powershell" in event.deep_get("ServiceFileName", default=""),
                    "pwsh" in event.deep_get("ServiceFileName", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Scripts Installed as Services - Security
id: 2a926e6a-4b81-4011-8a96-e36cc8c04302
related:
    - id: a2e5019d-a658-4c6a-92bf-7197b54e2cae
      type: derived
status: test
description: Detects powershell script installed as a Service
references:
    - https://speakerdeck.com/heirhabarov/hunting-for-powershell-abuse
author: oscd.community, Natalia Shornikova
date: 2020-10-06
modified: 2022-11-29
tags:
    - attack.execution
    - attack.t1569.002
logsource:
    product: windows
    service: security
    definition: The 'System Security Extension' audit subcategory need to be enabled to log the EID 4697
detection:
    selection:
        EventID: 4697
        ServiceFileName|contains:
            - 'powershell'
            - 'pwsh'
    condition: selection
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
PowerShell Set-Acl On Windows Folder
Detects PowerShell scripts to set the ACL to a file in the Windows folder
status test author Nasreddine Bencherchali (Nextron Systems) id 0944e002-e3f6-4eb5-bf69-3a3067b53d73
panther query
def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("OriginalFileName", default="")
                    in ["PowerShell.EXE", "pwsh.dll"],
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\powershell.exe"),
                            event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                        ]
                    ),
                ]
            ),
            "Set-Acl " in event.deep_get("CommandLine", default=""),
            "-AclObject " in event.deep_get("CommandLine", default=""),
            any(
                [
                    '-Path "C:\\Windows' in event.deep_get("CommandLine", default=""),
                    "-Path 'C:\\Windows" in event.deep_get("CommandLine", default=""),
                    "-Path %windir%" in event.deep_get("CommandLine", default=""),
                    "-Path $env:windir" in event.deep_get("CommandLine", default=""),
                ]
            ),
            any(
                [
                    "FullControl" in event.deep_get("CommandLine", default=""),
                    "Allow" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Set-Acl On Windows Folder
id: 0944e002-e3f6-4eb5-bf69-3a3067b53d73 # ProcCreation Susp
related:
    - id: cae80281-ef23-44c5-873b-fd48d2666f49 # PsScript Low
      type: derived
    - id: bdeb2cff-af74-4094-8426-724dc937f20a # ProcCreation Low
      type: derived
    - id: 3bf1d859-3a7e-44cb-8809-a99e066d3478 # PsScript High
      type: derived
status: test
description: Detects PowerShell scripts to set the ACL to a file in the Windows folder
references:
    - https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-acl?view=powershell-5.1
    - https://github.com/redcanaryco/atomic-red-team/blob/74438b0237d141ee9c99747976447dc884cb1a39/atomics/T1505.005/T1505.005.md
author: Nasreddine Bencherchali (Nextron Systems)
date: 2022-10-18
tags:
    - attack.stealth
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - OriginalFileName:
              - 'PowerShell.EXE'
              - 'pwsh.dll'
        - Image|endswith:
              - '\powershell.exe'
              - '\pwsh.exe'
    selection_cmdlet:
        CommandLine|contains|all:
            - 'Set-Acl '
            - '-AclObject '
    selection_paths:
        # Note: Add more suspicious paths
        CommandLine|contains:
            - '-Path "C:\Windows'
            - "-Path 'C:\\Windows"
            - '-Path %windir%'
            - '-Path $env:windir'
    selection_permissions:
        # Note: Add more suspicious permissions
        CommandLine|contains:
            - 'FullControl'
            - 'Allow'
    condition: all of selection_*
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
PowerShell Set-Acl On Windows Folder - PsScript
Detects PowerShell scripts to set the ACL to a file in the Windows folder
status test author frack113, Nasreddine Bencherchali (Nextron Systems) id 3bf1d859-3a7e-44cb-8809-a99e066d3478
panther query
def rule(event):
    if all(
        [
            "Set-Acl " in event.deep_get("ScriptBlockText", default=""),
            "-AclObject " in event.deep_get("ScriptBlockText", default=""),
            any(
                [
                    '-Path "C:\\Windows' in event.deep_get("ScriptBlockText", default=""),
                    '-Path "C:/Windows' in event.deep_get("ScriptBlockText", default=""),
                    "-Path 'C:\\Windows" in event.deep_get("ScriptBlockText", default=""),
                    "-Path 'C:/Windows" in event.deep_get("ScriptBlockText", default=""),
                    "-Path C:\\Windows" in event.deep_get("ScriptBlockText", default=""),
                    "-Path C:/Windows" in event.deep_get("ScriptBlockText", default=""),
                    "-Path $env:windir" in event.deep_get("ScriptBlockText", default=""),
                    '-Path "$env:windir' in event.deep_get("ScriptBlockText", default=""),
                    "-Path '$env:windir" in event.deep_get("ScriptBlockText", default=""),
                ]
            ),
            any(
                [
                    "FullControl" in event.deep_get("ScriptBlockText", default=""),
                    "Allow" in event.deep_get("ScriptBlockText", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Set-Acl On Windows Folder - PsScript
id: 3bf1d859-3a7e-44cb-8809-a99e066d3478
related:
    - id: cae80281-ef23-44c5-873b-fd48d2666f49 # PsScript Low
      type: derived
    - id: 0944e002-e3f6-4eb5-bf69-3a3067b53d73 # ProcCreation Susp
      type: derived
    - id: bdeb2cff-af74-4094-8426-724dc937f20a # ProcCreation Low
      type: derived
status: test
description: Detects PowerShell scripts to set the ACL to a file in the Windows folder
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/74438b0237d141ee9c99747976447dc884cb1a39/atomics/T1505.005/T1505.005.md
    - https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-acl?view=powershell-5.1
author: frack113, Nasreddine Bencherchali (Nextron Systems)
date: 2023-07-18
tags:
    - attack.defense-impairment
    - attack.t1222
logsource:
    product: windows
    category: ps_script
    definition: bade5735-5ab0-4aa7-a642-a11be0e40872
detection:
    selection_cmdlet:
        ScriptBlockText|contains|all:
            - 'Set-Acl '
            - '-AclObject '
    selection_paths:
        # Note: Add more suspicious paths
        ScriptBlockText|contains:
            - '-Path "C:\Windows'
            - '-Path "C:/Windows'
            - "-Path 'C:\\Windows"
            - "-Path 'C:/Windows"
            - '-Path C:\\Windows'
            - '-Path C:/Windows'
            - '-Path $env:windir'
            - '-Path "$env:windir'
            - "-Path '$env:windir"
    selection_permissions:
        # Note: Add more suspicious permissions
        ScriptBlockText|contains:
            - 'FullControl'
            - 'Allow'
    condition: all of selection_*
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
PowerShell ShellCode
Detects Base64 encoded Shellcode
status test author David Ledbetter (shellcode), Florian Roth (Nextron Systems) id 16b37b70-6fcf-4814-a092-c36bd3aafcbd
panther query
def rule(event):
    if any(
        [
            "OiCAAAAYInlM" in event.deep_get("ScriptBlockText", default=""),
            "OiJAAAAYInlM" in event.deep_get("ScriptBlockText", default=""),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell ShellCode
id: 16b37b70-6fcf-4814-a092-c36bd3aafcbd
status: test
description: Detects Base64 encoded Shellcode
references:
    - https://twitter.com/cyb3rops/status/1063072865992523776
author: David Ledbetter (shellcode), Florian Roth (Nextron Systems)
date: 2018-11-17
modified: 2024-01-25
tags:
    - attack.privilege-escalation
    - attack.stealth
    - attack.t1055
    - attack.execution
    - attack.t1059.001
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection:
        ScriptBlockText|contains:
            - 'OiCAAAAYInlM'
            - 'OiJAAAAYInlM'
    condition: selection
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
PowerShell Web Access Feature Enabled Via DISM
Detects the use of DISM to enable the PowerShell Web Access feature, which could be used for remote access and potential abuse
status test author Michael Haag id 7e8f2d3b-9c1a-4f67-b9e8-8d9006e0e51f
panther query
def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\dism.exe"),
                    event.deep_get("OriginalFileName", default="") == "DISM.EXE",
                ]
            ),
            "WindowsPowerShellWebAccess" in event.deep_get("CommandLine", default=""),
            "/online" in event.deep_get("CommandLine", default=""),
            "/enable-feature" in event.deep_get("CommandLine", default=""),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Web Access Feature Enabled Via DISM
id: 7e8f2d3b-9c1a-4f67-b9e8-8d9006e0e51f
status: test
description: Detects the use of DISM to enable the PowerShell Web Access feature, which could be used for remote access and potential abuse
references:
    - https://docs.microsoft.com/en-us/powershell/module/dism/enable-windowsoptionalfeature
    - https://www.cisa.gov/news-events/cybersecurity-advisories/aa24-241a
    - https://gist.github.com/MHaggis/7e67b659af9148fa593cf2402edebb41
author: Michael Haag
date: 2024-09-03
tags:
    - attack.privilege-escalation
    - attack.persistence
    - attack.t1548.002
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\dism.exe'
        - OriginalFileName: 'DISM.EXE'
    selection_cli:
        CommandLine|contains|all:
            - 'WindowsPowerShellWebAccess'
            - '/online'
            - '/enable-feature'
    condition: all of selection_*
falsepositives:
    - Legitimate PowerShell Web Access installations by administrators
level: high
Convert to SIEM query
high
PowerShell Web Access Installation - PsScript
Detects the installation and configuration of PowerShell Web Access, which could be used for remote access and potential abuse
status test author Michael Haag id 5f9c7f1a-7c21-4c39-b2f3-8d8006e0e51f
panther query
def rule(event):
    if any(
        [
            "Install-WindowsFeature WindowsPowerShellWebAccess"
            in event.deep_get("ScriptBlockText", default=""),
            "Install-PswaWebApplication" in event.deep_get("ScriptBlockText", default=""),
            all(
                [
                    "Add-PswaAuthorizationRule" in event.deep_get("ScriptBlockText", default=""),
                    "-UserName " in event.deep_get("ScriptBlockText", default=""),
                    "-ComputerName " in event.deep_get("ScriptBlockText", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell Web Access Installation - PsScript
id: 5f9c7f1a-7c21-4c39-b2f3-8d8006e0e51f
status: test
description: Detects the installation and configuration of PowerShell Web Access, which could be used for remote access and potential abuse
references:
    - https://docs.microsoft.com/en-us/powershell/module/powershellwebaccess/install-pswawebapplication
    - https://www.cisa.gov/news-events/cybersecurity-advisories/aa24-241a
    - https://gist.github.com/MHaggis/7e67b659af9148fa593cf2402edebb41
author: Michael Haag
date: 2024-09-03
tags:
    - attack.persistence
    - attack.execution
    - attack.t1059.001
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection_install:
        ScriptBlockText|contains: 'Install-WindowsFeature WindowsPowerShellWebAccess'
    selection_config:
        ScriptBlockText|contains: 'Install-PswaWebApplication'
    selection_auth:
        ScriptBlockText|contains|all:
            - 'Add-PswaAuthorizationRule'
            - '-UserName *'
            - '-ComputerName *'
    condition: 1 of selection_*
falsepositives:
    - Legitimate PowerShell Web Access installations by administrators
level: high
Convert to SIEM query
high
PowerShell as a Service in Registry
Detects that a powershell code is written to the registry as a service.
status test author oscd.community, Natalia Shornikova id 4a5f5a5e-ac01-474b-9b4e-d61298c9df1d
panther query
def rule(event):
    if all(
        [
            "\\Services\\" in event.deep_get("TargetObject", default=""),
            event.deep_get("TargetObject", default="").endswith("\\ImagePath"),
            any(
                [
                    "powershell" in event.deep_get("Details", default=""),
                    "pwsh" in event.deep_get("Details", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerShell as a Service in Registry
id: 4a5f5a5e-ac01-474b-9b4e-d61298c9df1d
status: test
description: Detects that a powershell code is written to the registry as a service.
references:
    - https://speakerdeck.com/heirhabarov/hunting-for-powershell-abuse
author: oscd.community, Natalia Shornikova
date: 2020-10-06
modified: 2023-08-17
tags:
    - attack.execution
    - attack.t1569.002
logsource:
    category: registry_set
    product: windows
detection:
    selection:
        TargetObject|contains: '\Services\'
        TargetObject|endswith: '\ImagePath'
        Details|contains:
            - 'powershell'
            - 'pwsh'
    condition: selection
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
PowerView PowerShell Cmdlets - ScriptBlock
Detects Cmdlet names from PowerView of the PowerSploit exploitation framework.
status test author Bhabesh Raj id dcd74b95-3f36-4ed9-9598-0490951643aa
panther query
def rule(event):
    if any(
        [
            "Export-PowerViewCSV" in event.deep_get("ScriptBlockText", default=""),
            "Find-DomainLocalGroupMember" in event.deep_get("ScriptBlockText", default=""),
            "Find-DomainObjectPropertyOutlier" in event.deep_get("ScriptBlockText", default=""),
            "Find-DomainProcess" in event.deep_get("ScriptBlockText", default=""),
            "Find-DomainShare" in event.deep_get("ScriptBlockText", default=""),
            "Find-DomainUserEvent" in event.deep_get("ScriptBlockText", default=""),
            "Find-DomainUserLocation" in event.deep_get("ScriptBlockText", default=""),
            "Find-ForeignGroup" in event.deep_get("ScriptBlockText", default=""),
            "Find-ForeignUser" in event.deep_get("ScriptBlockText", default=""),
            "Find-GPOComputerAdmin" in event.deep_get("ScriptBlockText", default=""),
            "Find-GPOLocation" in event.deep_get("ScriptBlockText", default=""),
            "Find-InterestingDomain" in event.deep_get("ScriptBlockText", default=""),
            "Find-InterestingFile" in event.deep_get("ScriptBlockText", default=""),
            "Find-LocalAdminAccess" in event.deep_get("ScriptBlockText", default=""),
            "Find-ManagedSecurityGroups" in event.deep_get("ScriptBlockText", default=""),
            "Get-CachedRDPConnection" in event.deep_get("ScriptBlockText", default=""),
            "Get-DFSshare" in event.deep_get("ScriptBlockText", default=""),
            "Get-DomainDFSShare" in event.deep_get("ScriptBlockText", default=""),
            "Get-DomainDNSRecord" in event.deep_get("ScriptBlockText", default=""),
            "Get-DomainDNSZone" in event.deep_get("ScriptBlockText", default=""),
            "Get-DomainFileServer" in event.deep_get("ScriptBlockText", default=""),
            "Get-DomainGPOComputerLocalGroupMapping"
            in event.deep_get("ScriptBlockText", default=""),
            "Get-DomainGPOLocalGroup" in event.deep_get("ScriptBlockText", default=""),
            "Get-DomainGPOUserLocalGroupMapping" in event.deep_get("ScriptBlockText", default=""),
            "Get-LastLoggedOn" in event.deep_get("ScriptBlockText", default=""),
            "Get-LoggedOnLocal" in event.deep_get("ScriptBlockText", default=""),
            "Get-NetFileServer" in event.deep_get("ScriptBlockText", default=""),
            "Get-NetForest" in event.deep_get("ScriptBlockText", default=""),
            "Get-NetGPOGroup" in event.deep_get("ScriptBlockText", default=""),
            "Get-NetProcess" in event.deep_get("ScriptBlockText", default=""),
            "Get-NetRDPSession" in event.deep_get("ScriptBlockText", default=""),
            "Get-RegistryMountedDrive" in event.deep_get("ScriptBlockText", default=""),
            "Get-RegLoggedOn" in event.deep_get("ScriptBlockText", default=""),
            "Get-WMIRegCachedRDPConnection" in event.deep_get("ScriptBlockText", default=""),
            "Get-WMIRegLastLoggedOn" in event.deep_get("ScriptBlockText", default=""),
            "Get-WMIRegMountedDrive" in event.deep_get("ScriptBlockText", default=""),
            "Get-WMIRegProxy" in event.deep_get("ScriptBlockText", default=""),
            "Invoke-ACLScanner" in event.deep_get("ScriptBlockText", default=""),
            "Invoke-CheckLocalAdminAccess" in event.deep_get("ScriptBlockText", default=""),
            "Invoke-EnumerateLocalAdmin" in event.deep_get("ScriptBlockText", default=""),
            "Invoke-EventHunter" in event.deep_get("ScriptBlockText", default=""),
            "Invoke-FileFinder" in event.deep_get("ScriptBlockText", default=""),
            "Invoke-Kerberoast" in event.deep_get("ScriptBlockText", default=""),
            "Invoke-MapDomainTrust" in event.deep_get("ScriptBlockText", default=""),
            "Invoke-ProcessHunter" in event.deep_get("ScriptBlockText", default=""),
            "Invoke-RevertToSelf" in event.deep_get("ScriptBlockText", default=""),
            "Invoke-ShareFinder" in event.deep_get("ScriptBlockText", default=""),
            "Invoke-UserHunter" in event.deep_get("ScriptBlockText", default=""),
            "Invoke-UserImpersonation" in event.deep_get("ScriptBlockText", default=""),
            "Remove-RemoteConnection" in event.deep_get("ScriptBlockText", default=""),
            "Request-SPNTicket" in event.deep_get("ScriptBlockText", default=""),
            "Resolve-IPAddress" in event.deep_get("ScriptBlockText", default=""),
        ]
    ):
        return True
    return False
view Sigma YAML
title: PowerView PowerShell Cmdlets - ScriptBlock
id: dcd74b95-3f36-4ed9-9598-0490951643aa
related:
    - id: b2317cfa-4a47-4ead-b3ff-297438c0bc2d
      type: similar
status: test
description: Detects Cmdlet names from PowerView of the PowerSploit exploitation framework.
references:
    - https://powersploit.readthedocs.io/en/stable/Recon/README
    - https://github.com/PowerShellMafia/PowerSploit/tree/master/Recon
    - https://thedfirreport.com/2020/10/08/ryuks-return
    - https://adsecurity.org/?p=2277
author: Bhabesh Raj
date: 2021-05-18
modified: 2023-11-22
tags:
    - attack.execution
    - attack.t1059.001
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection:
        ScriptBlockText|contains:
            - 'Export-PowerViewCSV'
            - 'Find-DomainLocalGroupMember'
            - 'Find-DomainObjectPropertyOutlier'
            - 'Find-DomainProcess'
            - 'Find-DomainShare'
            - 'Find-DomainUserEvent'
            - 'Find-DomainUserLocation'
            - 'Find-ForeignGroup'
            - 'Find-ForeignUser'
            - 'Find-GPOComputerAdmin'
            - 'Find-GPOLocation'
            - 'Find-InterestingDomain' # Covers: Find-InterestingDomainAcl, Find-InterestingDomainShareFile
            - 'Find-InterestingFile'
            - 'Find-LocalAdminAccess'
            - 'Find-ManagedSecurityGroups'
            - 'Get-CachedRDPConnection'
            - 'Get-DFSshare'
            - 'Get-DomainDFSShare'
            - 'Get-DomainDNSRecord'
            - 'Get-DomainDNSZone'
            - 'Get-DomainFileServer'
            - 'Get-DomainGPOComputerLocalGroupMapping'
            - 'Get-DomainGPOLocalGroup'
            - 'Get-DomainGPOUserLocalGroupMapping'
            - 'Get-LastLoggedOn'
            - 'Get-LoggedOnLocal'
            - 'Get-NetFileServer'
            - 'Get-NetForest' # Covers: Get-NetForestCatalog, Get-NetForestDomain, Get-NetForestTrust
            - 'Get-NetGPOGroup'
            - 'Get-NetProcess'
            - 'Get-NetRDPSession'
            - 'Get-RegistryMountedDrive'
            - 'Get-RegLoggedOn'
            - 'Get-WMIRegCachedRDPConnection'
            - 'Get-WMIRegLastLoggedOn'
            - 'Get-WMIRegMountedDrive'
            - 'Get-WMIRegProxy'
            - 'Invoke-ACLScanner'
            - 'Invoke-CheckLocalAdminAccess'
            - 'Invoke-EnumerateLocalAdmin'
            - 'Invoke-EventHunter'
            - 'Invoke-FileFinder'
            - 'Invoke-Kerberoast'
            - 'Invoke-MapDomainTrust'
            - 'Invoke-ProcessHunter'
            - 'Invoke-RevertToSelf'
            - 'Invoke-ShareFinder'
            - 'Invoke-UserHunter'
            - 'Invoke-UserImpersonation'
            - 'Remove-RemoteConnection'
            - 'Request-SPNTicket'
            - 'Resolve-IPAddress'
            # - 'Get-ADObject'  # prone to FPs
            # - 'Get-Domain'  # too many FPs  # Covers Cmdlets like: DomainComputer, DomainController, DomainDFSShare, DomainDNSRecord, DomainGPO, etc.
            # - 'Add-DomainGroupMember'
            # - 'Add-DomainObjectAcl'
            # - 'Add-ObjectAcl'
            # - 'Add-RemoteConnection'
            # - 'Convert-ADName'
            # - 'Convert-NameToSid'
            # - 'ConvertFrom-UACValue'
            # - 'ConvertTo-SID'
            # - 'Get-DNSRecord'
            # - 'Get-DNSZone'
            # - 'Get-DomainComputer'
            # - 'Get-DomainController'
            # - 'Get-DomainGroup'
            # - 'Get-DomainGroupMember'
            # - 'Get-DomainManagedSecurityGroup'
            # - 'Get-DomainObject'
            # - 'Get-DomainObjectAcl'
            # - 'Get-DomainOU'
            # - 'Get-DomainPolicy'
            # - 'Get-DomainSID'
            # - 'Get-DomainSite'
            # - 'Get-DomainSPNTicket'
            # - 'Get-DomainSubnet'
            # - 'Get-DomainUser'
            # - 'Get-DomainUserEvent'
            # - 'Get-Forest' # Covers: Get-ForestDomain, Get-ForestGlobalCatalog, Get-ForestTrust
            # - 'Get-IPAddress'
            # - 'Get-NetComputer' # Covers: Get-NetComputerSiteName
            # - 'Get-NetDomain' # Covers: Get-NetDomainController, Get-NetDomainTrust
            # - 'Get-NetGroup' # Covers: Get-NetGroupMember
            # - 'Get-NetLocalGroup' # Covers: NetLocalGroupMember
            # - 'Get-NetLoggedon'
            # - 'Get-NetOU'
            # - 'Get-NetSession'
            # - 'Get-NetShare'
            # - 'Get-NetSite'
            # - 'Get-NetSubnet'
            # - 'Get-NetUser'
            # - 'Get-ObjectAcl'
            # - 'Get-PathAcl'
            # - 'Get-Proxy'
            # - 'Get-SiteName'
            # - 'Get-UserEvent'
            # - 'Get-WMIProcess'
            # - 'New-DomainGroup'
            # - 'New-DomainUser'
            # - 'Set-ADObject'
            # - 'Set-DomainObject'
            # - 'Set-DomainUserPassword'
            # - 'Test-AdminAccess'
    condition: selection
falsepositives:
    - Unknown
level: high
Convert to SIEM query
high
Powershell Add Name Resolution Policy Table Rule
Detects powershell scripts that adds a Name Resolution Policy Table (NRPT) rule for the specified namespace. This will bypass the default DNS server and uses a specified server for answering the query.
status test author Borna Talebi id 4368354e-1797-463c-bc39-a309effbe8d7
panther query
def rule(event):
    if all(
        [
            "Add-DnsClientNrptRule" in event.deep_get("ScriptBlockText", default=""),
            "-Namesp" in event.deep_get("ScriptBlockText", default=""),
            "-NameSe" in event.deep_get("ScriptBlockText", default=""),
        ]
    ):
        return True
    return False
view Sigma YAML
title: Powershell Add Name Resolution Policy Table Rule
id: 4368354e-1797-463c-bc39-a309effbe8d7
status: test
description: |
  Detects powershell scripts that adds a Name Resolution Policy Table (NRPT) rule for the specified namespace.
  This will bypass the default DNS server and uses a specified server for answering the query.
references:
    - https://twitter.com/NathanMcNulty/status/1569497348841287681
    - https://learn.microsoft.com/en-us/powershell/module/dnsclient/add-dnsclientnrptrule?view=windowsserver2022-ps
author: Borna Talebi
date: 2021-09-14
modified: 2022-10-09
tags:
    - attack.impact
    - attack.t1565
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection:
        ScriptBlockText|contains|all:
            - 'Add-DnsClientNrptRule'
            - '-Namesp'
            - '-NameSe'
    condition: selection
falsepositives:
    - Unknown
level: high
Convert to SIEM query
Showing 1201-1250 of 3,750