Skip to main content

how to use mobile network hotspot wan for website in linux / install ngrok / portword with mobile hotspot



Share Your Local Web Server Publicly using ngrok 

how to portword with linux mobile 3g 4g internet

without router share you your website

As a web developer, my workflow often includes writing a little code, firing up a local web server, and doing a quick smoke test to make sure things look alright. Occasionally, I'll encounter a situation where I'll need someone else (coworker, client, etc.) to provide some feedback on a design decision before moving forward. If I'm in the office, it's easy. I'll just call them over to take a look.

However, there are times when I need to share my local changes with someone remotely and get feedback quickly. If the change is relatively minor, deploying to some staging environment might be overkill. How can I expose my local web server publicly so my clients can view my changes and provide immediate feedback?

What is ngrok?


ngrok is a reverse proxy that creates a secure tunnel from a public endpoint to a locally running web service. ngrok captures and analyzes all traffic over the tunnel for later inspection and replay.

What can I do with ngrok?


  1. Expose any http service behind a NAT or firewall to the internet on a subdomain of ngrok.com.
  2. Expose any tcp service behind a NAT or firewall to the internet on a random port of ngrok.com.
  3. Inspect all http requests/responses that are transmitted over the tunnel.
  4. Replay any request that was transmitted over the tunnel.

What is ngrok useful for?


  1. Temporarily sharing a website that is only running on your development machine.
  2. Demoing an app at a hackathon without deploying.
  3. Developing any services which consume webhooks (HTTP callbacks) by allowing you to replay those requests.
  4. Debugging and understanding any web service by inspecting the HTTP traffic.
  5. Running networked services on machines that are firewalled off from the internet.
  6. use mobile internet , sim internet and hotspot internet worldwide without port fwding 
  7. use your internet for wan attack (settoolket phishing and ratattack with metaspoilt)

Enter, ngrok!


ngrok, creates a secure tunnel from a randomly-assigned, public internet address to a locally running web service. It also captures any traffic moving through the tunnel, allowing users to inspect HTTP request data. ngrok has several uses, and publicly exposing a local web server is one of them.

Installation


There really is no "installation" required. You simply visit the download page and follow the instructions.

i am using kali linux so i will download linux (3)  after download extract  the zip file and copy the extracted file at "/usr/local/bin

steps to extract zip file and copy to the bin location with terminal 

  • open command line, press CTRL + ALT + T
  • extract the zip file and copy to /usr/local/bin (assuming the zip file is in ~/Downloads)
  • cd ~/Downloads
    sudo unzip ngrok-stable-linux-amd64.zip -d /usr/local/bin/
  • done!
 ●Install your authtoken (auth code below is a example copy auth token from ngrok.com account.Copy the authentication code from your account in ngrok.com we will be using this to authenticate our tunnel. You can do this by going to the folder where ngrok is stored and using .(GO TO NGROK WEBSITE SIGN IN AND THEN COPY AUTH CODE
/ngrok authtoken

yourauthtokenhere ” The authentication code will then be saved.
Example Authtoken Screen Shot Shows Ngrok Auth Code (This account is not used by HackingVision and was deleted after this tutorial)

●To create your first secure tunnel use the command below to set up a tunnel on port 80 I’m using http port 80 for SET use whatever port you would like ngrok to tunnel through.


 Now you should be able to run ngrok command from anywhere, because the ngrok binary is already copy to /usr/local/bin/.



 How to use ngrok

Let's say you have a local web server running on port 80, and you want to make that localhost accessible through the internet using ngrok, then you need to run this command:
ngrok http 80
ngrok http [port-number]

 i am running my localhost with apache2 with html simple website you can run your apache2 by this command 

 service apache2 start



Once ngrok is launched, it will display the following:

1
2
3
4
5
6
7
8
9
ngrok (Ctrl+C to quit)
 
Tunnel Status                 online
Version                       1.7/1.7
Forwarding                    http://2779ffc7.ngrok.com -> 127.0.0.1:3000
Forwarding                    https://2779ffc7.ngrok.com -> 127.0.0.1:3000
Web Interface                 127.0.0.1:4040
# Conn                        0
Avg Conn Time                 0.00ms

Using the information provided above, we have our public web address: http://2779ffc7.ngrok.com. We can share this URL with our collaborators! Any visits to this URL will be tunneled to our local web server. As people visit the URL, ngrok will update by displaying any HTTP requests flowing through the tunnel:
1
2
3
4
5
HTTP Requests
-------------
 
GET /favicon.ico              200 OK
GET /                         200 OK

Further Request Inspection with the Dashboard

ngrok provides a introspection dashboard which is hosted locally at http://localhost:4040/.


Since all HTTP traffic is captured by ngrok, more detailed information about each request can be explored on the dashboard. The dashboard updates in real-time. So, as people view your exposed website, the dashboard will update along with each request. You can explore request time, duration, headers, parameters, etc. It even pretty-prints JSON and XML responses to make them easier to read.