Skip to content

Commit c3e1505

Browse files
committed
Update total_commander to use the new cred API
1 parent 74ea85f commit c3e1505

File tree

1 file changed

+33
-8
lines changed

1 file changed

+33
-8
lines changed

modules/post/windows/gather/credentials/total_commander.rb

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,32 @@ def check_other(filename)
120120
end
121121
end
122122

123+
def report_cred(opts)
124+
service_data = {
125+
address: opts[:ip],
126+
port: opts[:port],
127+
service_name: opts[:service_name],
128+
protocol: 'tcp',
129+
workspace_id: myworkspace_id
130+
}
131+
132+
credential_data = {
133+
post_reference_name: self.refname,
134+
session_id: session_db_id,
135+
origin_type: :session,
136+
private_data: opts[:password],
137+
private_type: :password,
138+
username: opts[:user]
139+
}.merge(service_data)
140+
141+
login_data = {
142+
core: create_credential(credential_data),
143+
status: Metasploit::Model::Login::Status::UNTRIED,
144+
}.merge(service_data)
145+
146+
create_credential_login(login_data)
147+
end
148+
123149
def get_ini(filename)
124150
config = client.fs.file.new(filename,'r')
125151
parse = config.read
@@ -142,14 +168,13 @@ def get_ini(filename)
142168
else
143169
source_id = nil
144170
end
145-
report_auth_info(
146-
:host => host,
147-
:port => port,
148-
:sname => 'ftp',
149-
:source_id => source_id,
150-
:source_type => "exploit",
151-
:user => username,
152-
:pass => passwd
171+
172+
report_cred(
173+
ip: host,
174+
port: port,
175+
service_name: 'ftp',
176+
user: username,
177+
password: passwd
153178
)
154179
end
155180
end

0 commit comments

Comments
 (0)