mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-11-19 15:24:10 +01:00
@@ -19,6 +19,7 @@ import (
|
||||
_ "embed"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
agents "github.com/monperrus/crawler-user-agents"
|
||||
)
|
||||
@@ -50,6 +51,10 @@ func NewExploitDetector(CheckCommonExploits bool, CheckAiBots bool, ExploitRespT
|
||||
// CheckIsAttack checks if the request is an attack based on common exploits
|
||||
// return true if the request is handled
|
||||
func (d *Detector) CheckIsAttack(w http.ResponseWriter, r *http.Request) bool {
|
||||
path := r.URL.Path
|
||||
if strings.HasPrefix(path, "/.well-known/") {
|
||||
return false
|
||||
}
|
||||
if d.CheckCommonExploits && d.RequestContainCommonExploits(r) {
|
||||
return d.handleExploitResponse(w, r, d.ExploitRespType)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user