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

Ligolo doesn't work with golang version 20 #32

Closed
QU35T-code opened this issue Feb 14, 2023 · 7 comments
Closed

Ligolo doesn't work with golang version 20 #32

QU35T-code opened this issue Feb 14, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@QU35T-code
Copy link

QU35T-code commented Feb 14, 2023

Hello,

There is a problem with the proxy build (agent is ok) with golang version 20. The build with version 19 is functional but an error occurs with version 20.

root@f33e8b06d6cc:/opt/tools/ligolo-ng# wget -O /tmp/go.tar.gz https://go.dev/dl/go1.19.linux-arm64.tar.gz

Saving to: '/tmp/go.tar.gz'

root@f33e8b06d6cc:/opt/tools/ligolo-ng# tar -C /usr/local -xzf /tmp/go.tar.gz
root@f33e8b06d6cc:/opt/tools/ligolo-ng# /usr/local/go/bin/go build -o proxy cmd/proxy/main.go

[...BUILD OK...]
root@f33e8b06d6cc:/opt/tools/ligolo-ng# wget -O /tmp/go.tar.gz https://go.dev/dl/go1.20.linux-arm64.tar.gz

Saving to: '/tmp/go.tar.gz'

root@f33e8b06d6cc:/opt/tools/ligolo-ng# tar -C /usr/local -xzf /tmp/go.tar.gz
root@f33e8b06d6cc:/opt/tools/ligolo-ng# /usr/local/go/bin/go build -o proxy cmd/proxy/main.go

# github.com/nicocha30/gvisor-ligolo/pkg/gohacks
/root/go/pkg/mod/github.com/nicocha30/gvisor-ligolo@v0.0.0-20230201100237-f26fe0a6c03c/pkg/gohacks/string_go120_unsafe.go:27:7: unsafe.StringData requires go1.20 or later (-lang was set to go1.18; check go.mod)
/root/go/pkg/mod/github.com/nicocha30/gvisor-ligolo@v0.0.0-20230201100237-f26fe0a6c03c/pkg/gohacks/string_go120_unsafe.go:38:9: unsafe.String requires go1.20 or later (-lang was set to go1.18; check go.mod)
@dismantl
Copy link
Contributor

dismantl commented Jun 1, 2023

Possibly related to this issue: golang/go#58554

I haven't tried this yet but I expect upgrading gvisor-ligolo to the latest upstream gvisor may solve this problem, as upstream now sets go1.20 as the minimum version.

I'd be happy to submit a PR but am unsure exactly what changes the fork has. I see that ICMP handling was removed, but are there other changes too?

@dismantl
Copy link
Contributor

dismantl commented Jun 4, 2023

I was able to get ligolo-ng to build successfully with go 1.20 by using an updated gvisor fork. Here's the branch I used, and you can see that there are a few minor changes needed relating to updated type definitions in the latest gvisor.

@ikstream
Copy link

Hi, are there any updates on this @nicocha30?

@nicocha30
Copy link
Owner

Hey,

I'm working on it today. Will keep you updated.

Nicolas

@ikstream
Copy link

Thank you very much

@nicocha30
Copy link
Owner

Done! After struggling with gvisor and the CI, release 0.4.4 now supports Go >= 1.20.

https://github.com/nicocha30/ligolo-ng/releases/tag/v0.4.4

@ikstream
Copy link

Thank you, works like a charm, as far as I can tell.

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

No branches or pull requests

4 participants