├── LICENSE ├── tethery.sh ├── proxifier.template └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Mark Wadham 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /tethery.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ "$1" == "-i" ] ; then 3 | if [ "$2" == "" ] ; then 4 | echo "-i needs a parameter, eg: -i en0" 5 | exit 1 6 | fi 7 | wifi_interface="$2" 8 | else 9 | wifi_interface=`/usr/sbin/networksetup -listallhardwareports |grep -A1 -i 'Wi-Fi' |tail -n1 |cut -d ' ' -f2` 10 | fi 11 | 12 | if [ "$wifi_interface" == "" ] ; then 13 | echo 14 | echo "Unable to detect your wifi interface." 15 | echo 16 | echo "You can specify it manually with -i, eg:" 17 | echo 18 | echo "$0 -i en0" 19 | echo 20 | exit 1 21 | fi 22 | 23 | checkif=`/sbin/ifconfig "$wifi_interface" 2>/dev/null` 24 | 25 | if [ "$checkif" == "" ] ; then 26 | echo "interface $wifi_interface does not exist" 27 | exit 1 28 | fi 29 | 30 | echo -n "Waiting for local self-assign IP... " 31 | 32 | while [ "$localip" == "" ] ; do 33 | localip=`/sbin/ifconfig $wifi_interface |grep 'inet ' |xargs -L1 |cut -d ' ' -f2` 34 | sleep 1 35 | done 36 | 37 | echo "$localip" 38 | 39 | echo -n "Waiting for iDevice... " 40 | 41 | while [ "$deviceip" == "" ] ; do 42 | deviceip=`ping -c16 -t2 169.254.255.255 2>/dev/null |grep 'bytes from' |grep -v "$localip" |tail -n1 |cut -d ' ' -f4 |cut -d ':' -f1` 43 | sleep 1 44 | done 45 | 46 | echo "$deviceip" 47 | 48 | killall Proxifier 1>/dev/null 2>/dev/null 49 | sleep 2 50 | cp proxifier.template ~/Library/Application\ Support/Proxifier/Profiles/default.ppx 51 | sed -i '' "s/{{PROXY_ADDRESS}}/$deviceip/g" ~/Library/Application\ Support/Proxifier/Profiles/default.ppx 52 | open /Applications/Proxifier.app 53 | echo 54 | echo "Proxy is set up. You may need to restart some applications to make them work." 55 | echo 56 | -------------------------------------------------------------------------------- /proxifier.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | localhost;%SimpleHostnames%;%ComputerName%;*.local; 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
{{PROXY_ADDRESS}}
22 | 8080 23 | 0 24 |
25 |
26 | 27 | 28 | 29 | Localhost 30 | localhost; 127.0.0.1; ::1; %ComputerName% 31 | 32 | 33 | 34 | New 35 | {{PROXY_ADDRESS}} 36 | 8080 37 | 38 | 39 | 40 | Default 41 | 100 42 | 43 | 44 |
45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Tethering restriction bypass 2 | ============================ 3 | 4 | 5 | Version history 6 | --------------- 7 | 8 | - 0.1 - Initial release 9 | - 0.2 - Added automatic IP detection 10 | - 0.3 - Make tethery.sh a bit more reliable 11 | 12 | 13 | Description 14 | ----------- 15 | 16 | This will allow you to tether a mac to an iOS device in order to use its 3G/4G data connection. 17 | It works even if Apple's "personal hotspot" function is not available, and also disguises the 18 | traffic such that the carrier cannot detect that you're tethering. 19 | 20 | Warning: if you have any configuration already in Proxifier, running tethery.sh will erase it! 21 | 22 | You have been warned! 23 | 24 | Requires: 25 | 26 | 1. A computer running a linux-like OS somewhere on the internet that you can ssh to. 27 | 28 | 2. vSSH for iOS - http://www.velestar.com/Pages/VSSHIOSPage.aspx 29 | 30 | 3. Proxifier for mac v2.15 Beta 1 - https://www.proxifier.com/mac/ 31 | 32 | 33 | Known issues 34 | ------------ 35 | 36 | 26/02/16: I am pleased to report that the latest version of vSSH has fixed the intermittent crashes 37 | and the proxy now works perfectly! 38 | 39 | 40 | Setup 41 | ----- 42 | 43 | Create a vSSH profile on the iDevice that connects to the linux box via ssh. 44 | Add a port forwarding rule to this profile with: 45 | 46 | Type: Dynamic SOCKS proxying 47 | Source: 48 | - Host: 127.0.0.1 49 | - Port: 8080 50 | 51 | Accept all connections: Yes 52 | 53 | Save this profile with a name like "tether". 54 | 55 | 56 | Usage 57 | ----- 58 | 59 | 0. Disable internet connection sharing via wifi on the mac (if enabled). 60 | 61 | 1. Create an ad-hoc wifi network on your mac. I find channel 1 works best. 62 | 63 | 2. Connect the iDevice to the ad-hoc network. 64 | 65 | 3. Open vSSH on the phone and initiate the connection to your "tether" profile. 66 | 67 | 4. Run tethery.sh on the mac with: 68 | 69 | ./tethery.sh 70 | 71 | It will automatically detect the IP address of the iDevice on the network and initiate the proxy. 72 | Be patient as the iDevice will take a minute or so to self-assign its IP before it can be detected. 73 | 74 | You should now be tethered. Some apps may need to be restarted before they will work through the proxy. 75 | 76 | Note that you will need to leave the iDevice running vSSH in order for the tunnel to stay active, so 77 | the best thing to do is disable auto-lock in settings so the device won't go to sleep and suspend 78 | the app. 79 | 80 | 81 | Disclaimer 82 | ---------- 83 | 84 | WE STRONGLY ADVISE READING YOUR MOBILE SERVICE PROVIDER'S CONTRACT TERMS BEFORE USING THIS 85 | TECHNIQUE. IF THE TECHNIQUE WOULD VIOLATE THEIR TERMS AND CONDITIONS YOU SHOULD NOT USE IT. 86 | 87 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 88 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 89 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 90 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 91 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 92 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 93 | THE SOFTWARE. 94 | --------------------------------------------------------------------------------