Previously LordVordex published a post on using Servio to forward ports without router access,
Serveo.net is great for port forwarding but due to some issues the service sometimes gets temporarily disabled.
Luckily serveo.net isn’t the only port forwarding / tunnelling service available. Alternatively we can use ngrok or localtunnel for achieving the same effect.
In the following steps I will be explaining how to use localtunnel as that is my preferred one.
Localtunnel allows you to easily share a web service on your local development machine without messing with DNS and firewall settings. It will assign you a unique publicly accessible url that will proxy all requests to your locally running webserver.
Now to make localtunnel accessible globally through any network you will first need to install nodejs on your machine, rest assured everything in here is a very simple process.
Firstly go to nodejs.org from your Kali Linux machine.
Here you will find the latest version that’s available for your operating system. Now to install nodejs on your Kali machine via packet manager open terminal and first run the following commands:
apt-get update apt-get install curl software-properties-common
The above commands will first update your software sources, and install needed software for nodejs, when its done run the following command to download the nodejs installer:
curl -sL https://deb.nodesource.com/setup_13.x | sudo bash -
Note : you can change the ‘ 13 ‘ in the command to whichever version of nodejs you want installed. Currently the latest version is 13 so that’s what I’m using.
That’s it now you have nodejs and npm installed.
If you want to again which version of nodejs and npm you have installed you can always do so by running:
node –v npm –v
Now to Install Localtunnel globally to make it accessible anywhere run :
npm install -g localtunnel
Its all done now whenever you want to Start a webserver on some local port (eg http://localhost:80) use the command line interface to request a tunnel to your local server:
lt --port 80
This will give you a url which you can open on any device in the world and it will tunnel the port to your machine. Just make sure you have your apache service running from your kali machine before accessing the link through another device.
Put a /Evil Files (or whatever name with which you have saved your evil files in and it’ll open on the other device outside your network)
Also create your payload with the desired port and use localtunnel to tunnel that port to so that you can get a reverse connection from the target device.
Hope this helps, Happy tunnelling 🙂