From 2f2b30763c91770387da90c9ad04c3ec9eb73534 Mon Sep 17 00:00:00 2001 From: ZacharyZcR <2903735704@qq.com> Date: Mon, 18 May 2026 02:43:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A1=AC=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E4=B8=AD=E6=96=87=EF=BC=8C=E8=BF=81=E7=A7=BB=E5=BA=9F=E5=BC=83?= =?UTF-8?q?=E7=9A=84=20uuid=20=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - flag.go: -local/-perf 参数改用 i18n.GetText,checkParameterConflicts 改用 i18n.Tr - 补齐中英文 locale 中 flag_local_plugin/flag_perf_stats/param_local_multi_plugin - satori/go.uuid 迁移为 google/uuid (satori 已废弃) - CI 补充 lint Go 版本说明 --- .github/workflows/test-build.yml | 2 +- common/flag.go | 6 +++--- common/i18n/locales/en.yaml | 6 ++++++ common/i18n/locales/zh.yaml | 6 ++++++ go.mod | 5 ++--- go.sum | 2 -- webscan/lib/Shiro.go | 5 +++-- 7 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 477fc71..023e50a 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -56,7 +56,7 @@ jobs: - name: 运行 golangci-lint run: | - # 安装 golangci-lint v2 + # 安装 golangci-lint v2 (需要 Go 1.22+,仅用于静态分析,不影响二进制兼容性) go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.1 # 运行检查并灵活处理结果 diff --git a/common/flag.go b/common/flag.go index 603f230..23fbe96 100644 --- a/common/flag.go +++ b/common/flag.go @@ -113,7 +113,7 @@ func Flag(Info *HostInfo) error { flag.Int64Var(&fv.GlobalTimeout, "gt", 180, i18n.GetText("flag_global_timeout")) flag.BoolVar(&fv.DisablePing, "np", false, i18n.GetText("flag_disable_ping")) flag.BoolVar(&fv.DisableTcpProbe, "ntp", false, i18n.GetText("flag_disable_tcp_probe")) - flag.StringVar(&fv.LocalPlugin, "local", "", "指定本地插件名称 (如: cleaner, systeminfo, keylogger 等)") + flag.StringVar(&fv.LocalPlugin, "local", "", i18n.GetText("flag_local_plugin")) flag.BoolVar(&fv.AliveOnly, "ao", false, i18n.GetText("flag_alive_only")) // ═════════════════════════════════════════════════ @@ -187,7 +187,7 @@ func Flag(Info *HostInfo) error { flag.StringVar(&fv.LogLevel, "log", LogLevelBaseInfoSuccess, i18n.GetText("flag_log_level")) flag.BoolVar(&fv.Debug, "debug", false, i18n.GetText("flag_debug")) flag.BoolVar(&fv.DisableProgress, "nopg", false, i18n.GetText("flag_disable_progress")) - flag.BoolVar(&fv.PerfStats, "perf", false, "输出性能统计JSON") + flag.BoolVar(&fv.PerfStats, "perf", false, i18n.GetText("flag_perf_stats")) // ═════════════════════════════════════════════════ // 其他参数 @@ -310,7 +310,7 @@ func checkParameterConflicts() error { invalidChars := []string{",", ";", " ", "|", "&"} for _, char := range invalidChars { if strings.Contains(fv.LocalPlugin, char) { - return fmt.Errorf("本地插件只能指定单个插件,不支持使用 '%s' 分隔的多个插件", char) + return fmt.Errorf(i18n.Tr("param_local_multi_plugin", char)) } } } diff --git a/common/i18n/locales/en.yaml b/common/i18n/locales/en.yaml index 0f94504..bfd445d 100644 --- a/common/i18n/locales/en.yaml +++ b/common/i18n/locales/en.yaml @@ -30,6 +30,8 @@ flag_disable_ping: other: "Disable ping detection" flag_disable_tcp_probe: other: "Disable TCP supplementary probe" +flag_local_plugin: + other: "Specify local plugin name (e.g.: cleaner, systeminfo, keylogger)" flag_debug: other: "Enable debug mode, write logs to fscan_debug.log" flag_alive_only: @@ -120,6 +122,8 @@ flag_log_level: other: "Log level" flag_disable_progress: other: "Disable progress bar" +flag_perf_stats: + other: "Output performance stats in JSON" flag_shellcode: other: "Shellcode" flag_reverse_shell_target: @@ -213,6 +217,8 @@ target_local_mode: other: "Local scan mode" param_conflict_ao_icmp_both: other: "Note: Both -ao and -m icmp specified, both enable alive detection mode" +param_local_multi_plugin: + other: "Only a single local plugin can be specified, multiple plugins separated by '{{.Arg1}}' are not supported" # ========================= Parser Messages ========================= parser_empty_input: diff --git a/common/i18n/locales/zh.yaml b/common/i18n/locales/zh.yaml index a368ac5..b6a6321 100644 --- a/common/i18n/locales/zh.yaml +++ b/common/i18n/locales/zh.yaml @@ -30,6 +30,8 @@ flag_disable_ping: other: "禁用ping探测" flag_disable_tcp_probe: other: "禁用TCP补充探测" +flag_local_plugin: + other: "指定本地插件名称 (如: cleaner, systeminfo, keylogger 等)" flag_debug: other: "开启调试模式,日志写入fscan_debug.log" flag_alive_only: @@ -120,6 +122,8 @@ flag_log_level: other: "日志级别" flag_disable_progress: other: "禁用进度条" +flag_perf_stats: + other: "输出性能统计JSON" flag_shellcode: other: "Shellcode" flag_reverse_shell_target: @@ -213,6 +217,8 @@ target_local_mode: other: "本地扫描模式" param_conflict_ao_icmp_both: other: "提示: 同时指定了 -ao 和 -m icmp,两者功能相同,使用存活探测模式" +param_local_multi_plugin: + other: "本地插件只能指定单个插件,不支持使用 '{{.Arg1}}' 分隔的多个插件" # ========================= 解析器消息 ========================= parser_empty_input: diff --git a/go.mod b/go.mod index 18dcf73..a7f2a0c 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/go-sql-driver/mysql v1.8.1 github.com/gocql/gocql v1.7.0 github.com/google/cel-go v0.13.0 + github.com/google/uuid v1.6.0 github.com/gorilla/websocket v1.5.3 github.com/hirochachacha/go-smb2 v1.1.0 github.com/huin/asn1ber v0.0.0-20120622192748-af09f62e6358 @@ -21,9 +22,9 @@ require ( github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed github.com/nicksnyder/go-i18n/v2 v2.4.0 github.com/panjf2000/ants/v2 v2.11.3 - github.com/satori/go.uuid v1.2.0 github.com/sijms/go-ora/v2 v2.9.0 github.com/stacktitan/smb v0.0.0-20190531122847-da9a425dceb8 + github.com/tjfoc/gmsm v1.4.1 go.ciq.dev/go-rsync v0.0.0-20240304021629-0a3bb196e6d1 go.mongodb.org/mongo-driver v1.17.4 golang.org/x/crypto v0.31.0 @@ -51,7 +52,6 @@ require ( github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe // indirect github.com/golang-sql/sqlexp v0.1.0 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/uuid v1.6.0 // indirect github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect github.com/hashicorp/errwrap v1.0.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect @@ -72,7 +72,6 @@ require ( github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/stoewer/go-strcase v1.2.0 // indirect - github.com/tjfoc/gmsm v1.4.1 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.2 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect diff --git a/go.sum b/go.sum index 1c97e65..552c523 100644 --- a/go.sum +++ b/go.sum @@ -155,8 +155,6 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5X github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sijms/go-ora/v2 v2.9.0 h1:+iQbUeTeCOFMb5BsOMgUhV8KWyrv9yjKpcK4x7+MFrg= github.com/sijms/go-ora/v2 v2.9.0/go.mod h1:QgFInVi3ZWyqAiJwzBQA+nbKYKH77tdp1PYoCqhR2dU= github.com/stacktitan/smb v0.0.0-20190531122847-da9a425dceb8 h1:GVFkBBJAEO3CpzIYcDDBdpUObzKwVW9okNWcLYL/nnU= diff --git a/webscan/lib/Shiro.go b/webscan/lib/Shiro.go index 5413261..7d86685 100644 --- a/webscan/lib/Shiro.go +++ b/webscan/lib/Shiro.go @@ -8,7 +8,7 @@ import ( "encoding/base64" "io" - uuid "github.com/satori/go.uuid" + "github.com/google/uuid" ) var ( @@ -55,7 +55,8 @@ func AESCBCEncrypt(shirokey string) string { paddedContent := Padding(Content, block.BlockSize()) // 生成随机IV - iv := uuid.NewV4().Bytes() + u := uuid.New() + iv := u[:] // 创建CBC加密器 blockMode := cipher.NewCBCEncrypter(block, iv)