rofl0r / proxychains-ng

proxychains ng (new generation) - a preloader which hooks calls to sockets in dynamically linked programs and redirects it through one or more socks/http proxies. continuation of the unmaintained proxychains project. the sf.net page is currently not updated, use releases from github release page instead.
http://sourceforge.net/projects/proxychains-ng/files
GNU General Public License v2.0
9.82k stars 1.08k forks source link

csrutil disabled, built from source, still got warning #250

Open aeroxy opened 6 years ago

aeroxy commented 6 years ago

warning: could not load inserted library '/usr/local/lib/libproxychains4.dylib' into library validated process because no suitable image found.

How to produce:

High Sierra 10.13.6

git clone https://github.com/rofl0r/proxychains-ng
cd proxychains-ng
./configure --prefix=/usr/local --bindir=/usr/local/bin --libdir=/usr/local/lib --fat-binary
make
sudo make install

Then I edited config file (/etc/proxychains.conf) to:

strict_chain
proxy_dns
remote_dns_subnet 224
tcp_read_time_out 15000
tcp_connect_time_out 8000
localnet 127.0.0.0/255.0.0.0
[ProxyList]
socks5 127.0.0.1 1080

Noted that at this point I already disabled SIP.

When I run proxychains4 git clone I still get warning: could not load inserted library '/usr/local/lib/libproxychains4.dylib' into library validated process because no suitable image found.

rofl0r commented 6 years ago

anyone got an idea what's causing this and how to fix it ? help welcome.

aeroxy commented 6 years ago

Note if I run proxychains4 curl google.com similar error would not occur.

rofl0r commented 6 years ago

what's the difference between curl and git ? is one shipped with mac os, vs the other installed via brew ? where are the binaries located ?

yume-chan commented 4 years ago

Same problem here.

I'm using macOS 10.14.2 and I have SIP completed disabled. Running proxychains4 with /usr/bin/git still prints the warning messages and does not work.

> proxychains4 /usr/bin/git pull 
[proxychains] config file found: /Users/simon/.proxychains/proxychains.conf
[proxychains] preloading /usr/local/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib
dyld: warning: could not load inserted library '/usr/local/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib' into hardened process because no suitable image found.  Did find:
        /usr/local/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib: code signature in (/usr/local/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
        /usr/local/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib: stat() failed with errno=1
dyld: warning: could not load inserted library '/usr/local/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib' into hardened process because no suitable image found.  Did find:
        /usr/local/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib: code signature in (/usr/local/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
        /usr/local/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib: stat() failed with errno=1
dyld: warning: could not load inserted library '/usr/local/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib' into hardened process because no suitable image found.  Did find:
        /usr/local/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib: code signature in (/usr/local/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
        /usr/local/Cellar/proxychains-ng/4.14/lib/libproxychains4.dylib: stat() failed with errno=1

The output mentions "Library Validation" which looks like another layer of protection and I can't find ways to easily disable it. (see https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_disable-library-validation)

I can install git from brew to workaround it.

303 seems to be the same problem.

malash commented 3 years ago

Try sudo defaults write /Library/Preferences/com.apple.security.libraryvalidation.plist DisableLibraryValidation -bool true, it works for my macOS Big Sur.

Ref: https://www.macenhance.com/docs/general/sip-library-validation.html