modulepackage
0.0.0-20220626070004-d46eaa42d089
Repository: https://github.com/sairson/webguard.git
Documentation: pkg.go.dev
# README
WebGuard
WebGuard是根据风起师傅的RedGuard和mgeeky师傅的RedWarden结合出来的http请求过滤器go包,亦在帮助采用go编写C2 http监听器做流量过滤和规则匹配
- 例子:
package main
import (
"fmt"
"github.com/sairson/WebGuard"
"net/http"
)
func main() {
guard := WebGuard.New("cfg.yml", true, handler)
http.HandleFunc("/", guard.RunGuard())
http.ListenAndServe(":8555", nil)
}
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Println("ok")
}
- 满足用户定义规则
- 不满足用户定义规则,跳转到用户定义的360.net网址
程序会根据用户在cfg.yml进行规则匹配,当http或https请求流量传入后,会走WebGuard的规则匹配,如果满足则放行继续走我们的handler控制函数,否则的话,会根据配置进行流量drop或者反代到指定域名。以扰乱溯源人员分析
# Packages
No description provided by the author
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
LoopUpLocation 查询地理位置是否合法.
No description provided by the author
No description provided by the author
WebGuardFilter 过滤器,判断规则是否可用 req 请求接收 rules 指定的规则配置路径.