{"record":{"id":"86d7625f42fda4c8","repo":"shadow1ng/fscan","slug":"smbv2-session-send-failed-w","errorCode":null,"errorMessage":"smbv2_session_send_failed: %w","messagePattern":"smbv2_session_send_failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/services/smb_protocol.go","lineNumber":325,"sourceCode":"\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\n\t_, err = readSMBMessage(conn2)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s: %w\", i18n.GetText(\"smbv2_session_read_failed\"), err)\n\t}\n\n\t// 发送NTLM协商包\n\t_, err = conn2.Write(ntlmData)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s: %w\", i18n.GetText(\"smbv2_ntlm_send_failed\"), err)\n\t}\n\n\tret, err := readSMBMessage(conn2)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s: %w\", i18n.GetText(\"smbv2_ntlm_read_failed\"), err)\n\t}\n","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/plugins/services/smb_protocol.go#L307-L343","documentation":"Guard in probeSMBv2: writing the Session Setup request after negotiate failed. Without the session-setup exchange the NTLM challenge/response flow cannot proceed, so no host fingerprint (OS info) is collected.","triggerScenarios":"Thrown at plugins/services/smb_protocol.go:325 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the probe","Raise the connection deadline","Verify the server accepts anonymous session setup requests"],"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-14T00:17:10.932Z"}