From d8200c65a842257bdb2bb5631d81270b2c58c10b Mon Sep 17 00:00:00 2001 From: Tod Beardsley Date: Tue, 27 Jan 2015 11:06:55 -0600 Subject: [PATCH] Strip safely, avoid nil.strip errors --- modules/post/multi/gather/rubygems_api_key.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/post/multi/gather/rubygems_api_key.rb b/modules/post/multi/gather/rubygems_api_key.rb index 167aa78b34..deb2473c54 100644 --- a/modules/post/multi/gather/rubygems_api_key.rb +++ b/modules/post/multi/gather/rubygems_api_key.rb @@ -48,7 +48,7 @@ class Metasploit4 < Msf::Post def extract_key(path) data = read_file(path) keys = data.split(':').select { |k| k =~ /[0-9a-f]{32}/ } - keys.first.strip + keys.map {|k| k.strip}.first end def download_key(paths)