Giter Site home page Giter Site logo

rifi2k / unlimited-tethering Goto Github PK

View Code? Open in Web Editor NEW
262.0 20.0 37.0 27 KB

Bypass tethering caps or throttling on cell phone unlimited data plans. Potentially cancel your internet and route your whole home though your unlimited data plan.

License: The Unlicense

tethering unlimited-data bypass-throttling ssh-tunnel cellphone

unlimited-tethering's Introduction

Unlimited Tethering

Bypass tethering caps or throttling on cell phone unlimited data plans. Potentially cancel your internet and route your whole home though your unlimited data plan.

Inspired from XDA forum threads. Working Options for Unlimited Tetherting, Hotspot, Carrier Check Bypass Methods Unlimited WiFi Tethering

Requirements

  • Unlimited data plan
  • Ability to hotspot your phone
  • Computer or Router

This is not a carrier specific method, I use Verizon but this should generally work with any carrier. It also doesn't matter if they throttle or cap you at 15GB or something, that is what we are about to work around.

If you are going to go the router method it will be a lot more work but the router will handle all the traffic routing and you can just connect any device in your house to your router and it will just work. If you are just going to use your PC then you can generally have this running in ~15 to 30 minutes.

I have personally used anywhere from 80-150GB of data with this method consistantly for 6+ months and never been throttled one time while my traffic was going through the tunnel.

Overview

  1. Download Termux app, install openssh on it, make sure you have python2 as well and simlink the python2 command to python.
pkg install python2
py2_path=$(which python2)
py_path=${py2_path%/*}/python
ln -s "$py2_path" "$py_path"
  1. Configure authentication as explained here for SSH. If you don't already have a keypair it explains how to set up an ssh keypair and use it to authenticate to your phone from a PC. I personally used my existing SSH public key and made a folder / file ~/.ssh/authorized_keys on Termux and dropped it in there with something like curl "https://github.com/rifi2k.keys" > ~/.ssh/authorized_keys if you already have your public keys on github here.

  2. Hotspot your phone.

  3. Run ifconfig inside Termux to get your current tethering local IP. It will be the only 192.x.x.x spit out and generally for andriod will be ending in 192.x.43.x. Save this.

  4. Run sshd -dD inside Termux which starts an openssh server in debug mode to audit traffic. Your looking to see something like this as output from the above command.

debug1: Bind to port 8022 on ::.
Server listening on :: port 8022.
debug1: Bind to port 8022 on 0.0.0.0.
Server listening on 0.0.0.0 port 8022.
  1. Now pop onto a PC and connect it to your hotspot.

  2. Now SSH tunnel all the traffic from the device back through the openssh server your running on the Termux app. Now that you are on the same local network you can SSH tunnel into our saved IP address and port from earlier 192.x.43.x:8022 or similar.

You can use ssh which would look something like this.

If you want to use OpenSSH on Windows my recommendation would be Chocolatey package manager. https://gitlab.com/DarwinJS/ChocoPackages/tree/master/openssh

TERMUX_USER="u0_a249"
TERMUX_IP="192.x.43.x"
TERMUX_PORT="8022"
LOCAL_SOCKS_PORT="8123"
ssh -D $LOCAL_SOCKS_PORT -fqgN $TERMUX_USER@$TERMUX_IP -p $TERMUX_PORT

TERMUX_USER would be your username on the Termux app. TERMUX_IP would be the IP you got from ifconfig in Termux. TERMUX_PORT would be the port sshd is using in Termux. LOCAL_SOCKS_PORT would be the port you want to use for your local proxy.

So then once you run the above ssh command you need to configure a system wide or application specific Socks Proxy which would be proxying all traffic to 127.0.0.1 for the Socks Host and whatever LOCAL_SOCKS_PORT is from above for the Socks Port.

I use sshuttle which already handles most of the gotchas with tcp over tcp etc. and which also has a solution for Windows and linux. Also sshuttle generally handles setting up the Socks Proxy for you. A command for sshuttle might look like this.

Linux

TERMUX_USER="u0_a249"
TERMUX_IP="192.x.43.x"
TERMUX_PORT="8022"
sshuttle -r $TERMUX_USER@$TERMUX_IP:$TERMUX_PORT 0/0 --exclude $hostname 0/0

Windows

On Windows I would download Virtualbox. You can verify the sha256 of the files via PowerShell with Get-FileHash C:\path\to\file.exe. Also you might want to use git bash instead. Then you want to make sure you launch a linux VM in bridged mode.

Then run sshuttle inside the VM following the directions here for sshuttle in a VM.

Inside the VM

sshuttle -l 0.0.0.0 -x 10.0.0.0/8 -x 192.168.0.0/16 0/0

Back on your Windows machine, assuming your VM has the IP 192.168.1.200 on the bridged network.

route add 0.0.0.0 mask 0.0.0.0 192.168.1.200

That should route traffic through the VM and the tunnel.

As long as you make sure all your traffic passes through the tunnel it 100 percent shows that all your internet is being used by Termux app not your hotspot app so you need no other spoofing of hops or anything because to your phone and carrier you are just using a bunch of data in termux, you do it right you will never be throttled.

Contributing

Anyone can feel free to contribute any working method or enhancement to this method. If anyone wants to help with the router stuff have at it. Just open up a pull request.

Issues

Issues or enhancement requests should go here.

unlimited-tethering's People

Contributors

joedf avatar rifi2k avatar whattheserver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unlimited-tethering's Issues

Linux | authentication on user

So if I understand correctly using sshuttle we are sshing with the username u0_a249 what credentials do I use for this?

help setting up in windows 10

I was wondering if you'd be able to help me out with setting this up using openssh in powershell on windows 10?

thanks!

Typo fix on ln command

Minor typo in howto
ln -s "$py_path" "$py2_path"
should be
ln -s "$py2_path" "$py_path"

No such file or directory . . .

I ran these commands exactly as show:

pkg install python2
py2_path=$(which python2)
py_path=${py2_path%/*}/python
ln -s "$py2_path" "$py_path"

The last line generated an error: ln -s "$py2_path" "$py_path
Error: failed to create symbolic link /python no such file

Any thoughts on what I can do?

Simplifying setup with no-you-talk-to-the-hand

Hello. Thanks for a great contribution for our fight with the man. I'd like to suggest you take a look at no-you-talk-to-the-hand. I will not pretend to I have any experience or success with it but I was looking for a solution that would resolve:

  • tunnel dropping silently
  • not being able to use VPN on either mobile or desktop side

For the time being I'm using Every Proxy which works for obfuscating but I have to setup a proxy for each app on desktop which is annoying and why I'd love to use your solution more.

Last step gives me connection refused

So I applied all the steps and everything went fine except for the last one. When I type
"ssh -D $LOCAL_SOCKS_PORT -fqgN $TERMUX_USER@$TERMUX_IP -p $TERMUX_PORT"
it gives me :
"ssh: connect to host xxx.xxx.xx.x port 8022: connection refused
client: fatal: failed to establish ssh session (2)"

Any ideas?

Tunneling ssh?

How would you get ssh to be tunneled over the ssh tunnel?

I've gotten basic http/https working via your instructions, but I'd like to be able to do git pulls/pushes, which use ssh. However, those currently give me the error:

ssh: connect to host port 22: Network is unreachable

presumably because the tunnel isn't forwarding that port.

In addition to running:

ssh -N -D $SOCKS_PORT -p $TERMUX_PORT $TERMUX_USER@$TERMUX_IP

what other options do I need?

sshuttle

I just cant seem to get sshuttle working.
It crashes at end with this

c : fatal: ssh connection to server (pid 14783) exited with returncode 255

can you help?

I have gotten it working I think by excluding the destination(server) ip

The problem is now that it doesn't seem like data usage is only being calculated to unlimited non hot spot data usage.
When I use ssh -N -D 8080 -p 8022 [email protected] and socks 5 on browser it seems to work fine.
Just not with sshuttle!

Any ideas?

confusion

i am currently confused on which commands i need to run on my phone termux and on my pc terminal,
i ran everything through termux on my phone and i am now stuck on the "ssh-copy-id -p 8022 -i id_rsa IP_ADDRESS"

my devices :
alcatel flybox : that has sim card with unlimited internet 30mbps speed, once i hit 25gb internet speed drops to 30kbps
my smartphone
my laptop

It works fine but little bit slow

Hi,

I get 16 Mbps when i use my phone but when i use ssh tunnel with sshuttle i get around 3 Mbps, its still much better than the throttled speeds of 500kbps-1.2Mbit etc.. but its nowhere near 16Mbit.

You also forgot to mention that for sshuttle, one needs to install Python2 on the phone via Termux. You also need to create a symbolic link for the binary python2.7 to python(On the phone) for the sshuttle to function on the PC.

My setup is

Client = FreeBSD

Server = Android 9

Verify that all traffic is tunneled?

I was able to get this all set up and it appears to be working, but speed tests run on my computer (tethered to the phone's hotspot) are still sitting at right around 5mbps (this is the cap on Visible's hotspot), where speed tests run on the phone itself are much higher.

I'm wondering if there is anyway to verify that this is working. Typically I could check the IP but with it tunneling inside the LAN I'm not sure what to do

Connection slows over time

Connection slows over time

Hello! I've been following this guide and have successfully been able to route my data from my phone. Unfortunately, as time passes, I would notice that my speeds would degrade significantly to which restarting the process would be the only way to restore it. As a note, I am aware that the speeds provided by this process does not offer the full bandwidth of the data, but even with the slower initial speed, it degrades even further with time.

Modifications and Oddities

Script
TERMUX_USER="u0_a249"
TERMUX_IP="192.*.254.*"
TERMUX_PORT="8022"
HOSTNAME="hostName"
sshuttle -r $TERMUX_USER@$TERMUX_IP:$TERMUX_PORT 0/0 --exclude $HOSTNAME

As of writing this, I am on Linux using the Sshuttle method to route data from my phone. Using the provided Linux example, I was unfortunately unable to get it to work. With this, I found two solutions to my issue. One solution was to omit the --exclude $hostname 0/0 section of the example while for the other solution, I replaced the $hostname with $HOST. From what I understand, due to the fact that $hostname is an empty variable on my system, it may have broke the example. With this, removing it or replacing it with $HOST, which has my hostname, resolved my issue and allowed the routing to work.

With this issue regarding the hostname, I also would like to point out that for the IP address that I found using ifconfig, no entries had a 192.*.43.* address. Instead, my wlan had an entry for 192.*.254.* to which I adapted accordingly within my script

Are these modifications the possible cause of my issue? With this, What exactly is the reason why we are excluding the host?

Behaviors of Possible Interest

When running the modified script, logs pertaining to channels being closed will repeatedly appear every few minutes or even seconds:

Log
[local sudo] Password: 
c : Connected to server.
Failed to flush caches: Unit dbus-org.freedesktop.resolve1.service not found.
fw: Received non-zero return code 1 when flushing DNS resolver cache.
c : warning: closed channel 9 got cmd=TCP_DATA len=1336
c : warning: closed channel 9 got cmd=TCP_EOF len=0
 s: warning: closed channel 9 got cmd=TCP_STOP_SENDING len=0
c : warning: closed channel 11 got cmd=TCP_DATA len=1336
c : warning: closed channel 27 got cmd=TCP_STOP_SENDING len=0
 s: warning: closed channel 27 got cmd=TCP_EOF len=0
...

Is this behaviour normal for Sshuttle? If this is not, can someone point me to some solutions to fixing this issue?

Additional Info

Client OS: Linux x86_64 (EndeavourOS)
Server OS: Android 12 aarch64

If there is any extra information that would be of help that I can provide, please let me know!

Missing Docs

The readme says you have to install openssh via Termux, linking to https://wiki.termux.com/wiki/Remote_Access for elaboration. However, that page does not explain how to install openssh.

This page does explain, saying you need to run:

apt update && apt upgrade
pkg install openssh

but both of these commands fail. The apt update/upgrade just says a bunch of repos are missing, and the install command says the package openssh doesn't exist.

Does Termux support this installation path anymore, or is it unmaintained?

I'm running Android 13 on a Samsung Galaxy S22.

Not Working on Windows

Is there any way to verify that traffic is going through the proxy via VM? I have Windows 10 desktop USB tethered to phone, sshed into phone, have VM running sshuttle, and added the route. But it seems all traffic is being registered by the tethering app, not Termux.

No connection via Shuttle

I've followed all the instructions in the README for creating an SSH tunnel using Shuttle.

Shuttle reports:

client: Connected.

However, no traffic appears to get tunneled. Running a simple ping google.com times out and I can access no web sites.

Are there any additional steps to get tethering via the tunnel to work?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.