🧪

Decrypting Secure Strings

<figure<img src="/files/wrmqIkRfph4Q3J4klGyT" alt=""<figcaption</figcaption</figure

#cool#adot8
source · oscp.adot8.com · cool/decrypting-secure-strings

Decrypting Secure Strings

<figure><img src="/files/wrmqIkRfph4Q3J4klGyT" alt=""><figcaption></figcaption></figure>
code
01echo "01000000d08c9ddf0115d1118c7a00c04fc2..." > cred.txt
02$pw = Get-Content cred.txt | ConvertTo-SecureString
03$bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pw)
04$UnsecurePassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($bstr)
05$UnsecurePassword

{% hint style="info" %} Should convert the secure string to plaintext {% endhint %}