projectdiscovery/nuclei · info
not a mssql service
Error message
not a mssql service
What it means
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.
Source
Thrown at pkg/js/libs/mssql/fingerprint.go:19
package mssql
import (
"context"
"encoding/binary"
"encoding/hex"
"errors"
"fmt"
"io"
"net"
"time"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/protocolstate"
)
// errNotMssql marks a completed probe whose response is not a valid MSSQL
// pre-login reply. IsMssql maps this to (false, nil); FingerprintMssql still
// surfaces it as an error.
var errNotMssql = errors.New("not a mssql service")
const (
mssqlFingerprintTimeout = 5 * time.Second
tdsTypeTabularResult = 0x04
tdsStatusEOM = 0x01
tdsTerminator = 0xff
plTokenVersion = 0x00
plTokenEncryption = 0x01
plTokenInstOpt = 0x02
plTokenThreadID = 0x03
plTokenMars = 0x04
plTokenTraceID = 0x05
encryptOff = 0x00
encryptOn = 0x01
encryptNotSup = 0x02View on GitHub (pinned to 265b3a3dec)
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
Example fix
// before
fp, err := mssql.FingerprintMssql(host, port)
if err != nil { return err }
// after
fp, err := mssql.FingerprintMssql(host, port)
if errors.Is(err, mssql.ErrNotMssql) { return nil } // not mssql, not a failure Defensive patterns
Strategy: try-catch
Type guard
func isNotMssql(err error) bool { return errors.Is(err, mssql.ErrNotMssql) } Try / catch
isMssql, err := mssql.IsMssql(host, port) // preferred: never errors for non-mssql
if err != nil { // transport-level failure, distinct from 'not mssql'
log.Debugf("mssql probe %s:%d: %v", host, port, err)
}
// or with FingerprintMssql:
fp, err := mssql.FingerprintMssql(host, port)
if errors.Is(err, mssql.ErrNotMssql) { /* verdict: service is not mssql */ } Prevention
- Prefer IsMssql for boolean verdicts
- Reserve FingerprintMssql for ports already suspected to be TDS
- Treat errNotMssql as data, not failure
When it happens
Trigger: 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.
Common situations: Scanning mixed-service ports (3306, 5432, 445) with the mssql network helper; port 1433 redirected to another protocol.
Related errors
- %w: invalid TDS packet length %d
- %w: %v
- unexpected TDS type 0x%02x
- unexpected TDS status 0x%02x
- invalid host or port
AI-assisted analysis of projectdiscovery/nuclei@265b3a3dec (2026-08-15).
Data as JSON: /api/errors/8e0048eaa37e6125.
Report an issue: GitHub.