0

I wish to tunnel CLI tools over tor network in macOS 11.5.2

None is working.

I only installed torsocks, did no configuration.

brew install torsocks

torsocks whois example.com
ERROR: /usr/bin/whois is located in a directory protected by Apple's System Integrity Protection.
torsocks curl https://www.example.com
ERROR: /usr/bin/curl is located in a directory protected by Apple's System Integrity Protection.
torsocks dig +tcp @1.1.1.1 example.com
ERROR: /usr/bin/dig is located in a directory protected by Apple's System Integrity Protection.
torsocks openssl s_client -connect exampample.com:443
ERROR: /usr/bin/openssl is located in a directory protected by Apple's System Integrity Protection.

and

UPDATE:

torsocks /tmp/curl https://example.com
[1]    73066 segmentation fault  torsocks /tmp/curl https://example.com
2

You cannot use torsocks on system utilities without disabling SIP. Your best bet is to install alternate versions of these tools using Homebrew and use torsocks on those binaries.

For example, you can find curl at /usr/local/opt/curl/bin/curl.

3
  • torsocks /usr/local/opt/curl/bin/curl https ://example.com [1] 91057 segmentation fault torsocks /usr/local/opt/curl/bin/curl https://example.comnot working
    – Josefine
    Sep 21 at 16:24
  • Yeah I saw, I’m not sure what the problem is honestly. This seems like very likely a torsocks bug. Do you have the tor socks proxy running on port 9050 by the way?
    – xrisk
    Sep 21 at 16:26
  • how to see which port it uses?
    – Josefine
    Sep 21 at 16:26
1

torsocks needs to intercept the system calls for connections to divert them into tor. Because this application behavior could be malicious, apple seems to protect some apps from such behavior.

You could try to copy one of those tools to another directory and try to run it from there (like /tmp/ for a temporary try), if apple allows to run from there. If successful, choose an appropriate directory to put your tools into and run them from there in the future. Or you can disable apple protections, but that might not be reasonable: https://developer.apple.com/documentation/security/disabling_and_enabling_system_integrity_protection

Update: as using the delivered tools at another directory may not work, install your tools again through brew which will install another version at another directory which won't be protected by the protections. You will find them after install in /usr/local/

1
  • 1
    see UPDATE, not working with /tmp
    – Josefine
    Sep 19 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.