{"record":{"id":"92ca2a724264f568","repo":"shadow1ng/fscan","slug":"netbios-query-send-failed-w","errorCode":null,"errorMessage":"netbios_query_send_failed: %w","messagePattern":"netbios_query_send_failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/services/netbios.go","lineNumber":178,"sourceCode":"\t\t0x20, 0x43, 0x4B, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41,\n\t\t0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41,\n\t\t0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x00, 0x00, 0x21, 0x00, 0x01,\n\t}\n\n\ttarget := fmt.Sprintf(\"%s:137\", host)\n\n\tconn, err := net.DialTimeout(\"udp\", target, config.ModuleTimeout())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s: %w\", i18n.GetText(\"netbios_name_connect_failed\"), err)\n\t}\n\tstate.IncrementUDPPacketCount()\n\tdefer func() { _ = conn.Close() }()\n\n\t_ = conn.SetDeadline(time.Now().Add(config.ModuleTimeout()))\n\n\t_, err = conn.Write(queryPacket)\n\tif err != nil {\n\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)","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/plugins/services/netbios.go#L160-L196","documentation":"Guard in queryNetBIOSNames: the UDP socket to port 137 was established but conn.Write of the 50-byte NetBIOS name query packet failed. The query never left the sender, usually due to a closed socket, local network failure, or deadline expiry.","triggerScenarios":"Thrown at plugins/services/netbios.go:178 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check local network interface health and routing","Retry the query; UDP sends can fail transiently","Increase the deadline to accommodate slow networks"],"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"}