Skip to content

Commit 744baf2

Browse files
committed
Update kloxo_sqli to use the new cred API
1 parent 4ee0a14 commit 744baf2

File tree

1 file changed

+32
-7
lines changed

1 file changed

+32
-7
lines changed

modules/exploits/linux/http/kloxo_sqli.rb

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,32 @@ 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::UNTRIED,
97+
}.merge(service_data)
98+
99+
create_credential_login(login_data)
100+
end
101+
76102
def check
77103
return Exploit::CheckCode::Safe unless webcommand_exists?
78104
return Exploit::CheckCode::Safe if exploit_sqli(1, bad_char(0))
@@ -94,13 +120,12 @@ def exploit
94120
@session = send_login
95121
fail_with(Failure::NoAccess, "#{peer} - Login with admin/#{@password} failed...") if @session.nil?
96122

97-
report_auth_info(
98-
:host => rhost,
99-
:port => rport,
100-
:user => 'admin',
101-
:pass => @password,
102-
:type => 'password',
103-
:sname => (ssl ? 'https' : 'http')
123+
report_cred(
124+
ip: rhost,
125+
port: rport,
126+
user: 'admin',
127+
service_name: 'http',
128+
password: @password
104129
)
105130

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

0 commit comments

Comments
 (0)