diff --git a/README.md b/README.md new file mode 100644 index 0000000..c0e29cf --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# ngrok - Introspected tunnels to localhost ([homepage](https://ngrok.com)) +### "I want to securely expose a web server to the internet and capture all traffic for detailed inspection and replay" +![](https://ngrok.com/static/img/overview.png) + +## What is ngrok? +ngrok is a reverse proxy that creates a secure tunnel between 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? +- Expose any http service behind a NAT or firewall to the internet on a subdomain of ngrok.com +- Expose any tcp service behind a NAT or firewall to the internet on a random port of ngrok.com +- Inspect all http requests/responses that are transmitted over the tunnel +- Replay any request that was transmitted over the tunnel + + +## What is ngrok useful for? +- Temporarily sharing a website that is only running on your development machine +- Demoing an app at a hackathon without deploying +- Developing any services which consume webhooks (HTTP callbacks) by allowing you to replay those requests +- Debugging and understanding any web service by inspecting the HTTP traffic +- Running networked services on machines that are firewalled off from the internet + + +## Downloading and installing ngrok +ngrok has _no_ runtime dependencies. Just download a single binary for your platform and run it. Some premium features +are only available by creating an account on ngrok.com. If you need them, [create an account on ngrok.com](https://ngrok.com/signup). + +- [Linux](https://dl.ngrok.com/linux_386/ngrok.zip) +- [Mac OSX](https://dl.ngrok.com/darwin_386/ngrok.zip) +- [Windows](https://dl.ngrok.com/windows_386/ngrok.zip) + +## Install +- One click Install ngrok + +wget http://soft.clang.cn/ngrok/ngrok_install.sh && bash ./ngrok_install.sh + diff --git a/ngrok_install.sh b/ngrok_install.sh new file mode 100644 index 0000000..d4b8ee8 --- /dev/null +++ b/ngrok_install.sh @@ -0,0 +1,203 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH +shell_run_start=`date "+%Y-%m-%d %H:%M:%S"` #shell run start time +# Check if user is root +function rootness(){ + if [[ $EUID -ne 0 ]]; then + echo "Error:This script must be run as root!" 1>&2 + exit 1 + fi +} + +get_char() +{ + SAVEDSTTY=`stty -g` + stty -echo + stty cbreak + dd if=/dev/tty bs=1 count=1 2> /dev/null + stty -raw + stty echo + stty $SAVEDSTTY +} + +function fun_clangcn.com(){ +echo "" +echo "#############################################################" +echo "# One click Install Ngrok" +echo "# Intro: http://clang.cn/blog/" +echo "#" +echo "# Author: Clang " +echo "# version:1.0" +echo "#############################################################" +echo "" +} + +# Check OS +function checkos(){ + if [ ! -z "`cat /etc/issue | grep bian`" ];then + OS=Debian + elif [ ! -z "`cat /etc/issue | grep Ubuntu`" ];then + OS=Ubuntu + else + echo "Not support OS, Please reinstall OS and retry!" + exit 1 + fi +} + +# Disable selinux +function disable_selinux(){ + if [ -s /etc/selinux/config ] && grep 'SELINUX=enforcing' /etc/selinux/config; then + sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config + setenforce 0 + fi +} + + + +function fun_set_ngrok_domain(){ + # Set ngrok domain + NGROK_DOMAIN="" + read -p "Please input domain for Ngrok(e.g.:ngrok.clang.cn):" NGROK_DOMAIN + check_input +} + +function fun_set_ngrok_pass(){ + # Set ngrok pass + ngrok_pass="" + read -p "Please input password for Ngrok:" ngrok_pass +} + +function check_input(){ + # check ngrok domain + if [ "$NGROK_DOMAIN" = "" ]; then + echo -e "Your input is empty,please input again..." + fun_set_ngrok_domain + else + echo -e "Your domain: \033[41;37m "${NGROK_DOMAIN}" \033[0m." + fun_set_ngrok_pass + fi + # check ngrok pass + if [ "$ngrok_pass" = "" ]; then + echo -e "Your input is empty,please input again..." + fun_set_ngrok_pass + else + echo -e "Your ngrok pass: \033[41;37m "${ngrok_pass}" \033[0m." + echo -e "\033[32m \033[05mPress any key to start...\033[0m" + char=`get_char` + pre_install + fi +} + +function config_runshell_ngrok(){ +cat > /root/.ngrok_config.sh <&1 | tee $HOME/ngrok_install.log +exit 0 -- libgit2 0.21.0