Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

高性能且连接错误的情况下出现死锁 #22

Open
dksslq opened this issue May 28, 2023 · 11 comments
Open

高性能且连接错误的情况下出现死锁 #22

dksslq opened this issue May 28, 2023 · 11 comments

Comments

@dksslq
Copy link

dksslq commented May 28, 2023

POC:

package main

import (
        "errors"
        "fmt"
        "log"
        "net"
        "os"
        "sync"
        "time"

        "github.com/tomatome/grdp/core"
        "github.com/tomatome/grdp/glog"
        "github.com/tomatome/grdp/protocol/nla"
        "github.com/tomatome/grdp/protocol/pdu"
        "github.com/tomatome/grdp/protocol/rfb"
        "github.com/tomatome/grdp/protocol/sec"
        "github.com/tomatome/grdp/protocol/t125"
        "github.com/tomatome/grdp/protocol/tpkt"
        "github.com/tomatome/grdp/protocol/x224"
)

type Client struct {
        Host string // ip:port
        tpkt *tpkt.TPKT
        x224 *x224.X224
        mcs  *t125.MCSClient
        sec  *sec.Client
        pdu  *pdu.Client
        vnc  *rfb.RFB
}

func NewClient(host string, logLevel glog.LEVEL) *Client {
        glog.SetLevel(logLevel)
        logger := log.New(os.Stdout, "", 0)
        glog.SetLogger(logger)
        return &Client{
                Host: host,
        }
}

func (g *Client) Login(domain, user, pwd string) error {
        conn, err := net.DialTimeout("tcp", g.Host, 3*time.Second)
        if err != nil {
                return fmt.Errorf("[dial err] %v", err)
        }
        defer conn.Close()
        glog.Info(conn.LocalAddr().String())
        //domain := strings.Split(g.Host, ":")[0]

        g.tpkt = tpkt.New(core.NewSocketLayer(conn), nla.NewNTLMv2(domain, user, pwd))
        g.x224 = x224.New(g.tpkt)
        g.mcs = t125.NewMCSClient(g.x224)
        g.sec = sec.NewClient(g.mcs)
        g.pdu = pdu.NewClient(g.sec)

        g.sec.SetUser(user)
        g.sec.SetPwd(pwd)
        g.sec.SetDomain(domain)
        //g.sec.SetClientAutoReconnect()

        g.tpkt.SetFastPathListener(g.sec)
        g.sec.SetFastPathListener(g.pdu)
        g.pdu.SetFastPathSender(g.tpkt)

        //g.x224.SetRequestedProtocol(x224.PROTOCOL_SSL)
        //g.x224.SetRequestedProtocol(x224.PROTOCOL_RDP)

        err = g.x224.Connect()
        if err != nil {
                return fmt.Errorf("[x224 connect err] %v", err)
        }
        glog.Info("wait connect ok")
        wg := &sync.WaitGroup{}
        wg.Add(1)

        g.pdu.On("error", func(e error) {
                err = e
                glog.Error("error", e)
                wg.Done()
        }).On("close", func() {
                err = errors.New("close")
                glog.Info("on close")
                //wg.Done()
        }).On("success", func() {
                err = nil
                glog.Info("on success")
                //wg.Done()
        }).On("ready", func() {
                glog.Info("on ready")
        }).On("update", func(rectangles []pdu.BitmapData) {
                glog.Info("on update:", rectangles)
        })

        wg.Wait()
        return err
}

func (g *Client) LoginVNC() error {
        conn, err := net.DialTimeout("tcp", g.Host, 3*time.Second)
        if err != nil {
                return fmt.Errorf("[dial err] %v", err)
        }
        defer conn.Close()
        glog.Info(conn.LocalAddr().String())
        //domain := strings.Split(g.Host, ":")[0]

        g.vnc = rfb.NewRFB(rfb.NewRFBConn(conn))
        wg := &sync.WaitGroup{}
        wg.Add(1)

        g.vnc.On("error", func(e error) {
                glog.Info("on error")
                err = e
                glog.Error(e)
                wg.Done()
        }).On("close", func() {
                err = errors.New("close")
                glog.Info("on close")
                //wg.Done()
        }).On("success", func() {
                err = nil
                glog.Info("on success")
                //wg.Done()
        }).On("ready", func() {
                glog.Info("on ready")
        }).On("update", func(b *rfb.BitRect) {
                glog.Info("on update:", b)
        })
        glog.Info("on Wait")
        wg.Wait()
        return err
}

func main() {
        for {
                g := NewClient("127.0.0.1:3389", glog.DEBUG)
                err := g.Login("", "wren", "wren")
                //g := NewClient("192.168.18.100:5902", glog.DEBUG)
                //err := g.LoginVNC()
                if err != nil {
                        fmt.Println("Login:", err)
                }
        }

}

localhost server:

ncat -vnklp 3389 --ssl

Tested on linux

last message:

main.go:73: wait connect ok

Its hang at:

wg.Wait()
@selinuxG
Copy link

同问,此问题解决了吗?

@tomatome
Copy link
Owner

localhost service must be an RDP server, such as xrdp or Windows Remote Desktop Services.

@selinuxG
Copy link

localhost service must be an RDP server, such as xrdp or Windows Remote Desktop Services.

是的,我是windows机器。

@tomatome
Copy link
Owner

localhost service must be an RDP server, such as xrdp or Windows Remote Desktop Services.

是的,我是windows机器。

"Provide the debug information, please."

@selinuxG
Copy link

panic: runtime error: slice bounds out of range [4294967288:2]

goroutine 28106 [running]:
github.com/tomatome/grdp/protocol/nla.(*ChallengeMessage).getTargetName(...)
github.com/tomatome/[email protected]/protocol/nla/ntlm.go:175
github.com/tomatome/grdp/protocol/nla.(*NTLMv2).GetAuthenticateMessage(0xc0026f8000, {0xc0013c81b0, 0x82, 0x82})
github.com/tomatome/[email protected]/protocol/nla/ntlm.go:386 +0x1278
github.com/tomatome/grdp/protocol/tpkt.(*TPKT).recvChallenge(0xc002255680, {0xc0023c4000, 0xbd, 0x400})
github.com/tomatome/[email protected]/protocol/tpkt/tpkt.go:89 +0x2c5
github.com/tomatome/grdp/protocol/tpkt.(*TPKT).StartNLA(0xc002255680)
github.com/tomatome/[email protected]/protocol/tpkt/tpkt.go:74 +0x30a
github.com/tomatome/grdp/protocol/x224.(*X224).recvConnectionConfirm(0xc000a411d0, {0xc0017aef80, 0xf, 0xf})
github.com/tomatome/[email protected]/protocol/x224/x224.go:258 +0x3dc
reflect.Value.call({0x176af80?, 0xc001b50a30?, 0xa2c936?}, {0x193d18c, 0x4}, {0xc0024267b0, 0x1, 0x1?})
reflect/value.go:586 +0xb0b
reflect.Value.Call({0x176af80?, 0xc001b50a30?, 0xc00226fea0?}, {0xc0024267b0?, 0x19260a0?, 0xc0017aef80?})
reflect/value.go:370 +0xbc
github.com/tomatome/grdp/emission.(*Emitter).callListeners.func1({0x176af80?, 0xc001b50a30?, 0xc0017aef6a?})
github.com/tomatome/[email protected]/emission/emitter.go:226 +0x468
created by github.com/tomatome/grdp/emission.(*Emitter).callListeners
github.com/tomatome/[email protected]/emission/emitter.go:201 +0x85

@tomatome
Copy link
Owner

set glog.SetLevel(glog.DEBUG)

Provide complete debug log information

@selinuxG
Copy link

[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[INFO]2023/09/26 19:07:20 rdp.go:80: wait connect ok
[DEBUG]2023/09/26 19:07:20 tpkt.go:165: tpkt recvHeader 0300
[DEBUG]2023/09/26 19:07:20 tpkt.go:165: tpkt recvHeader 0300
[DEBUG]2023/09/26 19:07:20 tpkt.go:165: tpkt recvHeader 0300
[DEBUG]2023/09/26 19:07:20 tpkt.go:173: tptk recvHeader FASTPATH_ACTION_X224, wait for recvExtendedHeader
[DEBUG]2023/09/26 19:07:20 tpkt.go:173: tptk recvHeader FASTPATH_ACTION_X224, wait for recvExtendedHeader
[DEBUG]2023/09/26 19:07:20 tpkt.go:165: tpkt recvHeader 0300
[DEBUG]2023/09/26 19:07:20 tpkt.go:173: tptk recvHeader FASTPATH_ACTION_X224, wait for recvExtendedHeader
[DEBUG]2023/09/26 19:07:20 tpkt.go:173: tptk recvHeader FASTPATH_ACTION_X224, wait for recvExtendedHeader
[DEBUG]2023/09/26 19:07:20 tpkt.go:188: tpkt recvExtendedHeader 0013
[DEBUG]2023/09/26 19:07:20 tpkt.go:188: tpkt recvExtendedHeader 0013
[DEBUG]2023/09/26 19:07:20 tpkt.go:188: tpkt recvExtendedHeader 0013
[DEBUG]2023/09/26 19:07:20 tpkt.go:194: tpkt wait recvData: 19
[DEBUG]2023/09/26 19:07:20 tpkt.go:188: tpkt recvExtendedHeader 0013
[DEBUG]2023/09/26 19:07:20 tpkt.go:194: tpkt wait recvData: 19
[DEBUG]2023/09/26 19:07:20 tpkt.go:199: tpkt recvData 0ed000001234000201080001000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:194: tpkt wait recvData: 19
[DEBUG]2023/09/26 19:07:20 tpkt.go:199: tpkt recvData 0ed000001234000201080001000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:194: tpkt wait recvData: 19
[DEBUG]2023/09/26 19:07:20 tpkt.go:199: tpkt recvData 0ed000001234000201080001000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:199: tpkt recvData 0ed000001234000201080001000000
[DEBUG]2023/09/26 19:07:20 x224.go:209: x224 recvConnectionConfirm 0ed000001234000201080001000000
[DEBUG]2023/09/26 19:07:20 x224.go:209: x224 recvConnectionConfirm 0ed000001234000201080001000000
[DEBUG]2023/09/26 19:07:20 x224.go:209: x224 recvConnectionConfirm 0ed000001234000201080001000000
[DEBUG]2023/09/26 19:07:20 x224.go:209: x224 recvConnectionConfirm 0ed000001234000201080001000000
[DEBUG]2023/09/26 19:07:20 x224.go:215: message: {Type:2 Flag:1 Length:8 Result:1}
[INFO]2023/09/26 19:07:20 x224.go:228: TYPE_RDP_NEG_RSP
[DEBUG]2023/09/26 19:07:20 x224.go:215: message: {Type:2 Flag:1 Length:8 Result:1}
[INFO]2023/09/26 19:07:20 x224.go:228: TYPE_RDP_NEG_RSP
[INFO]2023/09/26 19:07:20 x224.go:246: *** SSL security selected ***
[DEBUG]2023/09/26 19:07:20 x224.go:215: message: {Type:2 Flag:1 Length:8 Result:1}
[INFO]2023/09/26 19:07:20 x224.go:228: TYPE_RDP_NEG_RSP
[INFO]2023/09/26 19:07:20 x224.go:246: *** SSL security selected ***
[DEBUG]2023/09/26 19:07:20 x224.go:215: message: {Type:2 Flag:1 Length:8 Result:1}
[INFO]2023/09/26 19:07:20 x224.go:228: TYPE_RDP_NEG_RSP
[INFO]2023/09/26 19:07:20 x224.go:246: *** SSL security selected ***
[INFO]2023/09/26 19:07:20 x224.go:246: *** SSL security selected ***
[DEBUG]2023/09/26 19:07:20 mcs.go:281: mcs client on connect 1
[DEBUG]2023/09/26 19:07:20 x224.go:182: x224 write: 02f0807f658201880401010401010101ff30190201220201020201000201010201000201010202ffff020102301902010102010102010102010102010002010102020420020102301c0202ffff0202fc170202ffff0201010201000201010202ffff02010204820127000500147c0001811e000800100001c00044756361811001c0d800040008000005200301ca03aa09040000ce0e00004c0031004c0031004c003100640065004d006100630042006f006f006b002d0004000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ca01000000000018000f0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003c02c00030000007264706472000000000080c0726470736e6400000000a0c0636c6970726472000000a0c002c00c000b00000000000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 0300019402f0807f658201880401010401010101ff30190201220201020201000201010201000201010202ffff020102301902010102010102010102010102010002010102020420020102301c0202ffff0202fc170202ffff0201010201000201010202ffff02010204820127000500147c0001811e000800100001c00044756361811001c0d800040008000005200301ca03aa09040000ce0e00004c0031004c0031004c003100640065004d006100630042006f006f006b002d0004000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ca01000000000018000f0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003c02c00030000007264706472000000000080c0726470736e6400000000a0c0636c6970726472000000a0c002c00c000b00000000000000
[DEBUG]2023/09/26 19:07:20 mcs.go:303: mcs wait for data event
[DEBUG]2023/09/26 19:07:20 mcs.go:281: mcs client on connect 1
[DEBUG]2023/09/26 19:07:20 mcs.go:281: mcs client on connect 1
[DEBUG]2023/09/26 19:07:20 x224.go:182: x224 write: 02f0807f658201880401010401010101ff30190201220201020201000201010201000201010202ffff020102301902010102010102010102010102010002010102020420020102301c0202ffff0202fc170202ffff0201010201000201010202ffff02010204820127000500147c0001811e000800100001c00044756361811001c0d800040008000005200301ca03aa09040000ce0e00004c0031004c0031004c003100640065004d006100630042006f006f006b002d0004000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ca01000000000018000f0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003c02c00030000007264706472000000000080c0726470736e6400000000a0c0636c6970726472000000a0c002c00c000b00000000000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 0300019402f0807f658201880401010401010101ff30190201220201020201000201010201000201010202ffff020102301902010102010102010102010102010002010102020420020102301c0202ffff0202fc170202ffff0201010201000201010202ffff02010204820127000500147c0001811e000800100001c00044756361811001c0d800040008000005200301ca03aa09040000ce0e00004c0031004c0031004c003100640065004d006100630042006f006f006b002d0004000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ca01000000000018000f0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003c02c00030000007264706472000000000080c0726470736e6400000000a0c0636c6970726472000000a0c002c00c000b00000000000000
[DEBUG]2023/09/26 19:07:20 mcs.go:303: mcs wait for data event
[DEBUG]2023/09/26 19:07:20 x224.go:182: x224 write: 02f0807f658201880401010401010101ff30190201220201020201000201010201000201010202ffff020102301902010102010102010102010102010002010102020420020102301c0202ffff0202fc170202ffff0201010201000201010202ffff02010204820127000500147c0001811e000800100001c00044756361811001c0d800040008000005200301ca03aa09040000ce0e00004c0031004c0031004c003100640065004d006100630042006f006f006b002d0004000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ca01000000000018000f0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003c02c00030000007264706472000000000080c0726470736e6400000000a0c0636c6970726472000000a0c002c00c000b00000000000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 0300019402f0807f658201880401010401010101ff30190201220201020201000201010201000201010202ffff020102301902010102010102010102010102010002010102020420020102301c0202ffff0202fc170202ffff0201010201000201010202ffff02010204820127000500147c0001811e000800100001c00044756361811001c0d800040008000005200301ca03aa09040000ce0e00004c0031004c0031004c003100640065004d006100630042006f006f006b002d0004000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ca01000000000018000f0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003c02c00030000007264706472000000000080c0726470736e6400000000a0c0636c6970726472000000a0c002c00c000b00000000000000
[DEBUG]2023/09/26 19:07:20 mcs.go:303: mcs wait for data event
[DEBUG]2023/09/26 19:07:20 mcs.go:281: mcs client on connect 1
[DEBUG]2023/09/26 19:07:20 x224.go:182: x224 write: 02f0807f658201880401010401010101ff30190201220201020201000201010201000201010202ffff020102301902010102010102010102010102010002010102020420020102301c0202ffff0202fc170202ffff0201010201000201010202ffff02010204820127000500147c0001811e000800100001c00044756361811001c0d800040008000005200301ca03aa09040000ce0e00004c0031004c0031004c003100640065004d006100630042006f006f006b002d0004000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ca01000000000018000f0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003c02c00030000007264706472000000000080c0726470736e6400000000a0c0636c6970726472000000a0c002c00c000b00000000000000
[DEBUG]2023/09/26 19:07:20 tpkt.go:143: tpkt Write 0300019402f0807f658201880401010401010101ff30190201220201020201000201010201000201010202ffff020102301902010102010102010102010102010002010102020420020102301c0202ffff0202fc170202ffff0201010201000201010202ffff02010204820127000500147c0001811e000800100001c00044756361811001c0d800040008000005200301ca03aa09040000ce0e00004c0031004c0031004c003100640065004d006100630042006f006f006b002d0004000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ca01000000000018000f0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003c02c00030000007264706472000000000080c0726470736e6400000000a0c0636c6970726472000000a0c002c00c000b00000000000000
[DEBUG]2023/09/26 19:07:20 mcs.go:303: mcs wait for data event
[DEBUG]2023/09/26 19:07:21 tpkt.go:165: tpkt recvHeader 0300
[DEBUG]2023/09/26 19:07:21 tpkt.go:173: tptk recvHeader FASTPATH_ACTION_X224, wait for recvExtendedHeader
[DEBUG]2023/09/26 19:07:21 tpkt.go:188: tpkt recvExtendedHeader 006d
[DEBUG]2023/09/26 19:07:21 tpkt.go:194: tpkt wait recvData: 109
[DEBUG]2023/09/26 19:07:21 tpkt.go:199: tpkt recvData 02f0807f66630a0100020100301a020116020103020100020101020100020101020300fff8020102043f000500147c00012a14760a01010001c0004d63446e8028010c0c000400080003000000030c1000eb030300ec03ed03ee030000020c0c000000000000000000
[DEBUG]2023/09/26 19:07:21 x224.go:269: x224 recvData 02f0807f66630a0100020100301a020116020103020100020101020100020101020300fff8020102043f000500147c00012a14760a01010001c0004d63446e8028010c0c000400080003000000030c1000eb030300ec03ed03ee030000020c0c000000000000000000 emit data
[DEBUG]2023/09/26 19:07:21 mcs.go:308: mcs recvConnectResponse 7f66630a0100020100301a020116020103020100020101020100020101020300fff8020102043f000500147c00012a14760a01010001c0004d63446e8028010c0c000400080003000000030c1000eb030300ec03ed03ee030000020c0c000000000000000000
[DEBUG]2023/09/26 19:07:21 gcc.go:574: all: 3073 3074 3075 49153 49154 49155 49156 49157
[ERROR]2023/09/26 19:07:21 gcc.go:599: Unpack: EOF
[DEBUG]2023/09/26 19:07:21 mcs.go:334: serverSecurityData:
[DEBUG]2023/09/26 19:07:21 mcs.go:335: serverCoreData:
[DEBUG]2023/09/26 19:07:21 mcs.go:336: serverNetworkData:
[DEBUG]2023/09/26 19:07:21 mcs.go:337: mcs sendErectDomainRequest
[DEBUG]2023/09/26 19:07:21 x224.go:182: x224 write: 02f0800401000100
[DEBUG]2023/09/26 19:07:21 tpkt.go:143: tpkt Write 0300000c02f0800401000100
[DEBUG]2023/09/26 19:07:21 mcs.go:340: mcs sendAttachUserRequest
[DEBUG]2023/09/26 19:07:21 x224.go:182: x224 write: 02f08028
[DEBUG]2023/09/26 19:07:21 tpkt.go:143: tpkt Write 0300000802f08028
[DEBUG]2023/09/26 19:07:21 tpkt.go:165: tpkt recvHeader 0300
[DEBUG]2023/09/26 19:07:21 tpkt.go:173: tptk recvHeader FASTPATH_ACTION_X224, wait for recvExtendedHeader
[DEBUG]2023/09/26 19:07:21 tpkt.go:188: tpkt recvExtendedHeader 000b
[DEBUG]2023/09/26 19:07:21 tpkt.go:194: tpkt wait recvData: 11
[DEBUG]2023/09/26 19:07:21 tpkt.go:199: tpkt recvData 02f0802e000001
[DEBUG]2023/09/26 19:07:21 x224.go:269: x224 recvData 02f0802e000001 emit data
[DEBUG]2023/09/26 19:07:21 mcs.go:361: mcs recvAttachUserConfirm 2e000001
[DEBUG]2023/09/26 19:07:21 mcs.go:394: mcs connectChannels: 0 : 2
[DEBUG]2023/09/26 19:07:21 mcs.go:420: sendChannelJoinRequest: global
[DEBUG]2023/09/26 19:07:21 mcs.go:427: mcs sendChannelJoinRequest 1003
[DEBUG]2023/09/26 19:07:21 x224.go:182: x224 write: 02f08038000103eb
[DEBUG]2023/09/26 19:07:21 tpkt.go:143: tpkt Write 0300000c02f08038000103eb
[DEBUG]2023/09/26 19:07:21 tpkt.go:165: tpkt recvHeader 0300
[DEBUG]2023/09/26 19:07:21 tpkt.go:173: tptk recvHeader FASTPATH_ACTION_X224, wait for recvExtendedHeader
[DEBUG]2023/09/26 19:07:21 tpkt.go:188: tpkt recvExtendedHeader 000f
[DEBUG]2023/09/26 19:07:21 tpkt.go:194: tpkt wait recvData: 15
[DEBUG]2023/09/26 19:07:21 tpkt.go:199: tpkt recvData 02f0803e00000103ea03ea
[DEBUG]2023/09/26 19:07:21 x224.go:269: x224 recvData 02f0803e00000103ea03ea emit data
[DEBUG]2023/09/26 19:07:21 mcs.go:484: mcs recvChannelJoinConfirm 3e00000103ea03ea
[DEBUG]2023/09/26 19:07:21 mcs.go:511: Confirm channelId: 1002

@tomatome
Copy link
Owner

concurrent connections ? You can try using the latest master branch.

@selinuxG
Copy link

selinuxG commented Sep 26, 2023

yes,concurrent connections

go get -u github.com/tomatome/grdp
go: downloading golang.org/x/crypto v0.13.0
go: downloading github.com/icodeface/tls v0.0.0-20230910023335-34df9250cd12
go: downloading golang.org/x/sys v0.12.0
go: downloading golang.org/x/term v0.12.0
go: downloading golang.org/x/text v0.13.0
go: upgraded github.com/icodeface/tls v0.0.0-20190904083142-17aec93c60e5 => v0.0.0-20230910023335-34df9250cd12
go: upgraded golang.org/x/crypto v0.9.0 => v0.13.0
go: upgraded golang.org/x/sys v0.8.0 => v0.12.0
go: upgraded golang.org/x/text v0.9.0 => v0.13.0

go list -m -u github.com/tomatome/grdp
github.com/tomatome/grdp v0.1.0

@tomatome
Copy link
Owner

I see that different connection methods were used for the previous crash and the subsequent concurrency issues.

provide debug information for establishing a connection using NTLM or SSL.

@selinuxG
Copy link

selinuxG commented Sep 26, 2023

type Client struct {
	Host string // ip:port
	tpkt *tpkt.TPKT
	x224 *x224.X224
	mcs  *t125.MCSClient
	sec  *sec.Client
	pdu  *pdu.Client
	vnc  *rfb.RFB
}

func rdpcon(cancel context.CancelFunc, ip, user, passwd string, port, timeout int) {
	defer func() {
		recover() //只是捕获 panic,不做任何处理
	}()
	glog.SetLevel(5) //禁止日志输出
	logger := log.New(os.Stdout, "", 0)
	glog.SetLogger(logger)

	r := Client{Host: fmt.Sprintf("%s:%d", ip, port)}
	err := r.Login("", user, passwd, timeout)
	if err == nil {
		end(ip, user, passwd, port, "RDP")
		cancel()
	}
}

func (g *Client) Login(domain, user, pwd string, timeout int) error {
	conn, err := net.DialTimeout("tcp", g.Host, time.Duration(timeout)*time.Second)
	if err != nil {
		return fmt.Errorf("[dial err] %v", err)
	}

	g.tpkt = tpkt.New(core.NewSocketLayer(conn), nla.NewNTLMv2(domain, user, pwd))
	g.x224 = x224.New(g.tpkt)
	g.mcs = t125.NewMCSClient(g.x224)
	g.sec = sec.NewClient(g.mcs)
	g.pdu = pdu.NewClient(g.sec)

	g.sec.SetUser(user)
	g.sec.SetPwd(pwd)
	g.sec.SetDomain(domain)

	g.tpkt.SetFastPathListener(g.sec)
	g.sec.SetFastPathListener(g.pdu)
	g.pdu.SetFastPathSender(g.tpkt)

	err = g.x224.Connect()
	if err != nil {
		return fmt.Errorf("[x224 connect err] %v", err)
	}
	glog.Info("wait connect ok")
	wg := &sync.WaitGroup{}
	breakFlag := false
	wg.Add(1)

	g.pdu.On("error", func(e error) {
		err = e
		glog.Error("error", e)
		g.pdu.Emit("done")
	})
	g.pdu.On("close", func() {
		err = errors.New("close")
		glog.Info("on close")
		g.pdu.Emit("done")
	})
	g.pdu.On("success", func() {
		err = nil
		glog.Info("on success")
		g.pdu.Emit("done")
	})
	g.pdu.On("ready", func() {
		glog.Info("on ready")
		g.pdu.Emit("done")
	})
	g.pdu.On("update", func(rectangles []pdu.BitmapData) {
		glog.Info("on update:", rectangles)
	})
	g.pdu.On("done", func() {
		if breakFlag == false {
			breakFlag = true
			wg.Done()
		}
	})
	wg.Wait()
	return err
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants