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

Does not work against Windows 2019 #23

Open
CaledoniaProject opened this issue Sep 29, 2023 · 10 comments
Open

Does not work against Windows 2019 #23

CaledoniaProject opened this issue Sep 29, 2023 · 10 comments

Comments

@CaledoniaProject
Copy link

CaledoniaProject commented Sep 29, 2023

I believe the library is completely broken, does not work on any recent Windows version.

[INFO]2023/09/29 17:20:40 sec.go:721: sec ERROR_ALERT and ErrorCode: 7
[ERROR]2023/09/29 17:20:40 caps.go:647: unsupported Capability type 0x001e

@olljanat
Copy link

olljanat commented Nov 8, 2023

Are using latest version of code from master branch?

As far I see this works fine even with Windows Server 2022 with these security hardenings enabled:
image

TLS 1.0, TLS 1.1 and 3DES cipher disabled (verified with sslscan):
image

Only challenge which I noticed is that this cannot be build with latest Go version so I used 1.18.10 instead of.
EDIT: Building with latest Go version works fine as long you are using amd64 version instead of 386.
However you need to have CGO support or include change from #26

@CaledoniaProject
Copy link
Author

@CaledoniaProject Can you provide an example of your code on gist?

@olljanat
Copy link

olljanat commented Nov 9, 2023

I simply copied example code from integration test:

c := NewClient("192.168.0.132:3389", "administrator", "Jhadmin123", TC_RDP, nil)
err := c.Login()
if err != nil {
fmt.Println("Login:", err)
}
c.OnReady(func() {
fmt.Println("ready")
})
time.Sleep(100 * time.Second)

@CaledoniaProject
Copy link
Author

CaledoniaProject commented Nov 9, 2023

The test is broken

# go test github.com/tomatome/grdp/client -run TestClient
# github.com/tomatome/grdp/plugin/cliprdr
plugin/cliprdr/cliprdr.go:223:27: undefined: FILE_ATTRIBUTE_DIRECTORY
plugin/cliprdr/cliprdr.go:318:2: undefined: Control
plugin/cliprdr/cliprdr.go:328:5: undefined: ClipWatcher
plugin/cliprdr/cliprdr.go:434:4: c.withOpenClipboard undefined (type *CliprdrClient has no field or method withOpenClipboard)
plugin/cliprdr/cliprdr.go:435:7: undefined: EmptyClipboard
plugin/cliprdr/cliprdr.go:443:5: c.SendCliprdrMessage undefined (type *CliprdrClient has no field or method SendCliprdrMessage)
plugin/cliprdr/cliprdr.go:445:5: c.withOpenClipboard undefined (type *CliprdrClient has no field or method withOpenClipboard)
plugin/cliprdr/cliprdr.go:446:8: undefined: EmptyClipboard
plugin/cliprdr/cliprdr.go:451:5: undefined: SetClipboardData
plugin/cliprdr/cliprdr.go:475:37: undefined: GetFileInfo
plugin/cliprdr/cliprdr.go:475:37: too many errors
FAIL	github.com/tomatome/grdp/client [build failed]
FAIL

With cgo disabled

# CGO_ENABLED=0 go test github.com/tomatome/grdp/client -run TestClient
package github.com/tomatome/grdp/client
	imports github.com/tomatome/grdp/plugin: build constraints exclude all Go files in /home/tmp/grdp-master/plugin

@olljanat
Copy link

olljanat commented Nov 9, 2023

I mean, copy that code to new Go app and build normally.

@CaledoniaProject
Copy link
Author

CaledoniaProject commented Nov 10, 2023

Same issue, the library is broken or incompatible with go1.21.4

../../../../go/pkg/mod/github.com/tomatome/[email protected]/client/rfb.go:28:14: c.vnc.Connect undefined (type *rfb.RFB has no field or method Connect)

@CaledoniaProject
Copy link
Author

@tomatome Can you take a look at this?

@olljanat
Copy link

Same issue, the library is broken or incompatible with go1.21.4

../../../../go/pkg/mod/github.com/tomatome/[email protected]/client/rfb.go:28:14: c.vnc.Connect undefined (type *rfb.RFB has no field or method Connect)

Ah, this VNC error I did see also before disabled CGO. I would assume that it needs some very specific version of gcc.
You can include #26 by adding this line to go.mod and running go mod tidy again:

replace github.com/tomatome/grdp => github.com/olljanat/grdp v0.0.0-20231109070701-045cbccd0693

@CaledoniaProject
Copy link
Author

I've patched the code manually, your repo need to fix the mod name

go: github.com/olljanat/[email protected]: parsing go.mod:
module declares its path as: github.com/tomatome/grdp
but was required as: github.com/olljanat/grdp

@olljanat
Copy link

Don't change require command, just add that replace command. Like this:

require github.com/tomatome/grdp v0.1.1-0.20230622130233-b1e80faa1cf2
replace github.com/tomatome/grdp => github.com/olljanat/grdp v0.0.0-20231109070701-045cbccd0693

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

2 participants