mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-07-13 21:02:44 +08:00
rule.Search 正则匹配范围从body改成header+body
This commit is contained in:
parent
ed96a8dd89
commit
023fa19a48
@ -145,7 +145,7 @@ func executePoc(oReq *http.Request, p *Poc) (bool, error, string) {
|
||||
variableMap["response"] = resp
|
||||
// 先判断响应页面是否匹配search规则
|
||||
if rule.Search != "" {
|
||||
result := doSearch(strings.TrimSpace(rule.Search), string(resp.Body))
|
||||
result := doSearch(strings.TrimSpace(rule.Search), GetHeader(resp.Headers)+string(resp.Body))
|
||||
if result != nil && len(result) > 0 { // 正则匹配成功
|
||||
for k, v := range result {
|
||||
variableMap[k] = v
|
||||
@ -435,7 +435,7 @@ func clustersend(oReq *http.Request, variableMap map[string]interface{}, req *Re
|
||||
variableMap["response"] = resp
|
||||
// 先判断响应页面是否匹配search规则
|
||||
if rule.Search != "" {
|
||||
result := doSearch(strings.TrimSpace(rule.Search), string(resp.Body))
|
||||
result := doSearch(strings.TrimSpace(rule.Search), GetHeader(resp.Headers)+string(resp.Body))
|
||||
if result != nil && len(result) > 0 { // 正则匹配成功
|
||||
for k, v := range result {
|
||||
variableMap[k] = v
|
||||
@ -514,3 +514,12 @@ func CheckInfoPoc(infostr string) string {
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func GetHeader(header map[string]string) (output string) {
|
||||
for name, values := range header {
|
||||
line := fmt.Sprintf("%s: %s\n", name, values)
|
||||
output = output + line
|
||||
}
|
||||
output = output + "\r\n"
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user