Add files via upload

This commit is contained in:
公明
2026-01-12 18:55:12 +08:00
committed by GitHub
parent 4a7422cbc4
commit 2064e89356

View File

@@ -3,6 +3,7 @@ package security
import (
"bufio"
"context"
"encoding/json"
"fmt"
"io"
"os/exec"
@@ -616,6 +617,13 @@ func (e *Executor) formatParamValue(param config.ParameterConfig, value interfac
return strings.Join(strs, ",")
}
return fmt.Sprintf("%v", value)
case "object":
// 对象/字典:序列化为 JSON 字符串
if jsonBytes, err := json.Marshal(value); err == nil {
return string(jsonBytes)
}
// 如果 JSON 序列化失败,回退到默认格式化
return fmt.Sprintf("%v", value)
default:
formattedValue := fmt.Sprintf("%v", value)
// 特殊处理:对于 ports 参数(通常是 nmap 等工具的端口参数),清理空格