mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-10-13 19:21:08 +02:00
Add files via upload
This commit is contained in:
1 file changed
+8
@@ -3,6 +3,7 @@ package security
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
@@ -616,6 +617,13 @@ func (e *Executor) formatParamValue(param config.ParameterConfig, value interfac
|
|||||||
return strings.Join(strs, ",")
|
return strings.Join(strs, ",")
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%v", value)
|
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:
|
default:
|
||||||
formattedValue := fmt.Sprintf("%v", value)
|
formattedValue := fmt.Sprintf("%v", value)
|
||||||
// 特殊处理:对于 ports 参数(通常是 nmap 等工具的端口参数),清理空格
|
// 特殊处理:对于 ports 参数(通常是 nmap 等工具的端口参数),清理空格
|
||||||
|
|||||||
Reference in new issue
Block a user