From 8a705c9223788890790621be5726e4895d04cad9 Mon Sep 17 00:00:00 2001 From: sinn3r Date: Sat, 24 Dec 2011 15:06:43 -0600 Subject: [PATCH] Fix bug #6158 - session.db_record might return nil but wasn't checked --- .../post/windows/gather/credentials/credential_collector.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/post/windows/gather/credentials/credential_collector.rb b/modules/post/windows/gather/credentials/credential_collector.rb index 183943bb1e..e39270bfbb 100644 --- a/modules/post/windows/gather/credentials/credential_collector.rb +++ b/modules/post/windows/gather/credentials/credential_collector.rb @@ -55,6 +55,7 @@ class Metasploit3 < Msf::Post # Record hashes to the running db instance print_good "Collecting hashes..." + hashes.each do |hash| data = {} data[:host] = addr @@ -63,7 +64,9 @@ class Metasploit3 < Msf::Post data[:user] = hash.user_name data[:pass] = hash.lanman + ":" + hash.ntlm data[:type] = "smb_hash" - data[:source_id] = session.db_record.id, + if not session.db_record.nil? + data[:source_id] = session.db_record.id + end data[:source_type] = "exploit", data[:active] = true