costi0n

Untitled

Jul 24th, 2021
1,110
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $cred = Import-Clixml $crdXML
  2.  
  3. $uname = $cred.UserName
  4. $passwd = $cred.Password | ConvertFrom-SecureString
  5.  
  6. $SecureString = $cred.Password
  7.  
  8. $Pointer = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString)
  9. $SecretContent = [Runtime.InteropServices.Marshal]::PtrToStringAuto($Pointer)
  10.  
  11. Write-Host("Username : $($uname)")
  12. Write-Host("Secure String Password: $($passwd)")
  13. Write-Host("Decrypted Passwrod: $($SecretContent)")
RAW Paste Data