install ngrok in termux
Hacking and Infosec

How to install ngrok in termux – Configure ngrok for port forwarding
The complete process of installing and configuring ngrok for port forwarding on termux

As I promised in my previous article, I’ll tell you how to install ngrok in termux. Here is the complete method of installing and setting up ngrok on termux. In this article, I’ll tell you about ngrok. You’ll learn what is ngrok, what is port forwarding, and how to use it. This is a short but important article. Because port forwarding is something you must know if you want to hack. So let’s get started.

Read: How to install the metasploit framework in termux.

What is Port Forwarding?

Port forwarding is used to allow external devices to access services on a private network. Well, the technical definition of port forwarding is a bit different. I used the simplest words to give you an idea. While performing hacking attacks on devices not on our network. Port forwarding is used. We need a static IP address for port forwarding.

What is ngrok?

Now if we don’t have a static IP. What should we do? Here comes ngrok. We use ngrok to forward ports. It is actually used to expose our localhost to the web. Using ngrok, you don’t need to open a port to your LAN.

Read: What is termux? A complete guide for using termux.

How to install ngrok in termux?

There is no rocket science in installing ngrok. You just need to download the setup. Here is how to do it:

  1. Go to the ngrok download page here
  2. Click on ‘Download for Linux
  3. Now open your download directory in termux:
    In my case, it’s sdcard/Downloads
    So the command will be:
    cd /sdcard/Downloads
  4. Now type ls’ and hit enter
  5. You’ll see a ‘ngrok-stable-linux-arm.zip’ file.
  6. Unzip the file to the termux.
    unzip ngrok-stable-linux-arm.zip
  7. Now open the directory and move the ngrok file to the termux home directory. Use these commands.
    cd ngrok-stable-linux-arm
    mv -v ngrok /$HOME
  8. Now give permission to ngrok to install it. Use this command:
    chmod +x ngrok
  9. Now simply install it using this command:
    ./ngrok
  10. You’re done.

How to configure ngrok?

Now we’re done with installation. It’s time to configure ngrok for port forwarding. Follow these steps:

  1. Go to the ngrok official site: https://ngrok.com/
  2. Click on ‘Get started for free

    ngrok setup 1
  3. Sign up using email or Google account or GitHub account.

    ngrok setup 2
    ngrok setup 2
  4. Now you’re in the dashboard. Click on ‘Auth’

    ngrok setup 3
    ngrok setup 3
  5. And Copy the auth token. Or copy the command:
    ./ngrok authtoken [token]

    ngrok setup 4
  6. Now open your termux app, and paste the token and hit enter.
  7. You’re done.
  8. For help: Type command:
    ngrok help
    To get started, choose a port and hit enter. For example, I choose port 80:
    ngrok http 80

So this was a short writeup on ngrok. I’ll see you in next writeup about another termux hacking tool. See you then.

Shehriar Ahmad
Shehriar Ahmad Awan is a Writer, Researcher, Developer and Cybersecurity researcher. He's the co-founder of Sprotechs.
https://sprotechs.com