Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/documentation/modules/post/windows/gather/memory_dump.md
Views: 11789
Vulnerable Application
This module dumps the memory for any process on the system and retrieves it for later analysis. The user must have sufficient permissions to read the memory of that process. Low-privilege users should be able to read any of their own processes. High-privilege users should be able to read any unprotected process.
This module only works on a Meterpreter session on Windows.
Verification Steps
Start
msfconsole
Get meterpreter session on a Windows host
Do:
use post/windows/gather/memory_dump
Do:
set SESSION <session id>
Do:
set PID <process id>
orset PROCESS_NAME <process name>
Do:
set DUMP_PATH <path on remote system>
Do:
set DUMP_TYPE <standard|full>
Do:
run
You should be able to see that the module has dumped the process to a file and starts downloading it.
You should be able to see, whether the module succeeds or fails, that the file on the remote system has been deleted.
Options
DUMP_PATH
The path that the memory dump will be temporarily stored at. This file is then downloaded and deleted at the end of the run. This file should be in a writable location, and should not already exist. If not specified, the dump is written with a random filename in %TEMP%
.
PID
The ID of the process to dump. To find the PID, in your Meterpreter session, type ps
. To find a process by name, type ps | <process name>
.
PROCESS_NAME
The name of the process(es) to dump. This will dump memory for all processes with this name.
DUMP_TYPE
Two options are provided for creating a memory dump:
Full
This option retrieves the entire memory address space, including all DLLs, EXEs and memory mapped files. For dumping LSASS for offline analysis, this option seems to be preferable. However, the file size can be significantly larger than the Standard option.
Standard
This option retrieves most data from the process, with the exception of DLLs, EXEs and memory mapped files. As a result, some analysis tools may have trouble with automated analysis, however any sensitive information such as passwords which are stored in memory should be part of this dump. This data could possibly be retrieved using a tool such as strings
. The file size should be significantly smaller than the Full option.
Scenarios
Dumping lsass
Retrieving lsass (after getsystem)
Then in mimikatz (offline):