projectdiscovery/nuclei · error
failed to send MS-TNAP login packet: %w
Error message
failed to send MS-TNAP login packet: %w
What it means
Thrown by telnet.DetectNTLM when writing the crafted MS-TNAP login packet to the TCP connection fails. The dial itself succeeded (protocolstate dialer connected, a 10-second deadline was set), but the subsequent conn.Write of telnetmini.CreateTNAPLoginPacket() returned an error — the connection was broken between dial and write, typically a reset by the server or a middlebox.
Source
Thrown at pkg/js/libs/telnet/telnet.go:253
}()
// Create telnet client using the telnetmini library
client := telnetmini.New(conn)
defer func() {
_ = client.Close()
}()
// Set timeout
_ = conn.SetDeadline(time.Now().Add(10 * time.Second))
// Use the MS-TNAP packet crafting functions from our telnetmini library
// Create MS-TNAP Login Packet (Option Command IS) as per Nmap script
tnapLoginPacket := telnetmini.CreateTNAPLoginPacket()
// Send the MS-TNAP login packet
_, err = conn.Write(tnapLoginPacket)
if err != nil {
return nil, fmt.Errorf("failed to send MS-TNAP login packet: %w", err)
}
// Read response data
buffer := make([]byte, 4096)
n, err := conn.Read(buffer)
if err != nil {
return nil, fmt.Errorf("failed to read response: %w", err)
}
if n == 0 {
return nil, fmt.Errorf("no response received")
}
// Parse NTLM response using our telnetmini library functions
response := buffer[:n]
// Use the parsing functions from our library instead of reimplementing
// This should use the NTLM parsing functions we added to telnetminiView on GitHub (pinned to 265b3a3dec)
Solutions
- Verify the target actually speaks telnet on that port before calling DetectNTLM
- Retry once — transient resets are common during scanning
- Check local egress/firewall rules if every host fails at the write step
Defensive patterns
Strategy: retry
Validate before calling
// confirm the port actually speaks telnet before the NTLM probe // (e.g. banner check), then call DetectNTLM
Try / catch
let r = null; for (let i = 0; i < 2 && !r; i++) { try { r = client.DetectNTLM(host, port); } catch (e) { if (!String(e).includes('send MS-TNAP')) throw e; } } Prevention
- Verify service identity (banner) before MS-TNAP probes
- Expect mid-handshake resets when scanning; make one retry part of the flow
- Check egress rules when write failures are universal
When it happens
Trigger: Target accepts the TCP handshake but immediately resets non-telnet or suspicious traffic; a firewall/IPS dropping the MS-TNAP packet; the service closing the connection during protocol negotiation before this step; transient network failure mid-handshake.
Common situations: Scanning hosts where port 23 is forwarded to a non-telnet service; security devices resetting anomalous payloads; flaky links to distant targets.
Related errors
- no response received
- failed to read response: %w
- failed to parse NTLM response: %w
- authentication failed
- prompt not found (read cap reached)
AI-assisted analysis of projectdiscovery/nuclei@265b3a3dec (2026-08-15).
Data as JSON: /api/errors/60be5ba4486d13d4.
Report an issue: GitHub.