LoginSignup
1
0

[悪用厳禁]Windowsの応答ファイルに書かれたユーザーパスワードの復号化

Posted at

応答ファイルのパスワード復号

応答ファイルに記載されている暗号化されたユーザーパスワードが復号できないか調べていたところ、海外のサイトに手順の記載がありましたので、紹介します。

悪用厳禁です!!設定したパスワードを忘れて調べたいときに使用してください。

下記PowerShellにて復号可能となります。

$encryptedpassword="暗号化されたパスワード"
#復号化
$decryptedpassword=[system.text.encoding]::Unicode.GetString([system.convert]::Frombase64string($encryptedpassword))
#末尾Password除いて表示
write-host $decryptedpassword.subString(0,$decryptedpassword.length-8)

実行したところ、そのまま複合すると、末尾にPasswordが表示されてしまうため、
そこを除く必要があります。
.subString(0,$decryptedpassword.length-8)
にて除いています。

$encryptedpassword="cABhAHMAcwB3AG8AcgBkAFAAYQBzAHMAdwBvAHIAZAA="
#復号化
$decryptedpassword=[system.text.encoding]::Unicode.GetString([system.convert]::Frombase64string($encryptedpassword))
#末尾Password除いて表示
write-host $decryptedpassword.subString(0,$decryptedpassword.length-8)

実行結果

password

なお、AdministratorPasswordの方の場合は、
末尾にPasswordではなく、AdministratorPasswordが付与されてしまうので、
その際は、下記スクリプトにて復号可となります。

$encryptedpassword="暗号化されたAdministratorパスワード"
#復号化
$decryptedpassword=[system.text.encoding]::Unicode.GetString([system.convert]::Frombase64string($encryptedpassword))
#末尾Password除いて表示
write-host $decryptedpassword.subString(0,$decryptedpassword.length-21)

$encryptedpassword="cABhAHMAcwB3AG8AcgBkAEEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAUABhAHMAcwB3AG8AcgBkAA=="
#復号化
$decryptedpassword=[system.text.encoding]::Unicode.GetString([system.convert]::Frombase64string($encryptedpassword))
#末尾Password除いて表示
write-host $decryptedpassword.subString(0,$decryptedpassword.length-21)

実行結果

password
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0