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
28aff6e4cb
commit
ea92da2d65
17
scan.go
17
scan.go
@ -17,8 +17,8 @@ import (
|
|||||||
|
|
||||||
type Result struct {
|
type Result struct {
|
||||||
Method string `json:"method"`
|
Method string `json:"method"`
|
||||||
Host string `json:"host"` // JSON 标签用于自定义字段名
|
Url string `json:"url"` // JSON 标签用于自定义字段名
|
||||||
Path string `json:"path"`
|
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"`
|
||||||
@ -54,8 +54,13 @@ func scan() {
|
|||||||
} else {
|
} else {
|
||||||
var resultOutput Result
|
var resultOutput Result
|
||||||
resultOutput.Method = TruncateString(r.Request.Method)
|
resultOutput.Method = TruncateString(r.Request.Method)
|
||||||
resultOutput.Host = TruncateString(r.Request.URL.Host)
|
if r.Request.URL.RawQuery != "" {
|
||||||
resultOutput.Path = TruncateString(r.Request.URL.Path)
|
resultOutput.Url = TruncateString(r.Request.URL.Host + r.Request.URL.Path + "?" + r.Request.URL.RawQuery)
|
||||||
|
} else {
|
||||||
|
resultOutput.Url = TruncateString(r.Request.URL.Host + r.Request.URL.Path)
|
||||||
|
}
|
||||||
|
|
||||||
|
resultOutput.Reqbody = TruncateString(string(r.Request.Body))
|
||||||
resultOutput.RespBodyA = TruncateString(resp1)
|
resultOutput.RespBodyA = TruncateString(resp1)
|
||||||
resultOutput.RespBodyB = TruncateString(resp2)
|
resultOutput.RespBodyB = TruncateString(resp2)
|
||||||
//
|
//
|
||||||
@ -79,7 +84,7 @@ func scan() {
|
|||||||
}
|
}
|
||||||
log.Println(string(jsonData))
|
log.Println(string(jsonData))
|
||||||
//--- 前端
|
//--- 前端
|
||||||
var dataItem DataItem
|
var dataItem Result
|
||||||
// 解析 JSON 数据到结构体
|
// 解析 JSON 数据到结构体
|
||||||
err = json.Unmarshal([]byte(jsonData), &dataItem)
|
err = json.Unmarshal([]byte(jsonData), &dataItem)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -95,7 +100,7 @@ func scan() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//---
|
//---
|
||||||
log.Println(PrintYuequan(resultOutput.Result, resultOutput.Method, resultOutput.Host+resultOutput.Path, resultOutput.Reason))
|
log.Println(PrintYuequan(resultOutput.Result, resultOutput.Method, resultOutput.Url, resultOutput.Reason))
|
||||||
logs.Delete(key)
|
logs.Delete(key)
|
||||||
return true // 返回true继续遍历,返回false停止遍历
|
return true // 返回true继续遍历,返回false停止遍历
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user