shadow1ng/fscan · error

smbv1_negotiate_send_failed: %w

Error message

smbv1_negotiate_send_failed: %w

What it means

Guard in probeTarget: writing the SMBv1 negotiate packet to the freshly opened TCP connection failed. The connection was established but the write errored (reset, deadline, or broken socket), so SMB protocol probing cannot begin.

Source

Thrown at plugins/services/smb_protocol.go:219

		"\x00\x00\x00\x00"
)

// probeTarget 探测目标SMB信息(协议版本、系统信息)
func probeTarget(ctx context.Context, host string, port int, timeout time.Duration, session *common.ScanSession) (*SMBTarget, error) {
	target := net.JoinHostPort(host, strconv.Itoa(port))

	conn, err := session.DialTCP(ctx, "tcp", target, timeout)
	if err != nil {
		return nil, fmt.Errorf(i18n.Tr("service_connection_failed", "%w"), err)
	}
	defer func() { _ = conn.Close() }()

	_ = conn.SetDeadline(time.Now().Add(timeout))

	// 首先尝试SMBv1协商
	_, err = conn.Write(smbv1NegotiatePacket)
	if err != nil {
		return nil, fmt.Errorf("%s: %w", i18n.GetText("smbv1_negotiate_send_failed"), err)
	}

	// 读取SMBv1协商响应
	r1, err := readSMBMessage(conn)
	if err != nil {
		session.LogDebug(i18n.Tr("smbv1_negotiate_read_failed", err))
	}

	// 检查是否支持SMBv1
	if len(r1) > 0 {
		return probeSMBv1(conn, target, timeout)
	}

	// SMBv2路径
	return probeSMBv2(ctx, target, timeout, session)
}

// probeSMBv1 处理SMBv1协议信息收集

View on GitHub (pinned to 95cc12e753)

Solutions

  1. Retry the probe on a new connection
  2. Increase the deadline; overloaded hosts drop writes
  3. Check for IPS resetting SMB connections
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at plugins/services/smb_protocol.go:219 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/5a64225c41a5d67a. Report an issue: GitHub.