{"id":784,"date":"2015-02-22T19:24:14","date_gmt":"2015-02-22T19:24:14","guid":{"rendered":"https:\/\/www.hackmethod.com\/?p=784"},"modified":"2015-12-06T03:40:04","modified_gmt":"2015-12-06T03:40:04","slug":"hack-with-metasploit-exploitation","status":"publish","type":"post","link":"https:\/\/hackmethod.com\/hack-with-metasploit-exploitation\/","title":{"rendered":"Hack with Metasploit &#8211; Exploitation"},"content":{"rendered":"<p>If you have been following along with our <a href=\"https:\/\/www.hackmethod.com\/hacker-methodology\/\">Hacker Methodology series<\/a>\u00a0you&#8217;ll remember that conducting a hack on a target\u00a0is a logical process. So far we have <a href=\"https:\/\/www.hackmethod.com\/hack-methods-active-recon-nmap\/\" target=\"_blank\">completed recon<\/a>\u00a0of our target machine in our <a href=\"https:\/\/www.hackmethod.com\/building-hack-lab-free-part-1\/\" target=\"_blank\">hack lab<\/a>. Our next step in hacker methodology is the exploitation phase. This is the phase where we gain access to the target machine.<\/p>\n<p>We will go deeper into metasploit, its commands and its features a bit later, this is a brief overview combined with an example to get you thinking about some of the things that you can do.<\/p>\n<p><!--more--><\/p>\n<h1>What is an Exploit?<\/h1>\n<p>An exploit is designed to take advantage of a flaw or vulnerability in a computer system. To explain in other terms, exploitation would be similar to using a lock pick on a door to gain access to a house.<\/p>\n<p>Vulnerabilities within a system lie with poor coding, bugs, or misconfiguration. These are the points where hackers or pentesters try to drive a wedge into so they can gain access to a system. Zero-day exploits are exploits that are created that have not yet had a patch created to mitigate the vulnerability.<\/p>\n<p>Exploit development, especially zero-day&#8217;s are extremely difficult and expensive to create. You first find a flaw in a system, and then develop software to exploit it.\u00a0A lot of people mistakenly believe that the big hacks that are in the news are a result of a zero-day. Usually these hacks are due to system misconfigurations, phishing, or attacking non-updated systems. This is why keeping your system updated is the BEST thing you can do to harden your computer security.<\/p>\n<h1>Hacking With Metasploit<\/h1>\n<p>Metasploit is a hacking &#8220;framework&#8221; that was developed by <a href=\"http:\/\/en.wikipedia.org\/wiki\/H._D._Moore\" target=\"_blank\">HD Moore<\/a> in 2003. Metasploit is simply a repository of exploits that have been packaged to work with a common formatted syntax to exploit. Custom exploits can be written and added to metasploit to be used.<\/p>\n<p>Metasploit exploitation is a very simple concept. The structure of an exploit is essentially the exploit combined with a\u00a0payload. The exploit is what is used to leverage the vulnerability to gain access and the payload is what is &#8220;thrown&#8221; at the distant machine once the hole has been created. \u00a0A <a href=\"http:\/\/www.offensive-security.com\/metasploit-unleashed\/Meterpreter_Basics\" target=\"_blank\">meterpreter<\/a> shell or a root level shell on the target is often the goal as it will allow you privileges and functionality to do whatever you want. This could include data extraction, malware transfer, backdoor creation or lateral movement to another machine on the network.<\/p>\n<h1>Example<\/h1>\n<p>Earlier we <a href=\"https:\/\/www.hackmethod.com\/hack-methods-active-recon-nmap\/\" target=\"_blank\">conducted a scan<\/a> of a target machine in our <a href=\"https:\/\/www.hackmethod.com\/building-hack-lab-free-part-1\/\" target=\"_blank\">Hack Lab<\/a> and discovered several services open.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/02\/Capture1.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"707\" data-permalink=\"https:\/\/hackmethod.com\/hack-methods-active-recon-nmap\/capture-5\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/Capture1.png?fit=1018%2C631&amp;ssl=1\" data-orig-size=\"1018,631\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Capture\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/Capture1.png?fit=300%2C186&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/Capture1.png?fit=1018%2C631&amp;ssl=1\" class=\"aligncenter wp-image-707 size-full\" title=\"nmap scan\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/02\/Capture1.png?resize=1018%2C631&#038;ssl=1\" alt=\"Capture\" width=\"1018\" height=\"631\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/Capture1.png?w=1018&amp;ssl=1 1018w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/Capture1.png?resize=600%2C372&amp;ssl=1 600w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/Capture1.png?resize=300%2C186&amp;ssl=1 300w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/Capture1.png?resize=730%2C452&amp;ssl=1 730w\" sizes=\"(max-width: 1018px) 100vw, 1018px\" \/><\/a><\/p>\n<p>During our recon phase we took note of all the services running. We then\u00a0research each of those services further to see if they have any known vulnerabilities. This would include searching for <a href=\"https:\/\/cve.mitre.org\/\" target=\"_blank\">Common Vulnerabilities and Exposures (CVE&#8217;s)<\/a>\u00a0or searching <a href=\"http:\/\/www.exploit-db.com\/\" target=\"_blank\">Exploit-DB<\/a>. This is also the point where a very advanced and experienced hacker could begin to construct an exploit of their own.<\/p>\n<p>Taking the first service from the top I see a version number and the name of the service running. This information is crucial as we can now tailor our search to find more information about the specific version. Searching in Exploit-DB we find that there is already an <a href=\"http:\/\/www.exploit-db.com\/exploits\/17491\/\" target=\"_blank\">exploit written<\/a> and that it is a backdoor that was written into the source download file for vsftp.<\/p>\n<p>Moving over to our metasploit console lets check to see if the exploit has been entered into our database.<a href=\"http:\/\/www.offensive-security.com\/metasploit-unleashed\/Msfconsole_Commands#search\" target=\"_blank\"> Search commands<\/a> within metasploit are very useful as the database is very large.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/02\/msf1.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"791\" data-permalink=\"https:\/\/hackmethod.com\/hack-with-metasploit-exploitation\/msf1\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf1.png?fit=1006%2C364&amp;ssl=1\" data-orig-size=\"1006,364\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"msf1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf1.png?fit=300%2C109&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf1.png?fit=1006%2C364&amp;ssl=1\" class=\"alignnone size-full wp-image-791\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/02\/msf1.png?resize=1006%2C364&#038;ssl=1\" alt=\"metasploit\" width=\"1006\" height=\"364\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf1.png?w=1006&amp;ssl=1 1006w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf1.png?resize=600%2C217&amp;ssl=1 600w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf1.png?resize=300%2C109&amp;ssl=1 300w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf1.png?resize=730%2C264&amp;ssl=1 730w\" sizes=\"(max-width: 1006px) 100vw, 1006px\" \/><\/a><\/p>\n<p>As you can see, I searched for an exploit that held the name vsftp in the title. You can see that the\u00a0version number matches the version number in our nmap scan. By typing &#8220;info&#8221; with the exploit name I can see more information about the exploit.<a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/02\/msf3.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"793\" data-permalink=\"https:\/\/hackmethod.com\/hack-with-metasploit-exploitation\/msf3\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf3.png?fit=624%2C575&amp;ssl=1\" data-orig-size=\"624,575\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"msf3\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf3.png?fit=300%2C276&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf3.png?fit=624%2C575&amp;ssl=1\" class=\" size-full wp-image-793 aligncenter\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/02\/msf3.png?resize=624%2C575&#038;ssl=1\" alt=\"metasploit info\" width=\"624\" height=\"575\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf3.png?w=624&amp;ssl=1 624w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf3.png?resize=600%2C553&amp;ssl=1 600w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf3.png?resize=300%2C276&amp;ssl=1 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>Again, I&#8217;ll go into detail on metasploit commands and syntax more at a later time. This is an overview of the exploitation process.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/02\/msf2.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"792\" data-permalink=\"https:\/\/hackmethod.com\/hack-with-metasploit-exploitation\/msf2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf2.png?fit=1015%2C344&amp;ssl=1\" data-orig-size=\"1015,344\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"msf2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf2.png?fit=300%2C102&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf2.png?fit=1015%2C344&amp;ssl=1\" class=\"alignnone size-full wp-image-792\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/02\/msf2.png?resize=1015%2C344&#038;ssl=1\" alt=\"msf2\" width=\"1015\" height=\"344\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf2.png?w=1015&amp;ssl=1 1015w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf2.png?resize=600%2C203&amp;ssl=1 600w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf2.png?resize=300%2C102&amp;ssl=1 300w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf2.png?resize=730%2C247&amp;ssl=1 730w\" sizes=\"(max-width: 1015px) 100vw, 1015px\" \/><\/a><\/p>\n<p>To use the exploit we type the command &#8220;use&#8221; followed by the name of the exploit. This loads the exploit into our metasploit platform. By typing &#8220;show options&#8221; I can see what type of settings I need to set before launching this exploit. Usually this is mostly targeting information, IP address, port, OS type etc. Before we launch the exploit we need to select\u00a0a payload type. This is going to tell us how the target computer is going to communicate with us once we&#8217;ve leveraged the backdoor vulnerability. To do this we type &#8220;show payloads&#8221;<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/02\/msf4.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"794\" data-permalink=\"https:\/\/hackmethod.com\/hack-with-metasploit-exploitation\/msf4\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf4.png?fit=894%2C197&amp;ssl=1\" data-orig-size=\"894,197\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"msf4\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf4.png?fit=300%2C66&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf4.png?fit=894%2C197&amp;ssl=1\" class=\"alignnone wp-image-794 size-full\" title=\"hack\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/02\/msf4.png?resize=894%2C197&#038;ssl=1\" alt=\"show payloads\" width=\"894\" height=\"197\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf4.png?w=894&amp;ssl=1 894w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf4.png?resize=600%2C132&amp;ssl=1 600w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf4.png?resize=300%2C66&amp;ssl=1 300w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf4.png?resize=730%2C161&amp;ssl=1 730w\" sizes=\"(max-width: 894px) 100vw, 894px\" \/><\/a>In this case there is only one payload for us to chose from and so we combine it with our exploit by typing &#8220;set payload&#8221; followed by the name. Now when we type &#8220;show options&#8221; we&#8217;ll see options for both the exploit and the payload.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/02\/msf5.1.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"797\" data-permalink=\"https:\/\/hackmethod.com\/hack-with-metasploit-exploitation\/msf5-1\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf5.1.png?fit=588%2C473&amp;ssl=1\" data-orig-size=\"588,473\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"msf5.1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf5.1.png?fit=300%2C241&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf5.1.png?fit=588%2C473&amp;ssl=1\" class=\"aligncenter wp-image-797 size-full\" title=\"show options\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/02\/msf5.1.png?resize=588%2C473&#038;ssl=1\" alt=\"set payload\" width=\"588\" height=\"473\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf5.1.png?w=588&amp;ssl=1 588w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf5.1.png?resize=300%2C241&amp;ssl=1 300w\" sizes=\"(max-width: 588px) 100vw, 588px\" \/><\/a>As you can see the only setting we really need to put in here is the IP address of our target. To do that we type &#8220;set RHOST&#8221; followed by the IP address and then we check our options again to verify the settings are correct.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/02\/msf5.2.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"798\" data-permalink=\"https:\/\/hackmethod.com\/hack-with-metasploit-exploitation\/msf5-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf5.2.png?fit=550%2C470&amp;ssl=1\" data-orig-size=\"550,470\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"msf5.2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf5.2.png?fit=300%2C256&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf5.2.png?fit=550%2C470&amp;ssl=1\" class=\" size-full wp-image-798 aligncenter\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/02\/msf5.2.png?resize=550%2C470&#038;ssl=1\" alt=\"set rhost\" width=\"550\" height=\"470\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf5.2.png?w=550&amp;ssl=1 550w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf5.2.png?resize=300%2C256&amp;ssl=1 300w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a>Now all we have to do is type &#8220;exploit&#8221; to launch the\u00a0packaged up exploit and payload against the target.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/02\/msf6.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"799\" data-permalink=\"https:\/\/hackmethod.com\/hack-with-metasploit-exploitation\/msf6\/\" data-orig-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf6.png?fit=990%2C294&amp;ssl=1\" data-orig-size=\"990,294\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"msf6\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf6.png?fit=300%2C89&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf6.png?fit=990%2C294&amp;ssl=1\" class=\"aligncenter wp-image-799 size-full\" title=\"hack\" src=\"https:\/\/i0.wp.com\/www.hackmethod.com\/wp-content\/uploads\/2015\/02\/msf6.png?resize=990%2C294&#038;ssl=1\" alt=\"exploit\" width=\"990\" height=\"294\" srcset=\"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf6.png?w=990&amp;ssl=1 990w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf6.png?resize=600%2C178&amp;ssl=1 600w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf6.png?resize=300%2C89&amp;ssl=1 300w, https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf6.png?resize=730%2C217&amp;ssl=1 730w\" sizes=\"(max-width: 990px) 100vw, 990px\" \/><\/a>Success! As you can see our exploit spawned the backdoor against the vsftp service and granted us a command shell session. Once inside I want to verify where I am and who I am logged in with, which I do so with the hostname and whoami commands. As you can see I&#8217;m in my metasploitable VM as root. Now I can set up backdoors to sustain persistence, extract information or do recon on further nodes\/hosts within the network.<\/p>\n<h1>Conclusion<\/h1>\n<p>As we discussed exploitation is simply leveraging a vulnerability in order to gain access to a target. In order to illustrate this I&#8217;ve used metasploit to show you how an exploit can be used. Is metasploit the only way to use an exploit? No, absolutely not. It&#8217;s just a framework that CAN be used to simplify the process. I urge you to follow this process in your own <a href=\"https:\/\/www.hackmethod.com\/building-hack-lab-free-part-1\/\" target=\"_blank\">Hack Lab<\/a>\u00a0for the other services to see other ways you can possibly exploit the metasploitable VM.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have been following along with our Hacker Methodology series\u00a0you&#8217;ll remember that conducting a hack on a target\u00a0is a logical process. So far we have completed recon\u00a0of our target machine in our hack lab. Our next step in hacker methodology is the exploitation phase. This is the phase where we gain access to the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":791,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[52,63,68,49],"tags":[61,53,56,62,46],"class_list":["post-784","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hacking","category-security","category-tools","category-tutorials","tag-exploitation","tag-hacking","tag-hacklab","tag-metasploit","tag-tutorials"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/hackmethod.com\/wp-content\/uploads\/2015\/02\/msf1.png?fit=1006%2C364&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5zY4D-cE","_links":{"self":[{"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/posts\/784","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/comments?post=784"}],"version-history":[{"count":7,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/posts\/784\/revisions"}],"predecessor-version":[{"id":803,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/posts\/784\/revisions\/803"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/media\/791"}],"wp:attachment":[{"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/media?parent=784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/categories?post=784"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hackmethod.com\/wp-json\/wp\/v2\/tags?post=784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}