{"record":{"id":"423b8a8787d65cf7","repo":"shadow1ng/fscan","slug":"s-423b8a","errorCode":null,"errorMessage":"%s","messagePattern":"%s","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"plugins/services/cassandra.go","lineNumber":49,"sourceCode":"\tconfig := session.Config\n\tstate := session.State\n\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.tryNoAuthConnection(ctx, info, session); result != nil && result.Success {\n\t\treturn result\n\t}\n\n\tcredentials := GenerateCredentials(\"cassandra\", config)\n\tif len(credentials) == 0 {\n\t\treturn &ScanResult{\n\t\t\tSuccess: false,\n\t\t\tService: \"cassandra\",\n\t\t\tError:   fmt.Errorf(\"%s\", i18n.GetText(\"service_no_credentials\")),\n\t\t}\n\t}\n\n\tauthFn := p.createAuthFunc(info, config, state)\n\ttestConfig := DefaultConcurrentTestConfigWithTarget(config, info)\n\n\tresult := TestCredentialsConcurrently(ctx, credentials, authFn, \"cassandra\", testConfig)\n\n\tif result.Success {\n\t\tsession.LogVuln(i18n.Tr(\"cassandra_credential\", target, result.Username, result.Password))\n\t}\n\n\treturn result\n}\n\nfunc (p *CassandraPlugin) createAuthFunc(info *common.HostInfo, config *common.Config, state *common.State) AuthFunc {\n\treturn func(ctx context.Context, cred Credential) *AuthResult {\n\t\treturn p.doCassandraAuth(ctx, info, cred, config, state)","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/plugins/services/cassandra.go#L31-L67","documentation":"The Cassandra plugin's Scan found no credentials to test: GenerateCredentials returned an empty list for the 'cassandra' service. The plugin aborts with a failed ScanResult carrying a localized 'no credentials' error instead of running the auth test loop.","triggerScenarios":"Scan() calls GenerateCredentials(\"cassandra\", config); if it yields zero entries (e.g. empty or mis-scoped credential config), Scan returns Success:false with i18n 'service_no_credentials'.","commonSituations":"Credential wordlists not loaded or path misconfigured; config filters exclude all cassandra credentials; running in an environment where credential sources are empty; typo in service name so the generator matches nothing.","solutions":["Supply credentials in the scan config (username/password lists or a credential source) for the cassandra service.","Check the credential loading configuration: wordlist paths exist and are readable, and no filter excludes all entries.","Log or inspect GenerateCredentials output for 'cassandra' to confirm what the generator produces with your config."],"exampleFix":"// before\ncfg := config // no credentials configured\n// after\ncfg.CredentialSources = []string{\"wordlists/cassandra-default.txt\"}\ncfg.Usernames = []string{\"cassandra\"}\ncfg.Passwords = []string{\"cassandra\"}","handlingStrategy":"validation","validationCode":"creds := GenerateCredentials(\"cassandra\", config)\nif len(creds) == 0 {\n    log.Fatal(\"no cassandra credentials configured; supply usernames/passwords in the scan config\")\n}","typeGuard":null,"tryCatchPattern":"res, err := plugin.Scan(target)\nif err != nil && strings.Contains(err.Error(), \"no_credentials\") {\n    log.Printf(\"skipping cassandra scan: %v\", err)\n    return\n}","preventionTips":["Always configure at least one credential source per service in the scan config.","Validate credential wordlist paths exist and are readable at startup.","Unit-test GenerateCredentials for each service name to catch empty outputs from config changes."],"tags":["cassandra","credentials","configuration","scan"],"backgroundTag":"missing-credentials","analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}