{"record":{"id":"8e0048eaa37e6125","repo":"projectdiscovery/nuclei","slug":"not-a-mssql-service","errorCode":null,"errorMessage":"not a mssql service","messagePattern":"not a mssql service","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"pkg/js/libs/mssql/fingerprint.go","lineNumber":19,"sourceCode":"package mssql\n\nimport (\n\t\"context\"\n\t\"encoding/binary\"\n\t\"encoding/hex\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"time\"\n\n\t\"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/protocolstate\"\n)\n\n// errNotMssql marks a completed probe whose response is not a valid MSSQL\n// pre-login reply. IsMssql maps this to (false, nil); FingerprintMssql still\n// surfaces it as an error.\nvar errNotMssql = errors.New(\"not a mssql service\")\n\nconst (\n\tmssqlFingerprintTimeout = 5 * time.Second\n\n\ttdsTypeTabularResult = 0x04\n\ttdsStatusEOM         = 0x01\n\ttdsTerminator        = 0xff\n\n\tplTokenVersion    = 0x00\n\tplTokenEncryption = 0x01\n\tplTokenInstOpt    = 0x02\n\tplTokenThreadID   = 0x03\n\tplTokenMars       = 0x04\n\tplTokenTraceID    = 0x05\n\n\tencryptOff    = 0x00\n\tencryptOn     = 0x01\n\tencryptNotSup = 0x02","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/js/libs/mssql/fingerprint.go#L1-L37","documentation":"Internal probe-result error from the mssql fingerprint helper. errNotMssql marks a TCP probe that completed (connection and reply received) but whose bytes are not a valid TDS pre-login reply. By design IsMssql() maps it to (false, nil) — 'probe finished, service is not MSSQL' — while FingerprintMssql() surfaces it as a Go error to the caller.","triggerScenarios":"Calling FingerprintMssql on a port running MySQL, PostgreSQL, SMB, or any non-TDS service; calling IsMssql on the same ports returns false with no error.","commonSituations":"Scanning mixed-service ports (3306, 5432, 445) with the mssql network helper; port 1433 redirected to another protocol.","solutions":["Use IsMssql instead of FingerprintMssql when a boolean verdict without an error is wanted","Treat this error from FingerprintMssql as 'not MSSQL' rather than a failure of the probe itself","Only run the mssql helper against ports you expect to speak TDS"],"exampleFix":"// before\nfp, err := mssql.FingerprintMssql(host, port)\nif err != nil { return err }\n// after\nfp, err := mssql.FingerprintMssql(host, port)\nif errors.Is(err, mssql.ErrNotMssql) { return nil } // not mssql, not a failure","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"func isNotMssql(err error) bool { return errors.Is(err, mssql.ErrNotMssql) }","tryCatchPattern":"isMssql, err := mssql.IsMssql(host, port) // preferred: never errors for non-mssql\nif err != nil { // transport-level failure, distinct from 'not mssql'\n    log.Debugf(\"mssql probe %s:%d: %v\", host, port, err)\n}\n// or with FingerprintMssql:\nfp, err := mssql.FingerprintMssql(host, port)\nif errors.Is(err, mssql.ErrNotMssql) { /* verdict: service is not mssql */ }","preventionTips":["Prefer IsMssql for boolean verdicts","Reserve FingerprintMssql for ports already suspected to be TDS","Treat errNotMssql as data, not failure"],"tags":["mssql","fingerprinting","network-protocol","service-detection"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}