Hack Win XP With MSF
Hack Win XP With MSF
Hack Win XP With MSF
Before exploiting the xp machine with metasploit it is a good idea to scan for open ports
using nmap to confirm that ports are accessible and accepting connections. Here is a quick
example
Check the port number 445. It is running the microsoft-ds samba service. This service is
used to share printers and files across the network. It is this service that is vulnerable to the
above mentioned exploit and would be hacked next using metasploit.
Exploit using metasploit
1. The exploit is quite easy to launch. Start msfconsole.
msf >
If you want to read information about the exploit then type 'info' and hit enter.
Exploit target:
Id Name
-- ----
0 Automatic Targeting
The important option to set is the RHOST (Remote Host). This is the ip address of the
victim machine that is running the vulnerable windows xp. In this example the ip address is
192.168.1.4
So set the option
Next comes the payload. Payload is that piece of code that runs along with the exploit and
provides the hacker with a reverse shell. We are going to use the windows meterpreter
payload. If you want to see all the available payloads then use the 'show payloads'
command.
Why meterpreter ? Because meterpreter is a very powerful kind of reverse shell that has
lots of functionality already built in. The functionality includes common post exploitation
tasks like scanning the target's network, hardware, accessing devices etc. Meterpreter can
also start a vnc session.
Now that we have selected out payload, its time to check the options once again.
Exploit target:
Id Name
-- ----
0 Automatic Targeting
Now the options also include the payload options. The important options to set are LHOST
and LPORT. The LHOST is the ip address of local machine or hacker machine. The LPORT
is the port number on which the reverse shell listener will receive the incoming shell.
meterpreter >
If it runs correctly you finally get the meterpreter shell. Type in help and hit enter to see what
commands are available.
Computer : ----------
Architecture : x86
meterpreter >
Interface 1
============
MTU : 1520
Interface 2
============
MTU : 1500
meterpreter >
It takes a few seconds, and then a window will popup with remote desktop on the vicitim
machine. Now you can use your mouse to interact with the victim desktop as if it were your
own.
Command Description
------- -----------
cd Change directory
ls List files
Channel 3 created.
C:\WINDOWS\system32>
Now its the windows command prompt. Play around it and when done, type 'exit' and press
enter. It will come back to the meterpreter session