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

microsocks and proxychains-ng in combo? #19

Closed
HeyJoe57 opened this issue May 24, 2019 · 5 comments
Closed

microsocks and proxychains-ng in combo? #19

HeyJoe57 opened this issue May 24, 2019 · 5 comments

Comments

@HeyJoe57
Copy link

I want to run a proxy server on a local machine that will accept traffic and route whatever it gets through a chain of proxies. I figured this would work:

$ ./proxychains4 -f ./proxychains.conf microsocks
[proxychains] config file found: ./proxychains-testing.conf
[proxychains] preloading ./libproxychains4.dylib
[proxychains] DLL init: proxychains-ng 4.14
server_setup: Invalid argument

But clearly it doesn't. Should it?

Both microsocks and proxychains4 work independently. Running on MacOS 10.14.1.

@rofl0r
Copy link
Owner

rofl0r commented May 24, 2019

do you have strace on mac ? if so, running strace -f ./proxychains4 -f ./proxychains.conf microsocks could shed some light on what is going wrong. in particular the line containing EINVAL.

@HeyJoe57
Copy link
Author

There's no strace but there is dtrace/dtruss. The invalid argument appears to be in a call to bind:

Here's where it fails:
$ tail -20 dtruss.output-withproxychains
open_nocancel("/etc/.mdns_debug\0", 0x0, 0x0) = -1 Err#2
issetugid(0x0, 0x0, 0x0) = 0 0
issetugid(0x0, 0x0, 0x0) = 0 0
proc_info(0x2, 0x1774B, 0x11) = 56 0
proc_info(0x2, 0x1774B, 0x11) = 56 0
issetugid(0x0, 0x0, 0x0) = 0 0
openat(0xFFFFFFFFFFFFFFFE, "/Library/Preferences/Logging/com.apple.diagnosticd.filter.plist\0", 0x1000104, 0xFFFFFFFFEE0F79E0) = -1 Err#2
open("/private/tmp/./microsocks\0", 0x8004, 0x5788BDFA) = 7 0
fcntl(0x7, 0x32, 0x7FFEEE0F7430) = 0 0
close(0x7) = 0 0
open_nocancel("/etc/services\0", 0x0, 0x1B6) = 7 0
fstat64(0x7, 0x7FFEEE0F6DF8, 0x0) = 0 0
close_nocancel(0x7) = 0 0
socket(0x2, 0x1, 0x0) = 7 0
setsockopt(0x7, 0xFFFF, 0x4) = 0 0
bind(0x7, 0x7FE97BE00060, 0x80) = -1 Err#22
close(0x7) = 0 0
writev_nocancel(0x2, 0x7FFEEE0F9F90, 0x4) = 31 0
select(0x4, 0x70000D7BECD8, 0x0, 0x0, 0x0) = -1 Err#4

For comparison, here's microsocks without proxychains:
$ tail -20 dtruss.output-normal
mprotect(0x104B3F000, 0x1000, 0x1) = 0 0
mprotect(0x104B2D000, 0x90, 0x3) = 0 0
mprotect(0x104B2D000, 0x90, 0x1) = 0 0
getentropy(0x7FFEEB0D7B20, 0x20, 0x0) = 0 0
getpid(0x0, 0x0, 0x0) = 96061 0
stat64("/AppleInternal\0", 0x7FFEEB0D8630, 0x0) = -1 Err#2
csops(0x1773D, 0x7, 0x7FFEEB0D8160) = -1 Err#22
proc_info(0x2, 0x1773D, 0xD) = 64 0
csops(0x1773D, 0x7, 0x7FFEEB0D79B0) = -1 Err#22
sigaction(0xD, 0x7FFEEB0D9848, 0x7FFEEB0D9870) = 0 0
shm_open(0x7FFF57842CD8, 0x0, 0x0) = 3 0
mmap(0x0, 0x1000, 0x1, 0x1, 0x3, 0x0) = 0x104B40000 0
close_nocancel(0x3) = 0 0
open_nocancel("/etc/.mdns_debug\0", 0x0, 0x0) = -1 Err#2
socket(0x2, 0x1, 0x6) = 3 0
setsockopt(0x3, 0xFFFF, 0x4) = 0 0
bind(0x3, 0x7F9CBBD00520, 0x10) = 0 0
listen(0x3, 0x80, 0x0) = 0 0
accept(0x3, 0x7FFEEB0D9900, 0x7FFEEB0D987C) = -1 Err#4

(The second one was exited with ^C, hence the interrupted system call there.)

rofl0r added a commit to rofl0r/proxychains-ng that referenced this issue May 25, 2019
…_len

this should fix an issue which seems to be mac's bind() only accepting
sizeof(struct sockaddr_in) for AF_INET.

ref: rofl0r/microsocks#19
@rofl0r
Copy link
Owner

rofl0r commented May 25, 2019

thanks, i pushed a fix to proxychains-ng repo. could you try whether it fixes the issue?

@HeyJoe57
Copy link
Author

It works. Thanks!

@rofl0r
Copy link
Owner

rofl0r commented May 26, 2019

great, thanks for reporting&testing!

@rofl0r rofl0r closed this as completed May 26, 2019
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