Jeez, so much nonsense talk in here.
Basically, to set this up, you'd need a phone (or phones) and some server that's accessible from anywhere (cheapest Linux VPS would do).
A simplified diagram would look like that:
Code:
[ phone ] <------------------ mobile network --------------------> [ vps ]
| < ssh -R 0.0.0.0:40800:127.0.0.1:10800 -NC vps-ip > [ vps-ip:40800 ]
|
[ socks5 server ]
[ 127.0.0.1:10800 ]
####################################################################################################
[ laptop ] -------.
\ <socks5> [ vps-ip:40800 ]
[ desktop ] --------+------------ [ vps ] <---- phone -------> [ https://api.myip.com ]
/ <mobile network> < will show mobile ip >
[ scraping server ] -'
On the phone, you need to disable Wi-Fi and start a SOCKS5 server. For Android, there's a small handy app that does it: https://github.com/heiher/socks5
It allows to set up username/password for the SOCKS5 server, you better use that (or keep the socks5 server on the phone without any auth, but then you'd need to set up something like https://github.com/nadoo/glider on the VPS that will set up some sort of auth).
With the example above, the settings for such a SOCKS5 server on the phone would be:
- listen address: 127.0.0.1
- listen port: 10800
But setting up just the socks5 server on the phone wouldn't be enough (unless your celluar carrier gives you a static dedicated IPv4 address (or a IPv6 one) with all the ports available, but that'd be rare and/or irresponsible), so you have to set up a "remote port forwarding".
For that, you can use either just plain old SSH (https://play.google.com/store/apps/details?id=com.termux&hl=en + ssh) or some app that does that (i.e. https://play.google.com/store/apps/details?id=com.server.auditor.ssh.client&hl=en).
In case of Termux + SSH, the command would be
Code:
ssh -R 0.0.0.0:40800:127.0.0.1:10800 -NC vps-ip
. (i'm omitting ssh authentication; better set up ssh keys for that)
In case of Termius:
- in Port Forwarding, create a new Remote Port Forwarding with such settings:
- remote host: <vps ip>
- remote port: 40800
- bind address: 0.0.0.0
- destination address: 127.0.0.1
- destination port: 10800
- save & start
Warning: if you have it bound to 0.0.0.0:40800, it means that whoever connects to vps-ip:40800 will be able to reach the phone's socks5 server (that's at 127.0.0.1:10800 on the phone) directly. Make sure your phone has SOCKS5 server set up with username/password authentication. If you can't/don't want to do that, it's better to use 127.0.0.1:40800 instead of 0.0.0.0:40800 and then have glider to set up an additional proxy server that'll handle auth and whatnot.
So, with such a set up, you should be able to connect through the socks5://vps-ip:40800 and it will route through the phone's cellular network.
In case you need some more complicated setup (i.e. no auth on the phone's proxy server or you want socks5+http proxy or whatever), you can set up glider. See its https://github.com/nadoo/glider/blob/main/README.md for details and examples;
i.e. running this on the VPS will start a SOCKS5+HTTP proxy server on the port 50800 with username "blackhat" and password "whitehat" (given that you didn't have socks5 auth on the phone set up):
Code:
glider -verbose -listen blackhat:[email protected]:50800 --forward=socks5://127.0.0.1:40800
(so you connect to socks5://blackhat:whitehat@vps-ip:50800 or http://blackhat:whitehat@vps-ip:50800 instead)
in case of multiple phones, you may set up the proxy servers on it with the same configuration (i.e. 127.0.0.1:10800), but then you'd need to use different ports for the remote forwarding on each phone, i.e.
phone1: socks5 server at 127.0.0.1:10800, forwards 127.0.0.1:10800 to vps-ip at 127.0.0.1:40800
phone2: socks5 server at 127.0.0.1:10800, forwards 127.0.0.1:10800 to vps-ip at 127.0.0.1:40801
phone3: socks5 server at 127.0.0.1:10800, forwards 127.0.0.1:10800 to vps-ip at 127.0.0.1:40802
and on the VPS side you could set up automatic rotation of these phones kinda like that:
Code:
glider -verbose -listen blackhat:[email protected]:50800 -forward socks5://127.0.0.1:40800 -forward socks5://127.0.0.1:40801 -forward socks5://127.0.0.1:40802
(glider can rotate IPs different ways, too; i.e., see the https://github.com/nadoo/glider/blob/main/config/examples/4.multiple_forwarders/glider.conf example)
if you got a single phone and want to get a different mobile IP, you can stop the port forwarding on the phone, toggle airplane mode on and off, and re-start the port forwarding. (YMMV)
obviously, this setup works on mud and straws. this is perfect for some one-time/quick usage. you'll have to do extra steps to make it more reliable.
fml why did i spend 30 minutes of my time explaining this
