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 · 6 comments

Comments

Projects
None yet
5 participants
@vpotap
Copy link

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

This comment has been minimized.

Copy link
Owner

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.

@untoreh

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Owner

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

This comment has been minimized.

Copy link

commented Aug 3, 2018

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

@rofl0r

This comment has been minimized.

Copy link
Owner

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

This comment has been minimized.

Copy link

commented Dec 11, 2018

Okay, eccentric golang.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.