fix:修复rebase时产生错误

This commit is contained in:
tongque 2025-04-20 19:10:52 +08:00
parent a010fcbb6c
commit 580b067298

View File

@ -21,78 +21,97 @@ func defineFlags(info *HostInfo) {
// 通用 flag 注册逻辑,支持 flag.CommandLine 和新建 FlagSet用于远程 // 通用 flag 注册逻辑,支持 flag.CommandLine 和新建 FlagSet用于远程
func defineFlagsForSet(fs *flag.FlagSet, info *HostInfo) { func defineFlagsForSet(fs *flag.FlagSet, info *HostInfo) {
// ═════════════════════════════════════════════════
// 目标配置参数 // 目标配置参数
fs.StringVar(&info.Host, "h", "", GetText("flag_host")) // ═════════════════════════════════════════════════
fs.StringVar(&ExcludeHosts, "eh", "", GetText("flag_exclude_hosts")) flag.StringVar(&info.Host, "h", "", GetText("flag_host"))
fs.StringVar(&Ports, "p", MainPorts, GetText("flag_ports")) flag.StringVar(&ExcludeHosts, "eh", "", GetText("flag_exclude_hosts"))
fs.StringVar(&HostsFile, "hf", "", GetText("flag_hosts_file")) flag.StringVar(&Ports, "p", MainPorts, GetText("flag_ports"))
fs.StringVar(&PortsFile, "pf", "", GetText("flag_ports_file")) flag.StringVar(&HostsFile, "hf", "", GetText("flag_hosts_file"))
flag.StringVar(&PortsFile, "pf", "", GetText("flag_ports_file"))
// ═════════════════════════════════════════════════
// 扫描控制参数 // 扫描控制参数
fs.StringVar(&ScanMode, "m", "All", GetText("flag_scan_mode")) // ═════════════════════════════════════════════════
fs.IntVar(&ThreadNum, "t", 10, GetText("flag_thread_num")) flag.StringVar(&ScanMode, "m", "All", GetText("flag_scan_mode"))
fs.Int64Var(&Timeout, "time", 3, GetText("flag_timeout")) flag.IntVar(&ThreadNum, "t", 10, GetText("flag_thread_num"))
fs.IntVar(&ModuleThreadNum, "mt", 10, GetText("flag_module_thread_num")) flag.Int64Var(&Timeout, "time", 3, GetText("flag_timeout"))
fs.Int64Var(&GlobalTimeout, "gt", 180, GetText("flag_global_timeout")) flag.IntVar(&ModuleThreadNum, "mt", 10, GetText("flag_module_thread_num"))
fs.IntVar(&LiveTop, "top", 10, GetText("flag_live_top")) flag.Int64Var(&GlobalTimeout, "gt", 180, GetText("flag_global_timeout"))
fs.BoolVar(&DisablePing, "np", false, GetText("flag_disable_ping")) flag.IntVar(&LiveTop, "top", 10, GetText("flag_live_top"))
fs.BoolVar(&UsePing, "ping", false, GetText("flag_use_ping")) flag.BoolVar(&DisablePing, "np", false, GetText("flag_disable_ping"))
fs.BoolVar(&EnableFingerprint, "fingerprint", false, GetText("flag_enable_fingerprint")) flag.BoolVar(&UsePing, "ping", false, GetText("flag_use_ping"))
fs.BoolVar(&LocalMode, "local", false, GetText("flag_local_mode")) flag.BoolVar(&EnableFingerprint, "fingerprint", false, GetText("flag_enable_fingerprint"))
flag.BoolVar(&LocalMode, "local", false, GetText("flag_local_mode"))
// ═════════════════════════════════════════════════
// 认证与凭据参数 // 认证与凭据参数
fs.StringVar(&Username, "user", "", GetText("flag_username")) // ═════════════════════════════════════════════════
fs.StringVar(&Password, "pwd", "", GetText("flag_password")) flag.StringVar(&Username, "user", "", GetText("flag_username"))
fs.StringVar(&AddUsers, "usera", "", GetText("flag_add_users")) flag.StringVar(&Password, "pwd", "", GetText("flag_password"))
fs.StringVar(&AddPasswords, "pwda", "", GetText("flag_add_passwords")) flag.StringVar(&AddUsers, "usera", "", GetText("flag_add_users"))
fs.StringVar(&UsersFile, "userf", "", GetText("flag_users_file")) flag.StringVar(&AddPasswords, "pwda", "", GetText("flag_add_passwords"))
fs.StringVar(&PasswordsFile, "pwdf", "", GetText("flag_passwords_file")) flag.StringVar(&UsersFile, "userf", "", GetText("flag_users_file"))
fs.StringVar(&HashFile, "hashf", "", GetText("flag_hash_file")) flag.StringVar(&PasswordsFile, "pwdf", "", GetText("flag_passwords_file"))
fs.StringVar(&HashValue, "hash", "", GetText("flag_hash_value")) flag.StringVar(&HashFile, "hashf", "", GetText("flag_hash_file"))
fs.StringVar(&Domain, "domain", "", GetText("flag_domain")) flag.StringVar(&HashValue, "hash", "", GetText("flag_hash_value"))
fs.StringVar(&SshKeyPath, "sshkey", "", GetText("flag_ssh_key")) flag.StringVar(&Domain, "domain", "", GetText("flag_domain")) // SMB扫描用
flag.StringVar(&SshKeyPath, "sshkey", "", GetText("flag_ssh_key")) // SSH扫描用
// ═════════════════════════════════════════════════
// Web扫描参数 // Web扫描参数
fs.StringVar(&TargetURL, "u", "", GetText("flag_target_url")) // ═════════════════════════════════════════════════
fs.StringVar(&URLsFile, "uf", "", GetText("flag_urls_file")) flag.StringVar(&TargetURL, "u", "", GetText("flag_target_url"))
fs.StringVar(&Cookie, "cookie", "", GetText("flag_cookie")) flag.StringVar(&URLsFile, "uf", "", GetText("flag_urls_file"))
fs.Int64Var(&WebTimeout, "wt", 5, GetText("flag_web_timeout")) flag.StringVar(&Cookie, "cookie", "", GetText("flag_cookie"))
fs.StringVar(&HttpProxy, "proxy", "", GetText("flag_http_proxy")) flag.Int64Var(&WebTimeout, "wt", 5, GetText("flag_web_timeout"))
fs.StringVar(&Socks5Proxy, "socks5", "", GetText("flag_socks5_proxy")) flag.StringVar(&HttpProxy, "proxy", "", GetText("flag_http_proxy"))
flag.StringVar(&Socks5Proxy, "socks5", "", GetText("flag_socks5_proxy"))
// ═════════════════════════════════════════════════
// POC测试参数 // POC测试参数
fs.StringVar(&PocPath, "pocpath", "", GetText("flag_poc_path")) // ═════════════════════════════════════════════════
fs.StringVar(&Pocinfo.PocName, "pocname", "", GetText("flag_poc_name")) flag.StringVar(&PocPath, "pocpath", "", GetText("flag_poc_path"))
fs.BoolVar(&PocFull, "full", false, GetText("flag_poc_full")) flag.StringVar(&Pocinfo.PocName, "pocname", "", GetText("flag_poc_name"))
fs.BoolVar(&DnsLog, "dns", false, GetText("flag_dns_log")) flag.BoolVar(&PocFull, "full", false, GetText("flag_poc_full"))
fs.IntVar(&PocNum, "num", 20, GetText("flag_poc_num")) flag.BoolVar(&DnsLog, "dns", false, GetText("flag_dns_log"))
flag.IntVar(&PocNum, "num", 20, GetText("flag_poc_num"))
flag.BoolVar(&DisablePocScan, "nopoc", false, GetText("flag_nopoc"))
// ═════════════════════════════════════════════════
// Redis利用参数 // Redis利用参数
fs.StringVar(&RedisFile, "rf", "", GetText("flag_redis_file")) // ═════════════════════════════════════════════════
fs.StringVar(&RedisShell, "rs", "", GetText("flag_redis_shell")) flag.StringVar(&RedisFile, "rf", "", GetText("flag_redis_file"))
fs.BoolVar(&DisableRedis, "noredis", false, GetText("flag_disable_redis")) flag.StringVar(&RedisShell, "rs", "", GetText("flag_redis_shell"))
fs.StringVar(&RedisWritePath, "rwp", "", GetText("flag_redis_write_path")) flag.BoolVar(&DisableRedis, "noredis", false, GetText("flag_disable_redis"))
fs.StringVar(&RedisWriteContent, "rwc", "", GetText("flag_redis_write_content")) flag.StringVar(&RedisWritePath, "rwp", "", GetText("flag_redis_write_path"))
fs.StringVar(&RedisWriteFile, "rwf", "", GetText("flag_redis_write_file")) flag.StringVar(&RedisWriteContent, "rwc", "", GetText("flag_redis_write_content"))
flag.StringVar(&RedisWriteFile, "rwf", "", GetText("flag_redis_write_file"))
// ═════════════════════════════════════════════════
// 暴力破解控制参数 // 暴力破解控制参数
fs.BoolVar(&DisableBrute, "nobr", false, GetText("flag_disable_brute")) // ═════════════════════════════════════════════════
fs.IntVar(&MaxRetries, "retry", 3, GetText("flag_max_retries")) flag.BoolVar(&DisableBrute, "nobr", false, GetText("flag_disable_brute"))
flag.IntVar(&MaxRetries, "retry", 3, GetText("flag_max_retries"))
// ═════════════════════════════════════════════════
// 输出与显示控制参数 // 输出与显示控制参数
fs.StringVar(&Outputfile, "o", "result.txt", GetText("flag_output_file")) // ═════════════════════════════════════════════════
fs.StringVar(&OutputFormat, "f", "txt", GetText("flag_output_format")) flag.StringVar(&Outputfile, "o", "result.txt", GetText("flag_output_file"))
fs.BoolVar(&DisableSave, "no", false, GetText("flag_disable_save")) flag.StringVar(&OutputFormat, "f", "txt", GetText("flag_output_format"))
fs.BoolVar(&Silent, "silent", false, GetText("flag_silent_mode")) flag.BoolVar(&DisableSave, "no", false, GetText("flag_disable_save"))
fs.BoolVar(&NoColor, "nocolor", false, GetText("flag_no_color")) flag.BoolVar(&Silent, "silent", false, GetText("flag_silent_mode"))
fs.StringVar(&LogLevel, "log", LogLevelSuccess, GetText("flag_log_level")) flag.BoolVar(&NoColor, "nocolor", false, GetText("flag_no_color"))
fs.BoolVar(&ShowProgress, "pg", false, GetText("flag_show_progress")) flag.StringVar(&LogLevel, "log", LogLevelSuccess, GetText("flag_log_level"))
fs.BoolVar(&ShowScanPlan, "sp", false, GetText("flag_show_scan_plan")) flag.BoolVar(&ShowProgress, "pg", false, GetText("flag_show_progress"))
fs.BoolVar(&SlowLogOutput, "slow", false, GetText("flag_slow_log_output")) flag.BoolVar(&ShowScanPlan, "sp", false, GetText("flag_show_scan_plan"))
flag.BoolVar(&SlowLogOutput, "slow", false, GetText("flag_slow_log_output"))
// ═════════════════════════════════════════════════
// 其他参数 // 其他参数
fs.StringVar(&Shellcode, "sc", "", GetText("flag_shellcode")) // ═════════════════════════════════════════════════
fs.StringVar(&Language, "lang", "zh", GetText("flag_language")) flag.StringVar(&Shellcode, "sc", "", GetText("flag_shellcode"))
flag.StringVar(&Language, "lang", "zh", GetText("flag_language"))
fs.StringVar(&ApiAddr, "api", "", GetText("flag_api")) fs.StringVar(&ApiAddr, "api", "", GetText("flag_api"))
fs.StringVar(&SecretKey, "secret", "", GetText("flag_api_key")) fs.StringVar(&SecretKey, "secret", "", GetText("flag_api_key"))
} }