shadow1ng/fscan · error

no transport

Error message

no transport

What it means

X224.Connect() refuses to run the RDP connection-request handshake when no underlying transport has been set. The X224 layer is a wrapper over a transport (typically the TCP layer) and must be wired up before connecting. This is a programming/setup error, not a network failure.

Source

Thrown at libs/grdp/protocol/x224/x224.go:233

		return 0, err
	}
	buff.Write(b)

	glog.Trace("x224 write:", hex.EncodeToString(buff.Bytes()))
	return x.transport.Write(buff.Bytes())
}

func (x *X224) Close() error {
	return x.transport.Close()
}

func (x *X224) SetRequestedProtocol(p uint32) {
	x.requestedProtocol = p
}

func (x *X224) Connect() error {
	if x.transport == nil {
		return errors.New("no transport")
	}
	cookie := "Cookie: mstshash=bob"
	message := NewClientConnectionRequestPDU([]byte(cookie), x.requestedProtocol)
	message.ProtocolNeg.Type = TYPE_RDP_NEG_REQ
	message.ProtocolNeg.Result = uint32(x.requestedProtocol)

	glog.Debug("x224 sendConnectionRequest", hex.EncodeToString(message.Serialize()))
	_, err := x.transport.Write(message.Serialize())
	x.transport.Once("data", x.recvConnectionConfirm)
	return err
}

func (x *X224) recvConnectionConfirm(s []byte) {
	/*
		在Windows的远程桌面协议(RDP)交互过程中,NLA是指网络级别身份验证(Network Level Authentication)。NLA是一种用于增强远程桌面连接安全性的机制。在启用了NLA的情况下,客户端必须在建立RDP会话之前通过网络级别的身份验证,这样可以防止未经授权的用户连接到远程桌面服务器。

		NLA的优点
		提高安全性:在建立RDP会话之前进行身份验证,确保只有经过验证的用户才能连接。

View on GitHub (pinned to 95cc12e753)

Solutions

  1. Ensure the transport (e.g. TCP client) is created and assigned to the X224 layer before calling Connect().
  2. Check the error returned by the transport dial step; if it failed, do not proceed to X224.Connect().
  3. If the transport was closed, rebuild the whole stack (transport + X224) rather than reusing the instance.
  4. Use the library's high-level client constructor instead of assembling X224 manually.

Example fix

// before
x224 := t125.NewX224(...)
err := x224.Connect() // transport never assigned
// after
transport, err := core.NewTransport(conn)
if err != nil {
    return err
}
x224 := t125.NewX224(transport)
err = x224.Connect()
Defensive patterns

Strategy: validation

Validate before calling

if x224 == nil || x224.transport == nil {
    return errors.New("x224 transport must be set before Connect()")
}

Try / catch

if err := x224.Connect(); err != nil {
    if err.Error() == "no transport" {
        return fmt.Errorf("protocol stack misconfigured: %w", err)
    }
    return err
}

Prevention

When it happens

Trigger: Calling x224.Connect() (directly or via NlaAuthOnly / ProbeOSInfo) on an X224 instance whose transport field is nil because NewClientCreate... was never given a transport or the transport setup step was skipped/failed.

Common situations: Calling Connect() before NewClient / transport dial succeeded; reusing an X224 object after its transport was closed and nilled; building the protocol stack by hand and forgetting the transport layer.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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