Harden scan robustness and tests

This commit is contained in:
ZacharyZcR
2026-06-14 22:23:48 +08:00
parent 5ad914a1bb
commit c49c23c7f0
100 changed files with 4483 additions and 412 deletions
+2 -3
View File
@@ -5,7 +5,6 @@ package services
import (
"context"
"fmt"
"io"
"net/http"
"strings"
@@ -163,7 +162,7 @@ func (p *Neo4jPlugin) testUnauthorizedAccess(ctx context.Context, info *common.H
defer func() { _ = resp.Body.Close() }()
if resp.StatusCode == 200 {
body, err := io.ReadAll(resp.Body)
body, err := readServiceHTTPBody(resp.Body)
if err != nil {
return &ScanResult{
Success: false,
@@ -221,7 +220,7 @@ func (p *Neo4jPlugin) identifyService(ctx context.Context, info *common.HostInfo
if serverHeader != "" && strings.Contains(strings.ToLower(serverHeader), "neo4j") {
banner = "Neo4j"
} else if resp.StatusCode == 200 || resp.StatusCode == 401 {
body, err := io.ReadAll(resp.Body)
body, err := readServiceHTTPBody(resp.Body)
if err != nil {
return &ScanResult{
Success: false,