#609·fscan

[Bug] pwda参数会覆盖内置密码本而非追加

Author: Wandering-yCreated Sep 22, 2026Updated Sep 22, 2026

问题模块

弱口令爆破 (Brute Force)

严重程度

功能异常 (Malfunction)

问题描述

根据官方文档说明,pwda参数表示:“额外密码,支持逗号或空格分隔多个值” 但是实际测试下来发现pwda参数会覆盖内置的密码本,如下 [root@centos ~]# /root/Scan/fscan_2.2.1_linux_x64 -h 10.225.137.23 -p 6379 -np -nocolor -nopg ┌──────────────────────────────────────────────┐ │ ___ _ │ │ / _ \ ___ ___ _ __ __ _ | | __ │ │ / /// |/ | '/ ` |/ _| |/ / │ │ / /\____ \ (| | | (| | (| < │ │ _/ |/_|| _,|__||_\ │ └──────────────────────────────────────────────┘ Fscan 2.2.1 (95cc12e 2026-08-25T20:44:10Z)

[] 服务插件: redis, webtitle, webpoc [] 参数自适应: Timeout=1000ms, ModuleThread=30, Retry=1, ICMPRate=0.50, PocNum=30 [] 10.225.137.23:6379 redis [Product:Redis key-value store] Banner:(-NOAUTH Authentication required.) [] 扫描完成,发现 1 个开放端口 [!] Redis 10.225.137.23:6379 123456 [*] 扫描任务完成,耗时 3.014s,已扫描 1 个目标 [root@centos ~]# /root/Scan/fscan_2.2.1_linux_x64 -h 10.225.137.23 -p 6379 -np -nocolor -pwda abc qwe ┌──────────────────────────────────────────────┐ │ ___ _ │ │ / _ \ ___ ___ _ __ __ _ | | __ │ │ / /// |/ | '/ ` |/ _| |/ / │ │ / /\____ \ (| | | (| | (| < │ │ _/ |/_|| _,|__||_\ │ └──────────────────────────────────────────────┘ Fscan 2.2.1 (95cc12e 2026-08-25T20:44:10Z)

[] 服务插件: redis, webpoc, webtitle [] 参数自适应: Timeout=1000ms, ModuleThread=30, Retry=1, ICMPRate=0.50, PocNum=30 [] 10.225.137.23:6379 redis [Product:Redis key-value store] Banner:(-NOAUTH Authentication required.) [] 扫描完成,发现 1 个开放端口 [-] 10.225.137.23:6379 redis 未发现弱密码 [*] 扫描任务完成,耗时 3.007s,已扫描 1 个目标 定位到config_builder.go,parsePasswords() 只收集 -pwd / -pwdf / -pwda 三个参数的值,全程没有引用内置字典:func parsePasswords(fv *FlagVars) ([]string, error) { var passwords []string // 命令行密码(支持逗号分隔多个值,保留空格作为密码的一部分) if fv.Password != "" { for _, p := range strings.Split(fv.Password, ",") { p = strings.TrimSpace(p) if p != "" { passwords = append(passwords, p) } } }

// 从文件读取
if fv.PasswordsFile != "" {
	if lines, err := parsers.ReadLinesFromFile(fv.PasswordsFile); err == nil {
		passwords = append(passwords, lines...)
	} else {
		return nil, fmt.Errorf("%s", i18n.Tr("config_read_passwords_failed", fv.PasswordsFile, err))
	}
}

// 额外密码
if fv.AddPasswords != "" {
	passwords = append(passwords, splitCredentialValues(fv.AddPasswords)...)
}

return removeDuplicate(passwords), nil

} parseCredentials()拿到结果后,直接整体覆盖cfg.Credentials.Passwords func parseCredentials(fv *FlagVars, cfg *Config) error { ... // 解析密码 passwords, err := parsePasswords(fv) if err != nil { return err } if len(passwords) > 0 { cfg.Credentials.Passwords = passwords } ... } 而 cfg.Credentials.Passwords 本来是有内容的,由 flag_config.go 的 BuildConfigFromFlags() 初始化: Credentials: CredentialConfig{ Userdict: cloneStringSliceMap(config.DefaultUserDict), Passwords: cloneStringSlice(config.DefaultPasswords), UserPassPairs: nil, ... }

复现步骤

bash
找一个密码是123456的redis测试一下即可
/root/Scan/fscan_2.2.1_linux_x64 -h 10.225.137.23 -p 6379
/root/Scan/fscan_2.2.1_linux_x64 -h 10.225.137.23 -p 6379 -pwda abc qwe

错误输出

bash

fscan 版本

2.2.0

操作系统

CentOS 7/8/Stream

系统架构

amd64 (x86_64)

补充信息

版本是2.2.1