From 2e71f25c85a3274185f461ab87bfc67e830d8bf1 Mon Sep 17 00:00:00 2001 From: Jeff Cody Date: Thu, 23 May 2019 13:54:45 -0400 Subject: [PATCH] SMB: Omit Negotiation adn Session logs if empty Currently, we will output 'null' json fields for either of these logs if they are not present; instead, let's just omit them entirely. --- lib/smb/smb/zgrab.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/smb/smb/zgrab.go b/lib/smb/smb/zgrab.go index 8d8c3aa..63f08ac 100644 --- a/lib/smb/smb/zgrab.go +++ b/lib/smb/smb/zgrab.go @@ -92,11 +92,11 @@ type SMBLog struct { // NegotiationLog, if present, contains the server's response to the // negotiation request. - NegotiationLog *NegotiationLog `json:"negotiation_log"` + NegotiationLog *NegotiationLog `json:"negotiation_log,omitempty"` // SessionSetupLog, if present, contains the server's response to the // session setup request. - SessionSetupLog *SessionSetupLog `json:"session_setup_log"` + SessionSetupLog *SessionSetupLog `json:"session_setup_log,omitempty"` } // LoggedSession wraps the Session struct, and holds a Log struct alongside it