This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
metasploit [2019/09/23 20:39] acm [Finding Exploits] |
metasploit [2019/09/23 21:03] (current) acm [Running the Exploit] |
||
---|---|---|---|
Line 20: | Line 20: | ||
</ | </ | ||
+ | ==== Using Exploits ==== | ||
+ | |||
+ | To set this as the exploit that we want to use we just run the command | ||
+ | < | ||
+ | |||
+ | We know that it worked because the command prompt changes to show the exploit name in the prompt | ||
+ | < | ||
+ | |||
+ | Before we can run the exploit we need to set a few configuration details and we can see what they are by running | ||
+ | < | ||
+ | |||
+ | Metasploit responds by showing us exactly what info it needs as can be seen below | ||
+ | < | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | Exploit target: | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | The above tells us that we need to specify a host and a port for our target and it even gives us a description of the options that we need to enter. | ||
+ | < | ||
+ | If we were to run < | ||
+ | |||
+ | ==== Payloads ==== | ||
+ | If we think of an exploit as how we get in the door, then payloads are what we do once we are in the house. | ||
+ | < | ||
+ | Compatible Payloads | ||
+ | =================== | ||
+ | |||
+ | # | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | This is a unix interactive shell in the target computer. | ||
+ | < | ||
+ | Finally to make sure we have everything set we run < | ||
+ | |||
+ | ==== Running the Exploit ==== | ||
+ | |||
+ | Running the exploit once everything is set is as simple as running < | ||
+ | |||
+ | Which results in | ||
+ | < | ||
+ | [*] 192.168.0.108: | ||
+ | [*] 192.168.0.108: | ||
+ | [+] 192.168.0.108: | ||
+ | [+] 192.168.0.108: | ||
+ | [*] Found shell. | ||
+ | [*] Command shell session 1 opened (192.168.0.197: | ||
+ | |||
+ | whoami | ||
+ | root | ||
+ | </ | ||
+ | |||
+ | As can be seen above when we ran the whoami command we got root, meaning we know have a root shell on the target computer. | ||
+ | |||
+ | ==== Final Thoughts ==== | ||
+ | There is a ton more that can be done with Metasploit, and this is literally just the tip of the iceberg as far as functionality goes. There are scanners, reverse shells, the Meterpreter shell, and even ways to group your projects and credentials, |