tomatome / grdp

pure golang rdp protocol
GNU General Public License v3.0
190 stars 70 forks source link

low version windows, and I try other tool that can conncet the 3389 sesucess--NODE_RDP_PROTOCOL_X224_NEG_FAILURE with code: 2, #14

Closed banjie123 closed 1 year ago

banjie123 commented 1 year ago

image

banjie123 commented 1 year ago

a174410de555c8d5e023f33cce91767 cdc0872ae78e54bf29a9b4f74d43ce4

tomatome commented 1 year ago

Use NLA authentication by default, you can use Standard RDP for low version windows: g.x224.SetRequestedProtocol(x224.PROTOCOL_RDP)

banjie123 commented 1 year ago

The correct password is 123right.Result is not right!!! image Remote Server Information image

tomatome commented 1 year ago

Can you provide debug information?

use glog.SetLevel(glog.DEBUG)

banjie123 commented 1 year ago

Dubug INformation === RUN TestClient [DEBUG]2022/12/09 10:27:12 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000 [DEBUG]2022/12/09 10:27:12 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000 [DEBUG]2022/12/09 10:27:12 tpkt.go:165: tpkt recvHeader 0300 [DEBUG]2022/12/09 10:27:12 tpkt.go:173: tptk recvHeader FASTPATH_ACTION_X224, wait for recvExtendedHeader [DEBUG]2022/12/09 10:27:12 tpkt.go:188: tpkt recvExtendedHeader 0013 [DEBUG]2022/12/09 10:27:12 tpkt.go:194: tpkt wait recvData: 19 [DEBUG]2022/12/09 10:27:12 tpkt.go:199: tpkt recvData 0ed000001234000300080002000000 [DEBUG]2022/12/09 10:27:12 x224.go:209: x224 recvConnectionConfirm 0ed000001234000300080002000000 [DEBUG]2022/12/09 10:27:12 x224.go:215: message: {Type:3 Flag:0 Length:8 Result:2} [ERROR]2022/12/09 10:27:12 x224.go:217: NODE_RDP_PROTOCOL_X224_NEG_FAILURE with code: 2,see https://msdn.microsoft.com/en-us/library/cc240507.aspx [INFO]2022/12/09 10:27:12 x224.go:221: Only use Standard RDP Security mechanisms, Reconnect with Standard RDP [DEBUG]2022/12/09 10:27:12 tpkt.go:165: tpkt recvHeader 0000 read tcp 192.168.61.1:51032->192.168.61.207:3389: use of closed network connection --- PASS: TestClient (10.02s)

tomatome commented 1 year ago

Dubug INformation === RUN TestClient [DEBUG]2022/12/09 10:27:12 x224.go:202: x224 sendConnectionRequest 0ee000000000000100080003000000 [DEBUG]2022/12/09 10:27:12 tpkt.go:143: tpkt Write 030000130ee000000000000100080003000000 [DEBUG]2022/12/09 10:27:12 tpkt.go:165: tpkt recvHeader 0300 [DEBUG]2022/12/09 10:27:12 tpkt.go:173: tptk recvHeader FASTPATH_ACTION_X224, wait for recvExtendedHeader [DEBUG]2022/12/09 10:27:12 tpkt.go:188: tpkt recvExtendedHeader 0013 [DEBUG]2022/12/09 10:27:12 tpkt.go:194: tpkt wait recvData: 19 [DEBUG]2022/12/09 10:27:12 tpkt.go:199: tpkt recvData 0ed000001234000300080002000000 [DEBUG]2022/12/09 10:27:12 x224.go:209: x224 recvConnectionConfirm 0ed000001234000300080002000000 [DEBUG]2022/12/09 10:27:12 x224.go:215: message: {Type:3 Flag:0 Length:8 Result:2} [ERROR]2022/12/09 10:27:12 x224.go:217: NODE_RDP_PROTOCOL_X224_NEG_FAILURE with code: 2,see https://msdn.microsoft.com/en-us/library/cc240507.aspx [INFO]2022/12/09 10:27:12 x224.go:221: Only use Standard RDP Security mechanisms, Reconnect with Standard RDP [DEBUG]2022/12/09 10:27:12 tpkt.go:165: tpkt recvHeader 0000 read tcp 192.168.61.1:51032->192.168.61.207:3389: use of closed network connection --- PASS: TestClient (10.02s)

It needs to be set to Standard RDP。

g.x224.SetRequestedProtocol(x224.PROTOCOL_RDP)

banjie123 commented 1 year ago

invalid memory address or nil pointer dereference image === RUN TestClient --- FAIL: TestClient (0.00s) panic: runtime error: invalid memory address or nil pointer dereference [recovered] panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x1 addr=0x38 pc=0x568e39]

goroutine 6 [running]: testing.tRunner.func1.2({0x5cd660, 0x59be20}) F:/go1.17.12.windows-amd64/go/src/testing/testing.go:1209 +0x24e testing.tRunner.func1() F:/go1.17.12.windows-amd64/go/src/testing/testing.go:1212 +0x218 panic({0x5cd660, 0x59be20}) F:/go1.17.12.windows-amd64/go/src/runtime/panic.go:1038 +0x215 github.com/tomatome/grdp/protocol/x224.(X224).SetRequestedProtocol(...) C:/Users/19244/Desktop/grdp/grdp/protocol/x224/x224.go:191 github.com/tomatome/grdp/client.NewClient({0x60af46, 0x13}, {0x606b54, 0x5}, {0x607581, 0x8}, 0x0, 0xc00004ff60) C:/Users/19244/Desktop/grdp/grdp/client/client.go:67 +0x179 github.com/tomatome/grdp/client.TestClient(0x0) C:/Users/19244/Desktop/grdp/grdp/client/client_test.go:17 +0x79 testing.tRunner(0xc0000ac1a0, 0x61a528) F:/go1.17.12.windows-amd64/go/src/testing/testing.go:1259 +0x102 created by testing.(T).Run F:/go1.17.12.windows-amd64/go/src/testing/testing.go:1306 +0x35a

Process finished with exit code 1

tomatome commented 1 year ago

Use the latest code and modify

client/rdp.go:func Login()
c.x224.SetRequestedProtocol(x224.PROTOCOL_RDP)

client/client.go: func init() 
glog.SetLevel(glog.DEBUG)

then run TestClient

banjie123 commented 1 year ago

Success

image

shadow1ng commented 1 year ago

Use the latest code and modify

client/rdp.go:func Login()
c.x224.SetRequestedProtocol(x224.PROTOCOL_RDP)

client/client.go: func init() 
glog.SetLevel(glog.DEBUG)

then run TestClient

Are there any parameter or option that can automatically select the protocol according to the target? @tomatome

tomatome commented 1 year ago

Use the latest code and modify

client/rdp.go:func Login()
c.x224.SetRequestedProtocol(x224.PROTOCOL_RDP)

client/client.go: func init() 
glog.SetLevel(glog.DEBUG)

then run TestClient

Are there any parameter or option that can automatically select the protocol according to the target? @tomatome

It will increase in the future. There is no time now