fix: POC 扫描接入调用方 context,修复 cachedPocPath 竞争和 ProxyStats data race

- webscan/web_scan.go: WebScan 接受 ctx 参数,替换 context.Background();
  sync.Once 改为 sync.Mutex 保护 POC 加载,消除 cachedPocPath 并发写竞争
- webtitle.go: ctx 从 Scan 穿透到 identifyFingerprintsMulti → triggerPocScan → WebScan
- webpoc.go: 传递 ctx 到 WebScan
- proxy/types.go: ProxyStats 增加 sync.Mutex
- proxy/manager.go: LastConnectTime/LastError/AverageConnectTime 读写加锁
This commit is contained in:
ZacharyZcR
2026-04-27 19:24:59 +08:00
parent 3bf1cb0376
commit 9b8ed55eab
5 changed files with 46 additions and 23 deletions
+1 -1
View File
@@ -106,7 +106,7 @@ func (p *WebPocPlugin) Scan(ctx context.Context, info *common.HostInfo, config *
// 全量模式:忽略指纹和CDN/WAF检测,直接扫描所有POC
target := info.Target()
common.LogDebug(fmt.Sprintf("WebPOC %s 全量扫描模式", target))
WebScan.WebScan(info, config)
WebScan.WebScan(ctx, info, config)
return &WebScanResult{
Type: plugins.ResultTypeWeb,