fix: 修复新服务扫描插件的健壮性问题

- ipmi: 删除未使用的 encoding/binary 导入
- rmi: TCP读取改用 io.ReadFull 避免分片导致的解析错误
- jdwp: handshake响应读取改用 io.ReadFull 避免分片误判
- nfs: v4协议回退时使用新连接避免残留数据污染
- snmp: 修正timeout计算与其他插件保持一致
This commit is contained in:
ZacharyZcR
2026-05-19 20:46:22 +08:00
parent a92df59dfe
commit bc2a8f653a
5 changed files with 26 additions and 16 deletions
+2 -2
View File
@@ -6,6 +6,7 @@ import (
"bytes"
"context"
"fmt"
"io"
"time"
"github.com/shadow1ng/fscan/common"
@@ -41,8 +42,7 @@ func (p *JDWPPlugin) Scan(ctx context.Context, info *common.HostInfo, session *c
}
buf := make([]byte, len(jdwpHandshake))
n, err := conn.Read(buf)
if err != nil || !bytes.Equal(buf[:n], jdwpHandshake) {
if _, err := io.ReadFull(conn, buf); err != nil || !bytes.Equal(buf, jdwpHandshake) {
return &ScanResult{Success: false, Service: "jdwp"}
}