Land #2158 - Fix NoMethodError undefined method `split' for nil:NilClass

bug/bundler_fix
sinn3r 2013-10-22 16:01:27 -05:00
commit ee95ca5e2b
No known key found for this signature in database
GPG Key ID: 2384DB4EF06F730B
1 changed files with 7 additions and 0 deletions

View File

@ -67,11 +67,18 @@ class Mimikatz < Extension
def parse_ssp_result(result) def parse_ssp_result(result)
details = CSV.parse(result) details = CSV.parse(result)
accounts = [] accounts = []
return accounts unless details
details.each do |acc| details.each do |acc|
next unless acc.length == 5
ssps = acc[4].split(' }') ssps = acc[4].split(' }')
next unless ssps
ssps.each do |ssp| ssps.each do |ssp|
next unless ssp
s_acc = ssp.split(' ; ') s_acc = ssp.split(' ; ')
next unless s_acc
user = s_acc[0].split('{ ')[1] user = s_acc[0].split('{ ')[1]
next unless user
account = { account = {
:authid => acc[0], :authid => acc[0],
:package => acc[1], :package => acc[1],