Mobile Hotspots

by Street & Weregeek

Mobile phone plans often claim to provide unlimited data, but if you read the fine print it is only for data used directly by your phone.  In reality, they only give you little or no data allowance when using your phone as a mobile hotspot.  For hackers, this creates an interesting challenge.  And with some clever engineering, it's possible to get around this hotspot limit.

One easy way around it is to avoid using the hotspot entirely for downloads.  I can get away with my hotspot for surfing the web.  But I'll often use a USB drive with two connectors for my downloads.  These have USB-C connectors for phones and USB-A connectors for computers.

You can do this by:

  • Downloading the files directly to your phone using mobile data.
  • Copying them from your phone to the USB drive.
  • Plugging the USB drive into your laptop to upload the files.

Sometimes I also like to turn my phone into a Linux terminal.  I use an app on my phone to SSH into other servers.

Here's how you can do this:

  • Install the Termux app on your Android phone.
  • Use Termux to connect to a remote Linux server using SSH.
  • You can add a Bluetooth keyboard to make typing easier.

If you're near free public Wi-Fi you can:

  • Connect your laptop to public Wi-Fi.
  • Route your browser traffic through a VPS.

There is also a way to use an SSH tunnel to route your laptop's Internet through your phone.  This method is often against phone company rules and may even be illegal.

Steps:

  • Connect your laptop to your phone's hot spot.
  • Open Termux on your phone and install the SSH server: pkg update && pkg install openssh -y
  • Start the SSH server: sshd
  • Get your username: whoami
  • Set a password: passwd
  • Find your phone's IP address: ifconfig  (Example:  192.168.0.4)

Termux uses port 8022 for SSH by default.

Now go to your laptop:

Build an SSH tunnel and SOCKS proxy using your SSH client (PuTTY or OpenSSH):

For PuTTY:

  • Open PuTTY.
  • Enter the host name as: username@192.168.0.4
  • Set the port to: 8022

In PuTTY, go to: Connection -> SSH -> Tunnels

  • Turn on "Local Ports Accept Connections".
  • Set "Source Port" to 8080 and click Add.
  • Set "Destination" to "Dynamic".
  • Save the PuTTY Configuration.

For OpenSSH:

  • Open your terminal emulation program of choice on your laptop.
  • Type: ssh username@192.168.0.4 -p8022 -D8080
  • Enter your password when prompted.
  • Open Firefox and go to: Settings -> Network Settings
  • Choose Manual Proxy Configuration.
  • Set "SOCKS Host" to 127.0.0.1 and port to 8080.
  • Choose SOCKS v5.

Now Firefox is sending its traffic through your phone's SSH tunnel.

If you want to route all traffic through your phone, you can use Proxifier:

  • Install and run Proxifier on your laptop.
  • Open Proxifier from the Task Manager
  • Go to: Profile -> Proxy Servers
  • Add 127.0.0.1 on port 8080 using SOCKS5.

This way, all traffic from your laptop goes through Termux, not your hotspot.  This is usually faster and won't count against your hotspot data.

Sometimes you need to restart the tunnel.  If something breaks, just close Termux and stop the proxy on your laptop.  Then follow the steps again to get it working.

If you want to, you can also monitor the data usage on your phone using another app.

Return to $2600 Index