shadow1ng/fscan · error
service_no_credentials
service_no_credentials
Error message
service_no_credentials
What it means
The SMTP plugin's Scan produced an empty credential list, so there is nothing to attempt and it fails fast with 'service_no_credentials'. GenerateCredentials('smtp', config) returned zero entries, meaning the configuration supplied neither credentials nor dictionary inputs.
Source
Thrown at plugins/services/smtp.go:48
target := info.Target()
if config.DisableBrute {
return p.identifyService(ctx, info, session)
}
// 检测未授权访问
if result := p.testUnauthorizedAccess(ctx, info, session); result != nil && result.Success {
session.LogSuccess(i18n.Tr("smtp_service", target, result.Banner))
return result
}
// 生成密码字典
credentials := plugins.GenerateCredentials("smtp", config)
if len(credentials) == 0 {
return &ScanResult{
Success: false,
Service: "smtp",
Error: fmt.Errorf("%s", i18n.GetText("service_no_credentials")),
}
}
// 转换凭据类型
creds := make([]Credential, len(credentials))
for i, c := range credentials {
creds[i] = Credential{Username: c.Username, Password: c.Password}
}
// 使用公共框架进行并发凭据测试
authFn := p.createAuthFunc(info, session)
testConfig := DefaultConcurrentTestConfigWithTarget(config, info)
result := TestCredentialsConcurrently(ctx, creds, authFn, "smtp", testConfig)
if result.Success {
session.LogVuln(i18n.Tr("smtp_credential", target, result.Username, result.Password))
}View on GitHub (pinned to 95cc12e753)
Solutions
- Provide username/password credentials in the scan configuration.
- Supply user and password dictionary files and confirm they are non-empty.
- Log/print GenerateCredentials output to verify what the generator produces for your config.
- Check config keys for typos so credential options are actually read.
Example fix
// before
cfg := common.NewConfig(target, port) // no credentials
// after
cfg.SetCredentials([][]string{{"admin", "password123"}})
result := plugin.Scan(cfg) Defensive patterns
Strategy: validation
Validate before calling
creds := plugins.GenerateCredentials("smtp", config)
if len(creds) == 0 { return errors.New("no smtp credentials configured") } Type guard
func hasCredentials(n int) bool { return n > 0 } Prevention
- Always populate credentials or dictionaries in the scan config
- Log generated credential count at startup
- Guard against empty dictionary files
- Add a config lint step before running scans
When it happens
Trigger: Calling Scan on the SMTP plugin when the config has no explicit credentials and no username/password lists or generation rules that yield entries.
Common situations: Forgot to set the credential/user/password fields in the scan config; typo in config keys; a mode that disables credential generation; empty dictionary files.
Related errors
AI-assisted analysis of shadow1ng/fscan@95cc12e753 (2026-09-06).
Data as JSON: /api/errors/3d2cd9c467ef710b.
Report an issue: GitHub.