# Oncle Sam

### Découverte des fichiers

Il y a deux fichiers de registre windows dispo :&#x20;

{% file src="/files/YDKLDiHe3omNRvkkV2kV" %}

{% file src="/files/BEjrTONUFk4KpYJ8WHPZ" %}

{% hint style="info" %}
**The Security Account Manager (SAM) is a registry file for Windows XP, Windows Vista, Windows 7, 8.1 and 10 that stores local user's account passwords**.
{% endhint %}

```
file *
sam.save:    MS Windows registry file, NT/2000 or above
system.save: MS Windows registry file, NT/2000 or above
```

Il existe une technique pour extraire les hash NTLM des utilisateurs lorsque l'on a ces deux registres.

### Extractions des hashs

On commence par extraire les hashs des utilisateurs du systèmes via impacket.

```
┌──(kali㉿kali)-[~/Desktop/challenge_sam_password]
└─$ impacket-secretsdump -sam sam.save -system system.save LOCAL
Impacket v0.9.24 - Copyright 2021 SecureAuth Corporation

[*] Target system bootKey: 0x97d0590046fc16af953068aeb5931f6b
[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)
Administrateur:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
Invité:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
WDAGUtilityAccount:504:aad3b435b51404eeaad3b435b51404ee:36bdb0f8f08dddcb87d4942ee013c49b:::
apssis:1002:aad3b435b51404eeaad3b435b51404ee:c2063e596b98a1a61959976c52702ba4:::
[*] Cleaning up...
```

{% embed url="<https://github.com/SecureAuthCorp/impacket>" %}

Je casse le hash NTLM de l'utilisateur apssis sur crackstation :&#x20;

![](/files/MEnywMIJfRZrauYvgV9y)

Le mot de passe de l'utilisateur apssis est "papanoel".


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.onosh.ovh/ctf/cnssis2022/oncle-sam.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
