Skip to content

Commit 606411d

Browse files
committed
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.
1 parent 87dc581 commit 606411d

File tree

1 file changed

+1
-1
lines changed
  • lib/rex/post/meterpreter/ui/console/command_dispatcher

1 file changed

+1
-1
lines changed

lib/rex/post/meterpreter/ui/console/command_dispatcher/mimikatz.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def mimikatz_request(provider, method)
106106
)
107107

108108
accounts.each do |acc|
109-
table << [acc[:authid], acc[:package], acc[:domain], acc[:user], acc[:password].gsub("\n","")]
109+
table << [acc[:authid], acc[:package], acc[:domain], acc[:user], (acc[:password] || "").gsub("\n","")]
110110
end
111111

112112
print_line table.to_s

0 commit comments

Comments
 (0)