shadow1ng/fscan · error

netbios_response_read_failed: %w

Error message

netbios_response_read_failed: %w

What it means

Guard in queryNetBIOSNames: the query was sent but conn.Read of the 1024-byte response buffer failed (timeout or ICMP port-unreachable). No name-service reply arrived within the deadline, so there is nothing to parse.

Source

Thrown at plugins/services/netbios.go:184

	conn, err := net.DialTimeout("udp", target, config.ModuleTimeout())
	if err != nil {
		return nil, fmt.Errorf("%s: %w", i18n.GetText("netbios_name_connect_failed"), err)
	}
	state.IncrementUDPPacketCount()
	defer func() { _ = conn.Close() }()

	_ = conn.SetDeadline(time.Now().Add(config.ModuleTimeout()))

	_, err = conn.Write(queryPacket)
	if err != nil {
		return nil, fmt.Errorf("%s: %w", i18n.GetText("netbios_query_send_failed"), err)
	}

	response := make([]byte, 1024)
	n, err := conn.Read(response)
	if err != nil {
		return nil, fmt.Errorf("%s: %w", i18n.GetText("netbios_response_read_failed"), err)
	}

	return p.parseNetBIOSNames(response[:n])
}

// queryNetBIOSSession 查询NetBIOS会话服务(TCP 139)
func (p *NetBIOSPlugin) queryNetBIOSSession(ctx context.Context, host string, session *common.ScanSession) (*NetBIOSInfo, error) {
	target := fmt.Sprintf("%s:139", host)

	conn, err := session.DialTCP(ctx, "tcp", target, session.Config.ModuleTimeout())
	if err != nil {
		return nil, fmt.Errorf("%s: %w", i18n.GetText("netbios_session_connect_failed"), err)
	}
	defer func() { _ = conn.Close() }()

	_ = conn.SetDeadline(time.Now().Add(session.Config.ModuleTimeout()))

	// 发送SMB协商数据包

View on GitHub (pinned to 95cc12e753)

Solutions

  1. Confirm the host answers NetBIOS name queries on UDP 137
  2. Allow UDP 137 through firewalls in both directions
  3. Retry, as UDP responses can be dropped
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at plugins/services/netbios.go:184 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of shadow1ng/fscan@95cc12e753 (2026-09-06). Data as JSON: /api/errors/c02fc364236b7bcb. Report an issue: GitHub.