[Metasploit]Upgrade Normal Shell To Meterpreter Shell

Binamra Pandey
InfoSec Write-ups
Published in
3 min readSep 16, 2021

--

After we got access to the machine, sometimes we get Meterpreter Shell immediately after exploitation. Meterpreter Shell offers the easiest ways to do some stuff in the compromised machine so, we want to get this Shell instead of Command Shell but most of the time after we exploit the machine we land into Command Shell. In this case, we want to upgrade our shell to Meterpreter Shell.

Steps To Upgrade Normal Command Shell ===> Meterpreter Shell

In this case, after the machine is exploited, we landed into the Normal command shell.

Step 1: Background the current(Normal Shell) session, we can do this by pressing CTRL+Z

Step 2: Now Run the following command “search shell_to_meterpreter”.

And use the module that is shown on the screen.

Step 3: Use the shown module by following the command
use post/multi/manage/shell_to_meterpreter” or by simply typing
use 0”. Any of the two commands will work.

Step 4: Now we have to configure which Session shell to upgrade. We can see the Session by running the following command i.e “sessions -l”. Id=Session-Number

Step 5: We can see the Options, by using the “show options” command.

Step 6: Set the session-id according to your session. We can use the following command to configure the session i.e “set SESSION <id-of session>” in my case “set SESSION 1”.

Step 7: After you configure your session, it’s time to execute it. We can execute by simply giving the following command → “run

After you enter the run command, another new session will open.

After the new session opened select the session and execute that session.

New Session 2

Step 8: Now execute the new session by running the following command “session -i <New-meterpeter-session>” in my case, it’s “session -i 2

After you run the last command, you will get meterpreter shell.

In this way, you can upgrade the normal command shell to meterpreter shell.

If you like my writeup then follow me on Twitter:- @Binamra Pandey

Thank You

--

--