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

proxychains4 with Go lang #199

Closed
vpotap opened this issue Oct 27, 2017 · 9 comments
Closed

proxychains4 with Go lang #199

vpotap opened this issue Oct 27, 2017 · 9 comments

Comments

@vpotap
Copy link

vpotap commented Oct 27, 2017

some problem running proxychaings4 with go lang:

proxychains4 go run main.go
[proxychains] config file found: /usr/local/etc/proxychains.conf
[proxychains] preloading /usr/local/Cellar/proxychains-ng/4.12_1/lib/libproxychains4.dylib
[proxychains] DLL init: proxychains-ng 4.12

command-line-arguments

[proxychains] DLL init: proxychains-ng 4.12
fatal error: runtime: bsdthread_register error (unset DYLD_INSERT_LIBRARIES)

runtime stack:
runtime.throw(0x176eca6, 0x3f)
/usr/local/Cellar/go/1.9/libexec/src/runtime/panic.go:605 +0x95 fp=0x7fff5fbff4e0 sp=0x7fff5fbff4c0 pc=0x102a185
runtime.goenvs()
/usr/local/Cellar/go/1.9/libexec/src/runtime/os_darwin.go:106 +0x9e fp=0x7fff5fbff510 sp=0x7fff5fbff4e0 pc=0x1027a3e
runtime.schedinit()

is proxychains compatible with Go lang ? I suppose it could be *libc depend problem ?

@rofl0r
Copy link
Owner

rofl0r commented Oct 28, 2017

proxychains hooks to dynamically loaded libc.

  1. go doesn't even use libc, it uses its own syscall wrappers
  2. go doesn't use dynamic linking, it uses static linking

so there's no way we could use this technique with go. the only way to hook into go binaries would be by using ptrace to hook the system calls themselves, which is hairy and platform-dependent - i.e. it means it would be a lot more work to produce and maintain.
so i fear it is out of scope for this utility.

@ghost
Copy link

ghost commented Jan 6, 2018

doesn't go link against libc by default specifically for some net functions?
also proxychains could provide a static library to link when compiling other programs, like this one does, which I don't think proxychains currently offers

@rofl0r
Copy link
Owner

rofl0r commented Jan 6, 2018

doesn't go link against libc by default specifically for some net functions?

afaik no.

proxychains could provide a static library to link when compiling other programs, like this one does, which I don't think proxychains currently offers

that's a cool idea (i would actually implement it by including a special header in 3rd party apps that does something like #define connect(A, B, C) connect_wrapper(A, B, C)) but then, using it in go wouldnt be straightforward either i guess. also it's a lot of work and my interest in go is almost zero...

@hmgle
Copy link

hmgle commented Aug 3, 2018

This tool graftcp can handle the Go program, by using ptrace.

@rofl0r
Copy link
Owner

rofl0r commented Aug 3, 2018

instead of making a ptrace-hook proxychains-clone for go i would have prefered if people would have stopped using go...

@kingcc
Copy link

kingcc commented Dec 11, 2018

Okay, eccentric golang.

@cubimon
Copy link

cubimon commented Apr 26, 2020

building go applications with go-pie worked for me for use with proxychains

@noemidit
Copy link

building go applications with go-pie worked for me for use with proxychains

Could you please kindly give some more info about go-pie, I googled it but didn't find anything useful. Thanks.

@NOBLES5E
Copy link

NOBLES5E commented Sep 20, 2024

cproxy was created specifically to solve this issue with a usage pattern similar to proxychains

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

7 participants