{"record":{"id":"4485109ed1955441","repo":"shadow1ng/fscan","slug":"smbv1-session-read-failed-w","errorCode":null,"errorMessage":"smbv1_session_read_failed: %w","messagePattern":"smbv1_session_read_failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/services/smb_protocol.go","lineNumber":247,"sourceCode":"\tif len(r1) > 0 {\n\t\treturn probeSMBv1(conn, target, timeout)\n\t}\n\n\t// SMBv2路径\n\treturn probeSMBv2(ctx, target, timeout, session)\n}\n\n// probeSMBv1 处理SMBv1协议信息收集\nfunc probeSMBv1(conn net.Conn, target string, timeout time.Duration) (*SMBTarget, error) {\n\t// 发送Session Setup请求\n\t_, err := conn.Write(smbv1SessionSetupPacket)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s: %w\", i18n.GetText(\"smbv1_session_send_failed\"), err)\n\t}\n\n\tret, err := readSMBMessage(conn)\n\tif err != nil || len(ret) < 47 {\n\t\treturn nil, fmt.Errorf(\"%s: %w\", i18n.GetText(\"smbv1_session_read_failed\"), err)\n\t}\n\n\tinfo := &SMBTarget{\n\t\tProtocol: SMBProtocol1,\n\t}\n\n\t// 解析blob信息\n\tblobLength := int(bytesToUint16(ret[43:45]))\n\tblobCount := int(bytesToUint16(ret[45:47]))\n\n\tgssNative := ret[47:]\n\tgssLen := len(gssNative)\n\n\t// 校验远端返回的偏移量\n\tif blobLength > gssLen || blobCount > gssLen || blobLength > blobCount {\n\t\treturn info, nil\n\t}\n","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/plugins/services/smb_protocol.go#L229-L265","documentation":"Guard in probeSMBv1: reading the Session Setup response failed or returned fewer than 47 bytes, so the SMB header plus parameters cannot be parsed and SMBv1 target info (dialect, OS) is unavailable.","triggerScenarios":"Thrown at plugins/services/smb_protocol.go:247 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry with a longer deadline","Confirm the server fully supports SMBv1 session setup","Fall back to SMBv2 probing"],"exampleFix":null,"handlingStrategy":"fallback","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"}