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.76k stars 1.08k forks source link

Cannot run iOS Simulator is proxychains #104

Open minimedj opened 8 years ago

minimedj commented 8 years ago

I cannot run iOS Simulator with proxychains-ng. I use proxychains-ng build from sources.

Here is what I did:

git clone https://github.com/rofl0r/proxychains-ng.git
cd ./proxychains-ng
./configure --prefix=/usr --sysconfdir=/etc --fat-binary
make
sudo make install

I checked architecture of the library:

lipo -info ./libproxychains4.dylib 
Architectures in the fat file: ./libproxychains4.dylib are: i386 x86_64 

Then I configured and checked SOCKS proxy:

./proxychains4 -f src/proxychains.conf curl ipinfo.io
[proxychains] config file found: src/proxychains.conf
[proxychains] preloading ./libproxychains4.dylib
[proxychains] DLL init: proxychains-ng 4.10-git-20-g672bf76
[proxychains] Strict chain  ...  127.0.0.1:8888  ...  ipinfo.io:80  ...  OK
...

So far everything seems to be just fine. Now about the problem. When I tty to run iOS Simulator I get an error. Here is a command I use to run Simulator:

./proxychains4 -f src/proxychains.conf /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator

Here is the error:

Process:               Simulator [9568]
Path:                  /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator
Identifier:            Simulator
Version:               9.2 (643)
Code Type:             X86-64 (Native)
Parent Process:        bash [8880]
Responsible:           Terminal [317]
User ID:               501

Date/Time:             2016-01-26 14:57:08.045 +0100
OS Version:            Mac OS X 10.11.2 (15C50)
Report Version:        11
Anonymous UUID:        A7A163E5-5585-26AF-F4EF-3FEF20B0B226

Sleep/Wake UUID:       03B6382A-7234-4E01-A498-4916200A4573

Time Awake Since Boot: 10000 seconds

System Integrity Protection: disabled

Crashed Thread:        0

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000002, 0x0000000000000000

Application Specific Information:
dyld: launch, loading dependent libraries
DYLD_FORCE_FLAT_NAMESPACE=1
DYLD_INSERT_LIBRARIES=./libproxychains4.dylib

Dyld Error Message:
  could not load inserted library './libproxychains4.dylib' because no suitable image found.  Did find:
    ./libproxychains4.dylib: mmap() error 1 at address=0x10E7F3000, size=0x00008000 segment=__TEXT in Segment::map() mapping ./libproxychains4.dylib

Binary Images:
       0x10e7a7000 -        0x10e7d3ff7  com.apple.iphonesimulator (9.2 - 643) <2A577F90-517C-3363-A980-EEB79D21FEBF> /Applications/Xcode.app/Contents/Developer/    Applications/Simulator.app/Contents/MacOS/Simulator
    0x7fff6af66000 -     0x7fff6af9cfa7  dyld (360.18) <1A7F8274-FC32-3B86-9979-66B8F2B7B5E2> /usr/lib/dyld

Any ideas how to fix it?

Qusic commented 8 years ago

proxychains hooks posix socket API. However iOS(and simulator as well) doesn't use posix API to access network. NS-related network API are actually handled by a daemon called networkd which implements TCP from scratch to support MPTCP.

minimedj commented 8 years ago

@Qusic thank you very much for detailed answer!

So, is it possible to proxy iOS Simulator somehow? :open_mouth: