Sigma rule: DSInternals Suspicious PowerShell Cmdlets - ScriptBlock

A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-e00dc5280bff, updated 2024-06-26T00:00:00.000Z.

Rule

Title
DSInternals Suspicious PowerShell Cmdlets - ScriptBlock
Status
test
Level
high
Author
Nasreddine Bencherchali (Nextron Systems)
Date
2024-06-26
File
rules/windows/powershell/powershell_script/posh_ps_dsinternals_cmdlets.yml
Commit
ccbb0369507f796db0b0ae6854c8a2be471b9d84

Detects execution and usage of the DSInternals PowerShell module. Which can be used to perform what might be considered as suspicious activity such as dumping DPAPI backup keys or manipulating NTDS.DIT files.
The DSInternals PowerShell Module exposes several internal features of Active Directory and Azure Active Directory. These include FIDO2 and NGC key auditing, offline ntds.dit file manipulation, password auditing, DC recovery from IFM backups and password hash calculation.

Log source

product
windows
category
ps_script
definition
Requirements: Script Block Logging must be enabled

Detection

selection:
    ScriptBlockText|contains:
        - 'Add-ADDBSidHistory'
        - 'Add-ADNgcKey'
        - 'Add-ADReplNgcKey'
        - 'ConvertFrom-ADManagedPasswordBlob'
        - 'ConvertFrom-GPPrefPassword'
        - 'ConvertFrom-ManagedPasswordBlob'
        - 'ConvertFrom-UnattendXmlPassword'
        - 'ConvertFrom-UnicodePassword'
        - 'ConvertTo-AADHash'
        - 'ConvertTo-GPPrefPassword'
        - 'ConvertTo-KerberosKey'
        - 'ConvertTo-LMHash'
        - 'ConvertTo-MsoPasswordHash'
        - 'ConvertTo-NTHash'
        - 'ConvertTo-OrgIdHash'
        - 'ConvertTo-UnicodePassword'
        - 'Disable-ADDBAccount'
        - 'Enable-ADDBAccount'
        - 'Get-ADDBAccount'
        - 'Get-ADDBBackupKey'
        - 'Get-ADDBDomainController'
        - 'Get-ADDBGroupManagedServiceAccount'
        - 'Get-ADDBKdsRootKey'
        - 'Get-ADDBSchemaAttribute'
        - 'Get-ADDBServiceAccount'
        - 'Get-ADDefaultPasswordPolicy'
        - 'Get-ADKeyCredential' # Covers 'Get-ADKeyCredentialLink'
        - 'Get-ADPasswordPolicy'
        - 'Get-ADReplAccount'
        - 'Get-ADReplBackupKey'
        - 'Get-ADReplicationAccount'
        - 'Get-ADSIAccount'
        - 'Get-AzureADUserEx'
        - 'Get-BootKey'
        - 'Get-KeyCredential'
        - 'Get-LsaBackupKey'
        - 'Get-LsaPolicy' # Covers 'Get-LsaPolicyInformation'
        - 'Get-SamPasswordPolicy'
        - 'Get-SysKey'
        - 'Get-SystemKey'
        - 'New-ADDBRestoreFromMediaScript'
        - 'New-ADKeyCredential' # Covers 'New-ADKeyCredentialLink'
        - 'New-ADNgcKey'
        - 'New-NTHashSet'
        - 'Remove-ADDBObject'
        - 'Save-DPAPIBlob'
        - 'Set-ADAccountPasswordHash'
        - 'Set-ADDBAccountPassword' # Covers 'Set-ADDBAccountPasswordHash'
        - 'Set-ADDBBootKey'
        - 'Set-ADDBDomainController'
        - 'Set-ADDBPrimaryGroup'
        - 'Set-ADDBSysKey'
        - 'Set-AzureADUserEx'
        - 'Set-LsaPolicy' # Covers 'Set-LSAPolicyInformation'
        - 'Set-SamAccountPasswordHash'
        - 'Set-WinUserPasswordHash'
        - 'Test-ADDBPasswordQuality'
        - 'Test-ADPasswordQuality'
        - 'Test-ADReplPasswordQuality'
        - 'Test-PasswordQuality'
        - 'Unlock-ADDBAccount'
        - 'Write-ADNgcKey'
        - 'Write-ADReplNgcKey'
condition: selection

False positives (as the rule lists them)

  • Legitimate usage of DSInternals for administration or audit purpose.

Tags

  • attack.execution
  • attack.t1059.001

MITRE ATT&CK ids this rule names

Related rules

References

Read on 2026-11-03T00:58:21.399Z under licence sigma-drl-1.1@d5f4c36a from https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/powershell/powershell_script/posh_ps_dsinternals_cmdlets.yml

Sources and licences

  • SigmaHQ

    "DSInternals Suspicious PowerShell Cmdlets - ScriptBlock" by Nasreddine Bencherchali (Nextron Systems) (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/powershell/powershell_script/posh_ps_dsinternals_cmdlets.yml.
    Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-License

    Detection Rule License (DRL) 1.1

Cite this page

Dragons Eye Ransomware Tracker, "Sigma rule: DSInternals Suspicious PowerShell Cmdlets - ScriptBlock",
entity page, dataset version ref-e00dc5280bff, updated 2024-06-26T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/846c7a87-8e14-4569-9d49-ecfd4276a01c (accessed 2026-11-03).
Underlying source: SigmaHQ rule 846c7a87-8e14-4569-9d49-ecfd4276a01c, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.

Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.