{"record":{"id":"bc01fc992d8b35e0","repo":"shadow1ng/fscan","slug":"dial-err-v","errorCode":null,"errorMessage":"[dial err] %v","messagePattern":"\\[dial err\\] (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"libs/grdp/login/screen.go","lineNumber":130,"sourceCode":"\t\tpassword, _ := u.User.Password()\n\t\tauth.Password = password\n\t\tdailer, err = proxy.SOCKS5(\"tcp\", address, &auth, forward)\n\t} else {\n\t\tdailer, err = proxy.SOCKS5(\"tcp\", address, nil, forward)\n\t}\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn dailer, nil\n}\n\n// NlaAuthOnly 仅进行NLA认证验证凭据，不建立RDP会话\n// 这样不会挤掉已登录的用户\nfunc (g *Client) NlaAuthOnly(domain, user, pwd string, timeout int64) (bool, error) {\n\tconn, err := WrapperTcpWithTimeout(\"tcp\", g.Host, time.Duration(timeout)*time.Second)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"[dial err] %v\", err)\n\t}\n\tdefer conn.Close()\n\n\tg.tpkt = tpkt.New(core.NewSocketLayer(conn), nla.NewNTLMv2(domain, user, pwd))\n\tg.x224 = x224.New(g.tpkt)\n\n\t// 设置NLA仅验证模式\n\tg.tpkt.SetNLAAuthOnly(true)\n\n\t// 使用 PROTOCOL_HYBRID (NLA) 协议\n\tg.x224.SetRequestedProtocol(x224.PROTOCOL_HYBRID)\n\n\t// 用于接收结果的通道\n\tresultChan := make(chan error, 1)\n\n\t// 监听错误事件（包括 ErrNLAAuthSuccess）\n\tg.x224.On(\"error\", func(err error) {\n\t\tresultChan <- err","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/libs/grdp/login/screen.go#L112-L148","documentation":"NlaAuthOnly wraps the TCP dial error when opening a raw connection to the RDP host for NLA (CredSSP/NTLMv2) credential verification. The library could not establish the initial TCP socket within the given timeout; the underlying OS/net error is interpolated into the message. No RDP protocol negotiation has happened yet, so the failure is purely at the network layer.","triggerScenarios":"Calling Client.NlaAuthOnly (directly or via NlaAuth) with an unreachable g.Host, a closed port (typically 3389), a firewall dropping packets, DNS resolution failure, or a timeout shorter than the network RTT.","commonSituations":"Scanning hosts that are offline or not running RDP; wrong port in the host string (e.g. missing ':3389' or custom port); the target blocks the scanner IP; timeout value too small for slow WAN links.","solutions":["Verify the host is reachable: run `nc -vz <host> 3389` (or the configured port) from the same machine.","Check the wrapped error text after '[dial err]' — 'connection refused' means RDP not listening; 'i/o timeout' means firewall/latency; 'no such host' means DNS.","Increase the timeout parameter passed to NlaAuthOnly.","Confirm the Host field is formatted as 'host:port' and points at the RDP service."],"exampleFix":"// before\ng.Host = \"192.168.1.10\" // no port, or service on nonstandard port\n// after\ng.Host = \"192.168.1.10:3389\"","handlingStrategy":"retry","validationCode":"func hostReachable(host string) error {\n\tconn, err := net.DialTimeout(\"tcp\", host, 5*time.Second)\n\tif err != nil { return err }\n\tconn.Close()\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":"ok, err := client.NlaAuthOnly(domain, user, pwd, timeout)\nif err != nil && strings.Contains(err.Error(), \"[dial err]\") {\n\t// network-layer failure: backoff and retry, don't count as bad credentials\n\treturn retryWithBackoff(...)\n}","preventionTips":["Pre-flight TCP reachability check before NLA probes.","Use host:port format explicitly in Client.Host.","Set timeout >= network RTT plus margin.","Rate-limit scans to avoid firewall tarpitting."],"tags":["network","tcp","rdp","nla","dial"],"backgroundTag":"connection-refused","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"}