mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
修复硬编码中文,迁移废弃的 uuid 依赖
- 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 版本说明
This commit is contained in:
@@ -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/[email protected]
|
||||
|
||||
# 运行检查并灵活处理结果
|
||||
|
||||
+3
-3
@@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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=
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user