mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-04-01 16:50:47 +02:00
Add files via upload
This commit is contained in:
@@ -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 等工具的端口参数),清理空格
|
||||
|
||||
Reference in New Issue
Block a user