ngrok
Ngrok overview and setting up reverse shells
Overview
With it, we can expose local networked services (like a TCP listener, SSH, or web server) to the public internet through a unique ngrok-generated URL
There are methods to build authentication or allowlisting around this but they're not part of the free tier
Registration
After signing up for a free ngrok account, follow the setup instructions to get ngrok set up on your machine
Example - Reverse Shell
Ngrok and local listener setup
On your machine run a command to capture TCP traffic
This will provide you with a free forwarding address (you can also set up a custom domain)
You will need a way to catch incoming connections, we can use
nc
for this like so:
Reverse shell setup and execution
On a different machine, execute a reverse shell and the traffic should be sent to your machine
Check out pentestmonkey and revshells for additional reverse shell options
Tip - If you're running a bash reverse shell, ensure the current shell is bash, or you'll get an error like the one below. Otherwise, you can specifically call on bash using the command above from any shell so long as bash is installed
Another option is to use reverse-shell.sh which acts as a reverse shell as a service
You can go to this URL directly in your browser and see the script that would execute
Once the shell has successfully executed, you should see it in your listener e.g.,
nc
Last updated