{"record":{"id":"3d2cd9c467ef710b","repo":"shadow1ng/fscan","slug":"service-no-credentials-3d2cd9","errorCode":"service_no_credentials","errorMessage":"service_no_credentials","messagePattern":"service_no_credentials","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/services/smtp.go","lineNumber":48,"sourceCode":"\ttarget := info.Target()\n\n\tif config.DisableBrute {\n\t\treturn p.identifyService(ctx, info, session)\n\t}\n\n\t// 检测未授权访问\n\tif result := p.testUnauthorizedAccess(ctx, info, session); result != nil && result.Success {\n\t\tsession.LogSuccess(i18n.Tr(\"smtp_service\", target, result.Banner))\n\t\treturn result\n\t}\n\n\t// 生成密码字典\n\tcredentials := plugins.GenerateCredentials(\"smtp\", config)\n\tif len(credentials) == 0 {\n\t\treturn &ScanResult{\n\t\t\tSuccess: false,\n\t\t\tService: \"smtp\",\n\t\t\tError:   fmt.Errorf(\"%s\", i18n.GetText(\"service_no_credentials\")),\n\t\t}\n\t}\n\n\t// 转换凭据类型\n\tcreds := make([]Credential, len(credentials))\n\tfor i, c := range credentials {\n\t\tcreds[i] = Credential{Username: c.Username, Password: c.Password}\n\t}\n\n\t// 使用公共框架进行并发凭据测试\n\tauthFn := p.createAuthFunc(info, session)\n\ttestConfig := DefaultConcurrentTestConfigWithTarget(config, info)\n\n\tresult := TestCredentialsConcurrently(ctx, creds, authFn, \"smtp\", testConfig)\n\n\tif result.Success {\n\t\tsession.LogVuln(i18n.Tr(\"smtp_credential\", target, result.Username, result.Password))\n\t}","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/plugins/services/smtp.go#L30-L66","documentation":"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.","triggerScenarios":"Calling Scan on the SMTP plugin when the config has no explicit credentials and no username/password lists or generation rules that yield entries.","commonSituations":"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.","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."],"exampleFix":"// before\ncfg := common.NewConfig(target, port) // no credentials\n// after\ncfg.SetCredentials([][]string{{\"admin\", \"password123\"}})\nresult := plugin.Scan(cfg)","handlingStrategy":"validation","validationCode":"creds := plugins.GenerateCredentials(\"smtp\", config)\nif len(creds) == 0 { return errors.New(\"no smtp credentials configured\") }","typeGuard":"func hasCredentials(n int) bool { return n > 0 }","tryCatchPattern":null,"preventionTips":["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"],"tags":["smtp","credentials","config"],"backgroundTag":"missing-credentials","analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}