PowerShell Credential Prompt via PromptForCredential

Flags PowerShell scripts that reference "PromptForCredential", indicating credential prompt behavior in Script Block Logging.

FreeReviewedSigma · High · v2
Product
windows
Category
ps_script
Author
John Lambert (idea), Florian Roth (Nextron Systems) (SigmaHQ), DRL 1.1
Published
2017-04-09
Updated
2026-07-31
title: PowerShell Credential Prompt via PromptForCredential
id: a45b7afc-3500-4124-b5b4-4178f2ad6d72
status: test
description: This rule flags PowerShell script content that includes the credential prompt function call PromptForCredential. Adversaries can use credential prompts to capture or solicit user credentials during execution, making it a high-value behavior for credential-access detection. The detection relies on Windows PowerShell script block text telemetry that records the ScriptBlockText content. It matches when the script block text contains the exact substring PromptForCredential.
references:
  - https://twitter.com/JohnLaTwC/status/850381440629981184
  - https://t.co/ezOTGy1a1G
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_script/posh_ps_prompt_credentials.yml
author: John Lambert (idea), Florian Roth (Nextron Systems), Huntrule Team
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
license: DRL-1.1
related:
  - id: ca8b77a9-d499-4095-b793-5d5f330d450e
    type: derived