{"record":{"id":"56a1cf1243c94af8","repo":"shadow1ng/fscan","slug":"service-not-identified","errorCode":null,"errorMessage":"service_not_identified","messagePattern":"service_not_identified","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"plugins/services/mssql.go","lineNumber":158,"sourceCode":"\t\tstate.IncrementTCPSuccessPacketCount()\n\t}\n\n\tvar banner string\n\terrLower := \"\"\n\tif err != nil {\n\t\terrLower = strings.ToLower(err.Error())\n\t}\n\n\tif err == nil || (result != nil && result.isMSSQL()) ||\n\t\t(strings.Contains(errLower, \"login failed\") ||\n\t\t\tstrings.Contains(errLower, \"mssql\") ||\n\t\t\tstrings.Contains(errLower, \"sql server\")) {\n\t\tbanner = \"MSSQL\"\n\t} else {\n\t\treturn &ScanResult{\n\t\t\tSuccess: false,\n\t\t\tService: \"mssql\",\n\t\t\tError:   fmt.Errorf(\"%s\", i18n.Tr(\"service_not_identified\", \"MSSQL\")),\n\t\t}\n\t}\n\n\tsession.LogSuccess(i18n.Tr(\"mssql_service\", target, banner))\n\n\treturn &ScanResult{\n\t\tType:    plugins.ResultTypeService,\n\t\tSuccess: true,\n\t\tService: \"mssql\",\n\t\tBanner:  banner,\n\t}\n}\n\nfunc init() {\n\tRegisterPluginWithPorts(\"mssql\", func() Plugin {\n\t\treturn NewMSSQLPlugin()\n\t}, []int{1433, 1434})\n}","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/plugins/services/mssql.go#L140-L176","documentation":"identifyService probes the target and tries to classify the response banner as MSSQL by looking for markers such as 'sql server' in the response/error text. When the banner cannot be identified as MSSQL, it returns a failed ScanResult with i18n message 'service_not_identified' parameterized with 'MSSQL'.","triggerScenarios":"Scan → identifyService: the probe response (or its error text) contains none of the expected markers (e.g. 'sql server'), so the else-branch fires. Typical with non-MSSQL services on port 1433, TLS-wrapped TDS banners, or locally translated/obscure server error text.","commonSituations":"Scanning a MySQL/PostgreSQL port mislabeled as 1433; SQL Server configured to hide its version; proxy or VPN altering the banner; a case variant not matched by strings.Contains on errLower.","solutions":["Verify the target port actually runs MSSQL/TDS (1433 or configured port)","Widen the banner match to include more SQL Server error markers or use a TDS prelogin probe","Bypass identification by forcing the mssql plugin if the service is known","Inspect the raw probe response to add the missing banner keyword to the match list"],"exampleFix":"// before\n} else {\n    return &ScanResult{Success: false, Error: fmt.Errorf(\"%s\", i18n.Tr(\"service_not_identified\", \"MSSQL\"))}\n}\n// after\n} else if strings.Contains(errLower, \"microsoft\") || strings.Contains(errLower, \"tds\") {\n    banner = \"MSSQL\"\n} else {\n    return &ScanResult{Success: false, Error: fmt.Errorf(\"%s\", i18n.Tr(\"service_not_identified\", \"MSSQL\"))}\n}","handlingStrategy":"fallback","validationCode":"// confirm the service before running MSSQL identification\nconn, err := net.DialTimeout(\"tcp\", target, 5*time.Second)\nif err != nil { return err }\n// send a TDS prelogin and check the response mentions SQL Server\nbanner, err := probeTDSBanner(conn)\nif err != nil || !strings.Contains(strings.ToLower(banner), \"sql server\") {\n    return errors.New(\"target does not look like MSSQL; skipping plugin\")\n}","typeGuard":null,"tryCatchPattern":"res := plugin.Scan(info, config, state)\nif !res.Success && res.Error != nil && strings.Contains(res.Error.Error(), \"service_not_identified\") {\n    // fall back to a generic port/service scan to classify the target\n    log.Printf(\"service not identified as MSSQL: %v\", res.Error)\n}","preventionTips":["Only run the mssql plugin against ports verified to speak TDS","Extend banner-matching keywords when new SQL Server error variants appear","Force the plugin explicitly when the service is already known","Capture raw probe output when identification fails to refine matches"],"tags":["mssql","service-detection","banner","go"],"backgroundTag":"unexpected-response-shape","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"}