From 20af47fd69eb48044a8c8a1cae721bf903810ced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AC=E6=98=8E?= <83812544+Ed1s0nZ@users.noreply.github.com> Date: Thu, 10 Apr 2025 18:05:56 +0800 Subject: [PATCH] Update scan.go --- scan.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/scan.go b/scan.go index bbb69a1..5eb8751 100644 --- a/scan.go +++ b/scan.go @@ -16,19 +16,21 @@ import ( ) type Result struct { - Method string `json:"method"` - Url string `json:"url"` // JSON 标签用于自定义字段名 - Reqbody string `json:"reqbody"` - RespBodyA string `json:"respBodyA"` - RespBodyB string `json:"respBodyB"` - Result string `json:"result"` - Reason string `json:"reason"` + Method string `json:"method"` + Url string `json:"url"` // JSON 标签用于自定义字段名 + Reqbody string `json:"reqbody"` + RespBodyA string `json:"respBodyA"` + RespBodyB string `json:"respBodyB"` + Result string `json:"result"` + Reason string `json:"reason"` + Confidence string `json:"confidence"` } // 扫描结果 type ScanResult struct { - Res string `json:"res"` - Reason string `json:"reason"` + Res string `json:"res"` + Reason string `json:"reason"` + Confidence string `json:"confidence"` } func scan() { @@ -57,7 +59,7 @@ func scan() { if r.Request.URL.RawQuery != "" { resultOutput.Url = TruncateString(r.Request.URL.Scheme + "://" + r.Request.URL.Host + r.Request.URL.Path + "?" + r.Request.URL.RawQuery) } else { - resultOutput.Url = TruncateString(r.Request.URL.Scheme + "://" +r.Request.URL.Host + r.Request.URL.Path) + resultOutput.Url = TruncateString(r.Request.URL.Scheme + "://" + r.Request.URL.Host + r.Request.URL.Path) } resultOutput.Reqbody = TruncateString(string(r.Request.Body)) @@ -78,6 +80,7 @@ func scan() { } else { resultOutput.Result = scanR.Res resultOutput.Reason = scanR.Reason + resultOutput.Confidence = scanR.Confidence jsonData, err := json.Marshal(resultOutput) if err != nil { log.Fatalf("Error marshaling to JSON: %v", err)