mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-25 04:31:52 +08:00
fix: 修复新服务扫描插件的健壮性问题
- ipmi: 删除未使用的 encoding/binary 导入 - rmi: TCP读取改用 io.ReadFull 避免分片导致的解析错误 - jdwp: handshake响应读取改用 io.ReadFull 避免分片误判 - nfs: v4协议回退时使用新连接避免残留数据污染 - snmp: 修正timeout计算与其他插件保持一致
This commit is contained in:
@@ -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"}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user