mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
fix+perf: 修复10个bug & 10项性能优化
Bug修复: - clustersend CEL结果判断从字符串比较改为类型断言 - Nuclei DSL matcher安全降级为false避免误报 - clusterpoc发现漏洞后返回true修正语义 - reverseCheck加10s超时防止ceye API阻塞 - doSearch/bmatches正则编译结果缓存到sync.Map - evalset CEL求值失败时存空字符串而非原始表达式 - CEL wait()函数加nil Reverse指针检查防panic - MongoDB readMongoMsg应用timeout参数设置读超时 - TXTWriter.Close确保Sync失败后仍调用file.Close 性能优化: - 指纹regex缓存从RWMutex+map改为sync.Map消除锁竞争 - CaseInsensitive指纹词加载时预小写化避免匹配时分配 - 版本提取FindAllStringSubmatch限制返回数量 - i18n.Tr用strconv.Itoa替代Sprintf减少分配 - POC加载用atomic.Bool+DCLP消除热路径锁 - 结果缓冲map预分配容量减少rehash - HTTP连接池参数随并发数动态调整 - getRuleHash去除反射+Headers排序保证确定性dedup - POC并发加载用channel替代Mutex收集结果
This commit is contained in:
@@ -328,6 +328,9 @@ func sendMongoMsg(ctx context.Context, conn io.ReadWriter, body []byte, timeout
|
||||
|
||||
// readMongoMsg 读取 MongoDB 响应
|
||||
func readMongoMsg(conn io.Reader, timeout time.Duration) ([]byte, error) {
|
||||
if tc, ok := conn.(interface{ SetReadDeadline(time.Time) error }); ok {
|
||||
_ = tc.SetReadDeadline(time.Now().Add(timeout))
|
||||
}
|
||||
// 读取 16 字节消息头
|
||||
header := make([]byte, 16)
|
||||
if _, err := io.ReadFull(conn, header); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user