Skip to content

Commit c95b3bb

Browse files
committed
Land rapid7#5479, @wchen-r7 Updates kloxo_sqli to use the new cred API
2 parents 1c357e6 + c2f0973 commit c95b3bb

File tree

1 file changed

+34
-7
lines changed

1 file changed

+34
-7
lines changed

modules/exploits/linux/http/kloxo_sqli.rb

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,33 @@ def initialize(info = {})
7373
], self.class)
7474
end
7575

76+
def report_cred(opts)
77+
service_data = {
78+
address: opts[:ip],
79+
port: opts[:port],
80+
service_name: opts[:service_name],
81+
protocol: 'tcp',
82+
workspace_id: myworkspace_id
83+
}
84+
85+
credential_data = {
86+
module_fullname: fullname,
87+
post_reference_name: self.refname,
88+
private_data: opts[:password],
89+
origin_type: :service,
90+
private_type: :password,
91+
username: opts[:user]
92+
}.merge(service_data)
93+
94+
login_data = {
95+
core: create_credential(credential_data),
96+
status: Metasploit::Model::Login::Status::SUCCESSFUL,
97+
last_attempted_at: opts[:attempt_time]
98+
}.merge(service_data)
99+
100+
create_credential_login(login_data)
101+
end
102+
76103
def check
77104
return Exploit::CheckCode::Safe unless webcommand_exists?
78105
return Exploit::CheckCode::Safe if exploit_sqli(1, bad_char(0))
@@ -94,13 +121,13 @@ def exploit
94121
@session = send_login
95122
fail_with(Failure::NoAccess, "#{peer} - Login with admin/#{@password} failed...") if @session.nil?
96123

97-
report_auth_info(
98-
:host => rhost,
99-
:port => rport,
100-
:user => 'admin',
101-
:pass => @password,
102-
:type => 'password',
103-
:sname => (ssl ? 'https' : 'http')
124+
report_cred(
125+
ip: rhost,
126+
port: rport,
127+
user: 'admin',
128+
service_name: 'http',
129+
password: @password,
130+
attempt_time: DateTime.now
104131
)
105132

106133
print_status("#{peer} - Retrieving the server name...")

0 commit comments

Comments
 (0)