как установить ngrok kali linux
linux-notes.org
Например у вас имеется на виртуальной машине веб сервер и вы с ним работаете. Но заказчик требует показать уже наработки сайта который вы ему делаете. У него еще нет хостинга, а код имеется только на локалке. Возможно варианты:
Но нет! Не стоит этого делать! С этим справиться ngrok — простая программа которая создает туннель к localhost.
Установка ngrok в Unix/Linux
Идем далее, мы ее скачали, теперь нужно распаковать:
Я скопирую данную утилиту в:
Чтобы вывести помощь, используйте:
и так, создаем туннель:
Где 80 — это порт с которым работает nginx/apache на виртуальной машине. При запуске команды выше, получите что-то типа:
Где http://7cb0094e.ngrok.io — это адрес в интернете. Можно в hosts файл прописать домен, например, captain.local, после чего запускаем:
Где, captain.local — локальное доменное имя. Статья «Делаем локальный сервер доступным в интернете с ngrok в Unix/Linux» завершена.
One thought on “ Делаем локальный сервер доступным в интернете с ngrok в Unix/Linux ”
как-то не хочется проприетарную программу под рутом запускать…
Добавить комментарий Отменить ответ
Этот сайт использует Akismet для борьбы со спамом. Узнайте, как обрабатываются ваши данные комментариев.
Everything About Ngrok How to use & install
Last Updated on April 18, 2021 by Walid Salame Leave a Comment
Ngrok is a platform that, using the installed utility, allows you to organize remote access to a web server or some other service running on a PC. Access is organized through the secure tunnel created when ngrok starts. At the same time, the PC can be behind NAT and not have a static IP address.
It is not at all necessary to drag the test project somewhere else, you can show it to the customer directly from the local machine, or, for example, using Ngrok, you can very easily share files on your PC.
What is Ngrok?
The ngrok tool makes local services available on the global network, even if the computer does not have a static IP address and is behind NAT and firewalls.
With ngrok, any port on your local computer will be accessible from the Internet through a secure tunnel. For example, you can make your local web server accessible from the Internet via a direct link without additional configuration.
How does ngrok work?
You download and run a tool on your machine and specify the port of a network service, usually a web server.
The program connects to the ngrok cloud service, which gives you a generated address (third-level domain). If you open this address in a web browser, then the traffic will be redirected to your local network service or to any address that you specify.
What is ngrok used for?
how to install ngrok
Installation on Kali Linux
to install ngrok in Kali Linux first we need to download Ngrok from terminal
Ngrok Commands
What are the most important commands and how to use them
Setup Ngrok Authtoken
Authtoken command reference
authtoken stores the authentication token in a config file.
Using: ngrok TOKEN [COMMAND OPTIONS] [ARGUMENTS …]
To use many of the advanced features of the service, the ngrok.com service requires you to register for an account. To associate your client with an account, they must pass a secret token to the ngrok.com service at startup. Instead of passing this authtoken on every call, you can use this command to store it in a config file so that your client always authenticates you properly.
Credits command reference
credits prints information about the author and licensing.
Ngrok Https command reference
http starts an HTTP tunnel.
Using: ngrok http [COMMAND OPTIONS] [ARGUMENTS …]
Starts a tunnel listening for HTTP / HTTPS traffic with the specified hostname. The HTTP Host header on incoming public requests is checked to determine which tunnel is right for it.
HTTPS endpoints terminate TLS traffic on the ngrok server using ngrok.io certificates. The decrypted HTTP traffic is then routed through a secure tunnel and then to your local server. If you don’t want your TLS traffic to end on the ngrok server, use a TLS or TCP tunnel.
Redirects ngrok.io subdomain to local port 80:
Redirects traffic to example.com:9000:
Requests the subdomain name: ‘bar.ngrok.io’
Requests tunnel ‘ex.com’ (DNS CNAME):
Requests basic authentication on the tunnel endpoint:
Rewrites the Host header to ‘ex.com’:
Allows access from the Internet to local files in /var/log:
Redirects to local https server:
Start command reference
start starts the tunnel by name from the config file.
Using: ngrok start [COMMAND OPTIONS] [ARGUMENTS …]
The Ngrok start command Runs tunnels by name from a config file. You can specify any number of tunnel names. You can start all tunnels from the configuration file by specifying the –all switch.
Examples:
Run a tunnel named in the ‘dev’ config file:
Run the ‘web’ and ‘blog’ tunnels:
Run all tunnels defined in the config file:
Tcp command reference
tcp starts a TCP tunnel.
Using: ngrok tcp [COMMAND OPTIONS] [ARGUMENTS …]
The TCP Command Launches a tunnel that redirects all TCP traffic from the public port to the local address. This is extremely useful for providing services that run on non-HTTP traffic (ssh, sip, rdp, game servers, etc.).
A TCP tunnel binds a public address on a remote ngrok server. Any services that require a stable public address should use the –remote-addr parameter. ngrok.com requires you to reserve a TCP tunnel address for your account before you can use it.
Forward port to your local ssh server
Provide an RDP server at a specific public address that you have reserved
Tls command reference
tls starts a TLS tunnel.
Using: ngrok tls [COMMAND OPTIONS] [ARGUMENTS …]
The tls command Starts a tunnel to listen for TLS traffic on port 443 with the specified hostname. The TLS SNI (Server Name Indication) extension field on the TLS connection is checked to determine which tunnel it fits into.
The ngrok server does not terminate TLS connections forwarded with this command. Any basic protocol can be used. Optionally, you can specify a TLS key / certificate pair that will be used to terminate client-side traffic before it is forwarded. If not specified, traffic will be sent encrypted.
Forward TLS traffic for example.com to port 443 (CNAME required)
Forward TLS traffic to subdomain (certificate mismatch warning)
Terminate TLS traffic for t.co before forwarding
Update command reference
updates ngrok to the latest version.
Using: ngrok update [COMMAND OPTIONS] [ARGUMENTS …]
Updates ngrok to the latest version. This command checks the ngrok web service for newer versions of the ngrok client. If a newer version is available, it will be downloaded, the downloaded file will be authenticated and the current executable file will be replaced with the new one.
For a successful update, the ngrok binary must be in a writable directory by the current user. If you put ngrok in your system PATH, you may need to run it as root or administrator.
Update ngrok to the latest stable version:
Update ngrok to the latest beta version:
How to use ngrok
Examples of running ngrok
Create a tunnel from the generated subdomain accessible via a public link to local port 80 (web server):
Immediately after launch, you can see that the service created a temporary subdomain of the form c68c9c03db47.ngrok.io to provide access to the PC, and locally at 127.0.0.1:4040, a panel was launched that displays data on remote connections to the tunnel. We try to open the c68c9c03db47.ngrok.io domain from anywhere, and get access to the directory configured on the web server.
Tunnel to the specified HOST: PORT (foo.dev:80) instead of localhost:
Make the local HTTPS server accessible from the global network:
Tunneling arbitrary TCP traffic to port 22:
Creating a tunnel (http) to the kalitut.com site using the https protocol (https://kalitut.com) with replacing the Host HTTP header with kalitut.com (-host-header = kalitut.com) :
Good to know
The token will be written to the file
We proxy to other PCs on the local network
It is not at all necessary to keep the web server on the same machine where Ngrok runs. If the service on the local network is running on a separate machine, we can proxy traffic there:
We work not only with the web server
In fact, we can configure remote access to any tcp service running on a PC. For example, if we want to get access via SSH, we can do like this:
Installing on Windows
Go to the official website page and download ngrok for Windows: https://ngrok.com/download
To check, display the help with the command:
HackWare.ru
Этичный хакинг и тестирование на проникновение, информационная безопасность
Как узнать точное расположение пользователя
Как узнать где находится человек
В этой статье будет показано, как с помощью социальной инженерии узнать точное (до дома) расположение пользователя. Это будет важно и тем, кто хочет защититься от подобных атак — вы увидите, чего категорически нельзя делать на ненадёжных сайтах и узнаете, какую информацию о вас может получить лицо, приславшее вам ссылку.
Описанная атака сработает, если пользователь откроет нашу ссылку с мобильного телефона (для точного определения расположения нужен GPS на устройстве «жертвы») и разрешит сайту использовать расположение пользователя. Независимо от того, включён ли GPS, при открытии пользователем ссылки мы получим следующую информацию:
Если будут получено разрешение на доступ к расположению, мы можем получить:
Алгоритм действий очень простой:
Программы для поиска расположения пользователя
Нам понадобятся две программы:
Я покажу пример атаки из Kali Linux, если у вас другой дистрибутив, то инструкции по установке смотрите по ссылкам выше в карточках этих программ.
Установка seeker в Kali Linux
Установка ngrok в Kali Linux
Инструкция по использованию seeker
Далее всё очень просто, запускаем seeker:
На выбор присутствует два готовых шаблона:
Допустим, выбираю первый.
Затем выводится информация:
В ней сказано, что PHP сервер успешно запущен и ожидается взаимодействие с пользователем.
Теперь для создания тоннеля из Интернета до нашего локального сервера, в другом окне запускаем ngrok:
Сгенерирована ссылка https://1fa595b3.ngrok.io. Её нужно отправить «жертве». Предположим, пользователь открыл ссылку на настольном компьютере. В этом случае он увидит:
Страница выглядит очень профессионально, красивая анимация. Надписи говорят о том, что этот сервис позволяет найти людей рядом с вами и завести новых друзей. Предположим, пользователь нажал кнопку «Continue»:
Возникает запрос на доступ к местоположению.
В окне seeker мы видим следующее:
Мы узнали IP и User Agent пользователя, но данные о местоположении не получены, просто потому, что у компьютера нет GPS модуля:
Откроем теперь фишинговую ссылку на мобильном телефоне.
Запрос данных о местоположении:
В этот раз получены данные локации:
Также сказано, что данные сохранены в файл по пути ./seeker/db/results.csv (относительно папки с файлами seeker). В этом файле хранятся все данные, в том числе с предыдущих атак.
Что можно улучшить для реальной атаки
Несмотря на полную реализацию и упаковку в удобную и простую программу, это скорее инструменты для демонстрации рабочего концепта атаки, чем для реальной атаки.
При выполнении реальной атаки можно сделать следующие улучшения:
Как поделиться своим локальным веб-сервером с Интернетом. Ngrok
Довольно часто у разработчика возникает необходимость показать свои наработки, расположенные на локальном компьютере. Если же приходится тестировать мобильные приложения, то доступ к API также нужен.
Конечно, можно купить ip-адрес, домен, хостинг, настроить всё это. Но проще, быстрее и доступнее использовать утилиту ngrok, создающую туннель к localhost.
Скачать ngrok можно по адресу: https://ngrok.com/
Программа доступна для Mac OS, Windows, Linux и FreBSD. В ограниченном режиме можно использовать бесплатно, которого, к слову сказать, хватает с лихвой в большинстве случаев.
Для начала нужно установить программу.
Установка Ngrok
Mac OS X 64-Bit:
Linux 64-Bit:
Linux 32-bit:
FreeBSD 64-Bit:
FreeBSD 32-Bit:
Например, для Xubuntu:
Если выдаёт ошибку, проверьте права на запись файлов в указанной директории.
Далее необходимо распаковать архив. В нашем случае с Xubuntu:
Или сделать распаковку в окне:
Теперь перемещаем утилиту:
Затем даём права на запуск скрипта:
Вывести помощь в терминале можно командой:
Создание туннеля в простейшем варианте (обратите внимание на порт, обычно он 80, у мена 8000):
Где http://370f2cc5.ngrok.io уникальный адрес в Интернет.
Можно в hosts файл прописать домен, например, mysite.local, после чего запустить туннель:
Если зарегистрироваться, то:
How to install and use Ngrok – Complete Guide 2018
Ngrok is one of the most popular tunnel service platform through which you can easily expose your local servers which is behind NATs/Firewalls to the public internet over secure tunnels.
It connects to the ngrok cloud service which accepts traffic on a public address and relays that traffic through to the ngrok process running on your machine and then on to the local address you specified.
Features of Ngrok –
Related Articles on Ngrok –
In paid plans –
Step 1 – Create a Free Account on Ngrok.com, basically you can create an account on Ngrok by three ways.
You can choose any way for signing up into Ngrok.
Step 2 – After confirming the account with your mail ID, just try to login with the same details which you’ve used while creating the account.
Step 3 – After successful signup, you’ll a Dashboard Page in front of you just like below:
Step 4 – Now you need to download the Ngrok package from the Download Page.
Based on your operating system, you can choose the file and ngrok supports all OS (Windows/Linux/MacOSX)
Step 5 – Next step is to install the package which you’ve downloaded from previous step.
Step 6 – Now to use ngrok in windows, run command prompt from same directory where you’ve downloaded the package.
Step 7 – Furthermore, you also need to install an authtoken. By running below command will add your account’s authtoken to your ngrok.yml file.
For Windows:
Command: ngrok.exe authtoken
For Linux/MacOSX:
Step 7 – Starting your first tunnel
Once you have your local server running, you can open a tunnel to the port where your application is running.
For local web server to internet, type “ngrok.exe http 80” in your cmd terminal.
Here you can see that, we’ve created a dummy index.php file into our xampp server which can easily be accessed on Internet with the help of Ngrok tunnelling address.
You can also inspect your all incoming HTTP traffic by using their web based portal which you can easily access by opening http://localhost:4040 in your web browser.
As we see, ngrok assigns random hexadecimal names to every HTTP tunnels which it opens for you but if you want to display a custom URL then you actually start the ngrok service with a custom name as shown in below command:
Then your internet address will be http://yeahhub.ngrok.io/
In Business/Pro/Basic plan, you can even use your custom domain with the help of CNAME Records.
Pricing Plans –
More Tunneling Options –
1. Forward TLS traffic to a local HTTPS server on port 443
Command: ngrok.exe tls 443
2. Expose a TCP based service running on port 22
Command: ngrok.exe tcp 22
Default configuration file locations –
For more information about ngrok, read ngrok docs manual.