mirror of
https://github.com/Ed1s0nZ/PrivHunterAI.git
synced 2025-09-17 20:41:37 +00:00
Update scan.go
This commit is contained in:
parent
434ed65d3e
commit
20af47fd69
23
scan.go
23
scan.go
@ -16,19 +16,21 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Result struct {
|
type Result struct {
|
||||||
Method string `json:"method"`
|
Method string `json:"method"`
|
||||||
Url string `json:"url"` // JSON 标签用于自定义字段名
|
Url string `json:"url"` // JSON 标签用于自定义字段名
|
||||||
Reqbody string `json:"reqbody"`
|
Reqbody string `json:"reqbody"`
|
||||||
RespBodyA string `json:"respBodyA"`
|
RespBodyA string `json:"respBodyA"`
|
||||||
RespBodyB string `json:"respBodyB"`
|
RespBodyB string `json:"respBodyB"`
|
||||||
Result string `json:"result"`
|
Result string `json:"result"`
|
||||||
Reason string `json:"reason"`
|
Reason string `json:"reason"`
|
||||||
|
Confidence string `json:"confidence"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// 扫描结果
|
// 扫描结果
|
||||||
type ScanResult struct {
|
type ScanResult struct {
|
||||||
Res string `json:"res"`
|
Res string `json:"res"`
|
||||||
Reason string `json:"reason"`
|
Reason string `json:"reason"`
|
||||||
|
Confidence string `json:"confidence"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func scan() {
|
func scan() {
|
||||||
@ -57,7 +59,7 @@ func scan() {
|
|||||||
if r.Request.URL.RawQuery != "" {
|
if r.Request.URL.RawQuery != "" {
|
||||||
resultOutput.Url = TruncateString(r.Request.URL.Scheme + "://" + r.Request.URL.Host + r.Request.URL.Path + "?" + r.Request.URL.RawQuery)
|
resultOutput.Url = TruncateString(r.Request.URL.Scheme + "://" + r.Request.URL.Host + r.Request.URL.Path + "?" + r.Request.URL.RawQuery)
|
||||||
} else {
|
} 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))
|
resultOutput.Reqbody = TruncateString(string(r.Request.Body))
|
||||||
@ -78,6 +80,7 @@ func scan() {
|
|||||||
} else {
|
} else {
|
||||||
resultOutput.Result = scanR.Res
|
resultOutput.Result = scanR.Res
|
||||||
resultOutput.Reason = scanR.Reason
|
resultOutput.Reason = scanR.Reason
|
||||||
|
resultOutput.Confidence = scanR.Confidence
|
||||||
jsonData, err := json.Marshal(resultOutput)
|
jsonData, err := json.Marshal(resultOutput)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Error marshaling to JSON: %v", err)
|
log.Fatalf("Error marshaling to JSON: %v", err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user