{"record":{"id":"b10b0664a89db3ff","repo":"shadow1ng/fscan","slug":"netbios-session-connect-failed-w","errorCode":null,"errorMessage":"netbios_session_connect_failed: %w","messagePattern":"netbios_session_connect_failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/services/netbios.go","lineNumber":196,"sourceCode":"\t\treturn nil, fmt.Errorf(\"%s: %w\", i18n.GetText(\"netbios_query_send_failed\"), err)\n\t}\n\n\tresponse := make([]byte, 1024)\n\tn, err := conn.Read(response)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s: %w\", i18n.GetText(\"netbios_response_read_failed\"), err)\n\t}\n\n\treturn p.parseNetBIOSNames(response[:n])\n}\n\n// queryNetBIOSSession 查询NetBIOS会话服务(TCP 139)\nfunc (p *NetBIOSPlugin) queryNetBIOSSession(ctx context.Context, host string, session *common.ScanSession) (*NetBIOSInfo, error) {\n\ttarget := fmt.Sprintf(\"%s:139\", host)\n\n\tconn, err := session.DialTCP(ctx, \"tcp\", target, session.Config.ModuleTimeout())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s: %w\", i18n.GetText(\"netbios_session_connect_failed\"), err)\n\t}\n\tdefer func() { _ = conn.Close() }()\n\n\t_ = conn.SetDeadline(time.Now().Add(session.Config.ModuleTimeout()))\n\n\t// 发送SMB协商数据包\n\tsmbNegotiate1 := []byte{\n\t\t0x00, 0x00, 0x00, 0x85, 0xFF, 0x53, 0x4D, 0x42, 0x72, 0x00, 0x00, 0x00, 0x00, 0x18, 0x53, 0xC8,\n\t\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFE,\n\t\t0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x00, 0x02, 0x50, 0x43, 0x20, 0x4E, 0x45, 0x54, 0x57, 0x4F,\n\t\t0x52, 0x4B, 0x20, 0x50, 0x52, 0x4F, 0x47, 0x52, 0x41, 0x4D, 0x20, 0x31, 0x2E, 0x30, 0x00, 0x02,\n\t\t0x4C, 0x41, 0x4E, 0x4D, 0x41, 0x4E, 0x31, 0x2E, 0x30, 0x00, 0x02, 0x57, 0x69, 0x6E, 0x64, 0x6F,\n\t\t0x77, 0x73, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x57, 0x6F, 0x72, 0x6B, 0x67, 0x72, 0x6F, 0x75, 0x70,\n\t\t0x73, 0x20, 0x33, 0x2E, 0x31, 0x61, 0x00, 0x02, 0x4C, 0x4D, 0x31, 0x2E, 0x32, 0x58, 0x30, 0x30,\n\t\t0x32, 0x00, 0x02, 0x4C, 0x41, 0x4E, 0x4D, 0x41, 0x4E, 0x32, 0x2E, 0x31, 0x00, 0x02, 0x4E, 0x54,\n\t\t0x20, 0x4C, 0x4D, 0x20, 0x30, 0x2E, 0x31, 0x32, 0x00,\n\t}\n","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/plugins/services/netbios.go#L178-L214","documentation":"Guard in queryNetBIOSSession: session.DialTCP failed to open a TCP connection to host:139 within the configured timeout. The NetBIOS session service is unreachable (closed port, filtered host, or timeout), so no SMB session probe can be performed.","triggerScenarios":"Thrown at plugins/services/netbios.go:196 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify TCP 139 is open on the target","Increase the module timeout","Check for firewall/IPS blocking the session-service port"],"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"}