Skip to content

Commit

Permalink
fixed #125 #148 #151 #153 #159 2023-12-21
Browse files Browse the repository at this point in the history
  • Loading branch information
hktalent committed Dec 21, 2023
1 parent 134b1bc commit a33c987
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class scan4all < Formula
desc "Official repository vuls Scan: 15000+PoCs; 23 kinds of application password crack; 7000+Web fingerprints; 146 protocols and 90000+ rules Port scanning; Fuzz, HW, awesome BugBounty( ͡° ͜ʖ ͡°)..."
homepage "https://github.com/GhostTroops/scan4all"
url "https://github.com/GhostTroops/scan4all/releases/download/2.9.0/scan4all_2.9.0_macOS_amd64.zip"
sha256 "ccd874a283defad6a0deb11377cb9d6024cb5946b46f61f36008e0afe9db4950"
sha256 "542f26a2cbcbd37318d8cbb6e40607cfbff91f6c3a2ea945e143833c1a6aca19"
version "V2.9.0"

def install
Expand Down
28 changes: 17 additions & 11 deletions lib/util/checkerImp.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ var (
)

// 检查器的设计:解耦、规范、统一,各类专注实现自己
// 1、允许未响应header、body、js、css等构建不同的检查器
// 2、每个检查器都有缓存
// 3、避免重复检查
// 4、具有自动释放缓存的机制,程序退出时自动消费(内存缓存)
//
// 1、允许未响应header、body、js、css等构建不同的检查器
// 2、每个检查器都有缓存
// 3、避免重复检查
// 4、具有自动释放缓存的机制,程序退出时自动消费(内存缓存)
type CheckerTools struct {
Name string `json:"name"` // RespHeader,RespBody,RespJs,RespCss,RespTitle,ReqHeader
checkFunc []func(*CheckerTools, ...interface{}) `json:"check_func"` // 注册的检查器
Expand Down Expand Up @@ -78,8 +79,10 @@ func (r *CheckerTools) GetBodyStr(a ...interface{}) string {
// 检查
func (r *CheckerTools) Check(parm ...interface{}) {
for _, f := range r.checkFunc {
log.Printf("Check %+v\n", parm)
f(r, parm...)
if nil != f {
log.Printf("Check %+v\n", parm)
f(r, parm...)
}
}
}

Expand Down Expand Up @@ -112,12 +115,15 @@ func CheckRespHeader(parm ...interface{}) {
}

// 检查 response 对象
// 1、包括头的检查
// 2、包括body的检查
//
// 1、包括头的检查
// 2、包括body的检查
func CheckResp(szU string, resp ...*http.Response) {
for _, r := range resp {
CheckRespHeader(&r.Header, szU)
GetInstance(RespBody).Check(&r, szU)
if nil != resp && 0 < len(resp) {
for _, r := range resp {
CheckRespHeader(&r.Header, szU)
GetInstance(RespBody).Check(&r, szU)
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ var Version string
/*
go tool pprof -seconds=180 -http=:9999 http://127.0.0.1:6060/debug/pprof/heap
no leak
go tool pprof http://192.168.7.11:6060/debug/pprof/profile
http://localhost:9999/ui/
*/
func main() {
Expand Down

0 comments on commit a33c987

Please sign in to comment.