install web server and tor hidden service to android phone
no root required

1
2
3
4
5
6
7
install termux
pkg update
pkg install ip-route2
pkg install sshd
ip address // get your ip
whoami
passwd // set password

from your pc

ssh username@ip_address -p 8022 // login with password

now its easier from your pc keyboard

1
2
3
pkg install tor
pkg install python
nano /data/data/com.termux/files/usr/etc/tor/torrc

uncomment first HiddenService (remove # from beginning):

HiddenServiceDir /data/data/com.termux/files/usr/var/lib/tor/hidden_service/
HiddenServicePort 80 127.0.0.1:80

change 127.0.0.1:80 -> 127.0.0.1:8000

1
2
3
4
5
mkdir -p /data/data/com.termux/files/usr/var/lib/tor/hidden_service/
mkdir ~/http
cd ~/http
echo '<html><body><h1>hello</h1><p>test test</p></body></html>' > index.html
python -m http.server

open web browser in pc, go to:
http://ip_address:8000

get server onion address

cat /data/data/com.termux/files/usr/var/lib/tor/hidden_service/hostname

launch tor

tor

open tor enabled browser, go to:
http://hostname.onion

run it in background

1
2
3
pkg install screen
screen python -m http.server
screen tor

now you can close ssh connection and server is still up

Edit

Pub: 31 Jan 2024 23:52 UTC

Edit: 01 Feb 2024 00:13 UTC

Views: 102