{"record":{"id":"b7012cdf8b713682","repo":"shadow1ng/fscan","slug":"smbv2-negotiate-read-failed-w","errorCode":null,"errorMessage":"smbv2_negotiate_read_failed: %w","messagePattern":"smbv2_negotiate_read_failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/services/smb_protocol.go","lineNumber":309,"sourceCode":"// probeSMBv2 处理SMBv2协议信息收集\nfunc probeSMBv2(ctx context.Context, target string, timeout time.Duration, session *common.ScanSession) (*SMBTarget, error) {\n\tconn2, err := session.DialTCP(ctx, \"tcp\", target, timeout)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(i18n.Tr(\"service_connection_failed\", \"%w\"), err)\n\t}\n\tdefer func() { _ = conn2.Close() }()\n\n\t_ = conn2.SetDeadline(time.Now().Add(timeout))\n\n\t// 发送SMBv2协商包\n\t_, err = conn2.Write(smbv2NegotiatePacket)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s: %w\", i18n.GetText(\"smbv2_negotiate_send_failed\"), err)\n\t}\n\n\tr2, err := readSMBMessage(conn2)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s: %w\", i18n.GetText(\"smbv2_negotiate_read_failed\"), err)\n\t}\n\n\t// 构建NTLM数据包\n\tvar ntlmData []byte\n\tif len(r2) > 70 && hex.EncodeToString(r2[70:71]) == \"03\" {\n\t\tflags := []byte{0x15, 0x82, 0x08, 0xa0}\n\t\tntlmData = buildNTLMSSPData(flags)\n\t} else {\n\t\tflags := []byte{0x05, 0x80, 0x08, 0xa0}\n\t\tntlmData = buildNTLMSSPData(flags)\n\t}\n\n\t// 发送Session Setup\n\t_, err = conn2.Write(smbv2SessionSetupPacket)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s: %w\", i18n.GetText(\"smbv2_session_send_failed\"), err)\n\t}\n","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/plugins/services/smb_protocol.go#L291-L327","documentation":"Guard in probeSMBv2: reading the SMBv2 negotiate response failed (timeout/reset), so the dialect and capabilities offered by the server cannot be determined and SMBv2 probing aborts.","triggerScenarios":"Thrown at plugins/services/smb_protocol.go:309 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry with an increased deadline","Verify the target speaks SMBv2 on the port","Check network stability to the host"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}