From 606411de81b253c96e41092c2f23398d8f7f5397 Mon Sep 17 00:00:00 2001 From: OJ Date: Tue, 29 Oct 2013 15:13:32 +1000 Subject: [PATCH] Fix mimikatz error when password is nil In some cases the password value that comes out of mimikatz results is `nil`, instead of an empty string. This fixes this so that if the string is `nil` is falls back to an empty string, resulting in the call to `gsub` working instead of failing. --- .../post/meterpreter/ui/console/command_dispatcher/mimikatz.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rex/post/meterpreter/ui/console/command_dispatcher/mimikatz.rb b/lib/rex/post/meterpreter/ui/console/command_dispatcher/mimikatz.rb index a16f0543be..9ecdaddd51 100644 --- a/lib/rex/post/meterpreter/ui/console/command_dispatcher/mimikatz.rb +++ b/lib/rex/post/meterpreter/ui/console/command_dispatcher/mimikatz.rb @@ -106,7 +106,7 @@ class Console::CommandDispatcher::Mimikatz ) accounts.each do |acc| - table << [acc[:authid], acc[:package], acc[:domain], acc[:user], acc[:password].gsub("\n","")] + table << [acc[:authid], acc[:package], acc[:domain], acc[:user], (acc[:password] || "").gsub("\n","")] end print_line table.to_s