diff --git a/blue-team/windows/password_net.ps1 b/blue-team/windows/password_net.ps1 new file mode 100644 index 0000000..2e953d5 --- /dev/null +++ b/blue-team/windows/password_net.ps1 @@ -0,0 +1,14 @@ +# password scripting using net since Get-LocalUser is PS 5.1+ + +$users = (-Split ((Out-String -InputObject (net user)) -replace "The command completed successfully\.","" -replace "-*","" -replace "User accounts .*","")) +$template = Read-Host -Prompt "Template (prefix)" +$output = "12.csv" + +Clear-Content $output +foreach ($user in $users){ + # Write-Output $user + Add-Content $output $user","$template$user + net user $user $template$user +} +Get-Content $output +notepad.exe $output \ No newline at end of file