{"record":{"id":"60be5ba4486d13d4","repo":"projectdiscovery/nuclei","slug":"failed-to-send-ms-tnap-login-packet-w","errorCode":null,"errorMessage":"failed to send MS-TNAP login packet: %w","messagePattern":"failed to send MS-TNAP login packet: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/js/libs/telnet/telnet.go","lineNumber":253,"sourceCode":"\t}()\n\n\t// Create telnet client using the telnetmini library\n\tclient := telnetmini.New(conn)\n\tdefer func() {\n\t\t_ = client.Close()\n\t}()\n\n\t// Set timeout\n\t_ = conn.SetDeadline(time.Now().Add(10 * time.Second))\n\n\t// Use the MS-TNAP packet crafting functions from our telnetmini library\n\t// Create MS-TNAP Login Packet (Option Command IS) as per Nmap script\n\ttnapLoginPacket := telnetmini.CreateTNAPLoginPacket()\n\n\t// Send the MS-TNAP login packet\n\t_, err = conn.Write(tnapLoginPacket)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to send MS-TNAP login packet: %w\", err)\n\t}\n\n\t// Read response data\n\tbuffer := make([]byte, 4096)\n\tn, err := conn.Read(buffer)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read response: %w\", err)\n\t}\n\n\tif n == 0 {\n\t\treturn nil, fmt.Errorf(\"no response received\")\n\t}\n\n\t// Parse NTLM response using our telnetmini library functions\n\tresponse := buffer[:n]\n\n\t// Use the parsing functions from our library instead of reimplementing\n\t// This should use the NTLM parsing functions we added to telnetmini","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/js/libs/telnet/telnet.go#L235-L271","documentation":"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.","triggerScenarios":"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.","commonSituations":"Scanning hosts where port 23 is forwarded to a non-telnet service; security devices resetting anomalous payloads; flaky links to distant targets.","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"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// confirm the port actually speaks telnet before the NTLM probe\n// (e.g. banner check), then call DetectNTLM","typeGuard":null,"tryCatchPattern":"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; } }","preventionTips":["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"],"tags":["telnet","javascript","nuclei","network","ntlm"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}