Let’s move on to second step to upgrade the normal command shell into meterpreter shell. We see here that our all options have been set up for us, so let’s try to exploit by typing “ run” command and launch the attack.Īs you can see that, one command shell session has been opened but we can’t run all the commands against the target due to limited shell access. Note: Meterpreter Reverse TCP payload will not work due to non-compatibility. Here, in this scenario, we’ll use the following payload:
Now as you see that, we need to set the RHOST which is the target address (IP address of Metasploitable2 VM Machine).įurthermore, to view all payloads list, you can type “ show payloads” command which lists out all the available related payloads. Type “ show options” to view more options about the exploit. To use this exploit, type the following command:Ĭommand: use exploit/multi/samba/usermap_script No authentication is needed to exploit this vulnerability since this option is used to map usernames prior to authentication! By specifying a username containing shell meta characters, attackers can execute arbitrary commands. This module exploits a command execution vulnerability in Samba versions 3.0.20 through 3.0.25rc3 when using the non-default “ username map script” configuration option. Let’s start by finding the exploit as shown below:Īs you can see that, we got a lot of results and the exploit which we’ll be using against metasploitable is usermap_script exploit. Start the metasploit framework by typing “ msfconsole” in your terminal. So many companies are implementing this service in order to allow their users to transfer files. The main advantage of Samba is that makes the file sharing between different systems an easy process for system administrators. In metasploitable2, we’ll be using a samba exploit against our victim in order to gain a UNIX command shell access. To demonstrate the same, we are using Metasploitable2 VM machine as a target and Kali Linux machine as an attacker machine. As a result, Meterpreter resides entirely in memory and writes nothing to disk. Meterpreter is deployed using in-memory DLL injection. Meterpreter is a Metasploit attack payload that provides an interactive shell from which an attacker can explore the target machine and execute code. One of the best feature of Metasploit Framework is that you can easily upgrade your normal command shell payload into Meterpreter payload once the system has been exploited. The Metasploit Framework contains a suite of tools that you can use to test security vulnerabilities, enumerate networks, execute attacks, and evade detection.