mirror of
https://gitee.com/samwaf/SamWaf.git
synced 2025-12-06 14:59:18 +08:00
31 lines
815 B
Go
31 lines
815 B
Go
package wafenginecore
|
|
|
|
import (
|
|
"SamWaf/global"
|
|
"SamWaf/innerbean"
|
|
"SamWaf/model/detection"
|
|
"SamWaf/model/wafenginmodel"
|
|
"SamWaf/wafbot"
|
|
"net/http"
|
|
"net/url"
|
|
)
|
|
|
|
func (waf *WafEngine) CheckAllowCallBackIP(r *http.Request, weblogbean *innerbean.WebLog, formValue url.Values, hostTarget *wafenginmodel.HostSafe, globalHostTarget *wafenginmodel.HostSafe) detection.Result {
|
|
result := detection.Result{
|
|
JumpGuardResult: false,
|
|
IsBlock: false,
|
|
Title: "",
|
|
Content: "",
|
|
}
|
|
clientIp := weblogbean.SRC_IP
|
|
if global.GCONFIG_RECORD_PROXY_HEADER == "" {
|
|
clientIp = weblogbean.NetSrcIp
|
|
}
|
|
backIpResult := wafbot.CheckCallBackIp(clientIp)
|
|
if backIpResult.IsCallBack {
|
|
result.JumpGuardResult = true
|
|
weblogbean.GUEST_IDENTIFICATION = backIpResult.CallBackName
|
|
}
|
|
return result
|
|
}
|