8888888b. 8888888b. d8b 888 "Y88b 888 Y88b Y8P 888 888 888 888 888 888 8888b. 888d888 888d888 .d88b. 88888b. 888 d88P 8888b. 888 88888b. .d88b. 888 888 888 888 "88b 888P" 888P" d8P Y8b 888 "88b 8888888P" "88b 888 888 "88b d8P Y8b 888 888 888 888 .d888888 888 888 88888888 888 888 888 T88b .d888888 888 888 888 88888888 888 888 888 .d88P 888 888 888 888 Y8b. 888 888 888 T88b 888 888 888 888 888 Y8b. Y88b 888 8888888P" "Y888888 888 888 "Y8888 888 888 888 T88b "Y888888 888 888 888 "Y8888 "Y88888 888 Y8b d88P "Y88P" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Load up metasploit- Set LPORT
Set LHOST
Set payload/windows/shell/reverse_tcp
Exploit - Ok so now you should be able to run your reverse shell on the victim machine and get a shell with metasploit but we want to upgrade this so now we do this :
- Press CTRL + Z to background the session
- Type sessions --list to get your current sessions if you have more than one
- Run sessions -u [ID] eg. sessions -u 1.
When you are doing a pentest or other LEGAL system exploitation you will ussaly want to avoid detection one of the best ways is to create a reverse shell using built it system commands such as netcat on linux or a powershell script on windows this allows you to use the system native functions to get access and avoid downloading programs onto the target system but somethings you want more than just a shell well thats where metasploit comes in. Metasploit's meterperter payload lets you do allot more than just standard windows commands with meterperter you can do stuff like keylogging, taking pictures, recording microphones and a whole lot more but you don't want to just create a metasploit binary and run that on the target machine as that will likely get detected by the antivirus so the solotion is to use the following steps to upgrade your reverse shell to a full meterpeter session :
So now you should be able to use sessions -i [ID] to reconnect to your shell now with meterperter commands.