@@ -527,9 +527,8 @@ def smb_get_hash(smb, arg = {}, esn=true)
527
527
end
528
528
529
529
print_status ( capturelogmessage )
530
-
531
- lm_text = lm_hash + lm_cli_challenge . to_s ? lm_hash + lm_cli_challenge . to_s : "00" * 24
532
- nt_text = nt_hash + nt_cli_challenge . to_s ? nt_hash + nt_cli_challenge . to_s : "00" * 24
530
+ lm_text = ( lm_hash + lm_cli_challenge . to_s ) . length > 0 ? lm_hash + lm_cli_challenge . to_s : "00" * 24
531
+ nt_text = ( nt_hash + nt_cli_challenge . to_s ) . length > 0 ? nt_hash + nt_cli_challenge . to_s : "00" * 24
533
532
pass = "#{ smb [ :domain ] } :#{ lm_text } :#{ nt_text } :#{ datastore [ 'CHALLENGE' ] . to_s } "
534
533
535
534
# DB reporting
@@ -593,8 +592,8 @@ def smb_get_hash(smb, arg = {}, esn=true)
593
592
[
594
593
smb [ :username ] , "" ,
595
594
smb [ :domain ] ? smb [ :domain ] : "NULL" ,
596
- lm_hash ? lm_hash : "0" * 48 ,
597
- nt_hash ? nt_hash : "0" * 48 ,
595
+ lm_hash . length > 0 ? lm_hash : "0" * 48 ,
596
+ nt_hash . length > 0 ? nt_hash : "0" * 48 ,
598
597
@challenge . unpack ( "H*" ) [ 0 ]
599
598
] . join ( ":" ) . gsub ( /\n / , "\\ n" )
600
599
)
@@ -607,7 +606,7 @@ def smb_get_hash(smb, arg = {}, esn=true)
607
606
smb [ :username ] , "" ,
608
607
smb [ :domain ] ? smb [ :domain ] : "NULL" ,
609
608
@challenge . unpack ( "H*" ) [ 0 ] ,
610
- lm_hash ? lm_hash : "0" * 32 ,
609
+ lm_hash . length > 0 ? lm_hash : "0" * 32 ,
611
610
lm_cli_challenge ? lm_cli_challenge : "0" * 16
612
611
] . join ( ":" ) . gsub ( /\n / , "\\ n" )
613
612
)
@@ -619,7 +618,7 @@ def smb_get_hash(smb, arg = {}, esn=true)
619
618
smb [ :username ] , "" ,
620
619
smb [ :domain ] ? smb [ :domain ] : "NULL" ,
621
620
@challenge . unpack ( "H*" ) [ 0 ] ,
622
- nt_hash ? nt_hash : "0" * 32 ,
621
+ nt_hash . length > 0 ? nt_hash : "0" * 32 ,
623
622
nt_cli_challenge ? nt_cli_challenge : "0" * 160
624
623
] . join ( ":" ) . gsub ( /\n / , "\\ n" )
625
624
)
0 commit comments