2

I created an answer file using Windows System Image Manager (SIM). I stored the password and set it to hidden, resulting in some form of hashed password.

Does anyone know what format this takes? I am hoping to be able to generate the password in a batch script and replace the value, filling it in at install time to a currently set password, but that depends on it being possible to generate.

Centimane
  • 176

1 Answers1

3

The password stored in the Sysprep XML file is not hashed. The string you see there is simply the unicode string encoded in Base64 and can easily be decoded using any web page or Powershell.

http://blog.compower.org/2013/08/05/recover-the-non-plain-password-from-your-unattend-xml/

(Example copied from page referenced above)

Copy the string after and past it in a file (pwd.txt) for example and copy it to your local machine with full Windows and Powershell. Then you can recover the password by doing the following:

PS>$encryptedpwd = get-content C:\temp\pwd.txt
PS>$encryptedpwd
VABoAGkAcwAgAG4AbwB0ACAAbQB5ACAAcgBlAGEAbAAgAFAAYQBzAHMAdwAwAHIAZAA=
PS>[System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String($encryptedpwd))
This not my real Passw0rd

The following page (again from the prior link) provides further details on working with Base64 string using powershell, and could be used as a starting point to figure out how to directly encode said passwords yourself:

http://tfl09.blogspot.nl/2013/02/working-with-base64-strings-in.html

That said, as it's not hashed or encrypted in any way, there's no real security benefit to doing so.

qasdfdsaq
  • 6,779