注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

itoedr的it学苑

记录从IT文盲学到专家的历程

 
 
 

日志

 
 

端口映射和代理工具:stone  

2013-11-22 05:22:31|  分类: 网络转发 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

stone是一个TCP、UDP端口映射软件,也可以做简单的HTTP代理使用。

stone特性:
1. 支持Linux和windows,使用C语言编写,开放源代码。
2.支持IPv4和IPv6。
3.支持TCP、UDP,同样支持SSL和POP等高级协议。


使用简介:
1.TCP端口映射
D:\stone23xp>stone.exe 192.168.1.88:22 22

将192.168.1.88的22端口,映射到本地的22端口(访问本地22端口,就可以访问到192.168.1.88的22端口)

2.UDP端口映射
./stone 192.168.1.2:53/udp 53/udp
将192.168.1.2的53端口DNS服务,映射到本地

3.代理功能
D:\stone23xp>stone.exe proxy 192.168.1.52:8090

在本地开启一个简单的HTTP代理。

当然,这个软件还有支持SSL的功能,类似于nginx的反向代理功能,也支持负载均衡和后端服务健康检查。
stone(1)                                                      General Commands Manual                                                      stone(1)



NAME
       stone - a simple TCP/IP packet repeater

SYNOPSYS
       stone [-d] [-n] [-u max] [-f n] [-l] [-z SSL] st [-- st] ...

OPTIONS
       -d     Increase the debug level.

       -z     SSL encryption.

       -n     IP addresses and service port numbers are shown instead of host names and service names.

       -u max max is integer. The program will memorize max sources simultaneously where UDP packets are sent.

       -f n   n is integer. The program will spawn n child processes.

       -l     Sends error messages to the syslog instead of stderr.

       st     is one of the followings; Multiple st can be designated, separated by --.
              (1)    host:port sport [xhost ...]
              (2)    host:port shost:sport [xhost ...]
              (3)    display [xhost ...]
              (4)    proxy sport [xhost ...]
              (5)    host:port/http request [hosts ...]
              (6)    host:port/proxy header [hosts...]

       The program repeats the connection on port sport to the other machine host port port.  If the machine, on which the program runs, has two or
       more interfaces, type (2) can be used to repeat the connection on the specified interface shost.

       display [xhost ...]
              Abbreviating notation.  The program repeats the connection on display number display to the X server designated  by  the  environment
              variable DISPLAY.

       proxy sport [xhost ...]
              Http Proxy.  Specify the machine, on which the program runs, and port sport in the http proxy settings of your WWW browser.

       host:port/http request [hosts ...]
              Repeats packets over http request.  request is the request specified in HTTP 1.0.  host:port/proxy header [hosts...]

       host:port/proxy header [hosts...]
              Type (6) repeats http request with header in the top of request headers.

       xhost  Only machines xhost can connect to the program.

       xhost/mask
              Only  machines  on specified networks are permitted to connect to the program.  In the case of class C network 192.168.1.0, for exam‐
              ple, use 192.168.1.0/255.255.255.0.

       sport/udp
              Repeats UDP packets instead of TCP packets.

       port/ssl
              Repeats packets with encryption.

       sport/ssl
              Repeats packets with decryption.

       sport/http
              Repeats packets over http.


DESCRIPTION
       Stone is a TCP/IP packet repeater in the application layer.  It repeats TCP and UDP packets from inside to outside of a  firewall,  or  from
       outside to inside.

       Stone has following features:

       1. Stone supports Win32.
              Formerly,  UNIX machines are used as firewalls, but recently WindowsNT machines are used, too.  You can easily run Stone on WindowsNT
              and Windows95.  Of course, available on Linux, FreeBSD, BSD/OS, SunOS, Solaris, HP-UX and so on.

       2.  Simple.
              Stone's source code is only 2000 lines long (written in C language), so you can minimize the risk of security holes.

       3.  Stone supports SSLeay.
              Using SSLeay developed by Eric Young, Stone can encrypt/decrypt packets.

       4.  Stone is a http proxy.
              Stone can also be a tiny http proxy.


示例
       outer:    位于防火墙之外的主机
       inner:    a machine in the inside of the firewall(位于防火墙内部的主机)
       fwall:    the firewall on which the stone is executed( 在其上执行着stone的防火墙主机)

       stone 7 outer
            Repeats the X protocol to the machine designated by the environmental variable DISPLAY.  Run X clients under DISPLAY=inner:7 on outer.

       stone outer:telnet 10023
            Repeats the telnet protocol to outer.
            Run telnet fwall 10023 on inner.

       stone outer:domain/udp domain/udp
            Repeats the DNS query to outer.
            Run nslookup - fwall on inner.

       stone outer:ntp/udp ntp/udp
            Repeats the NTP to outer.
            Run ntpdate fwall on inner.

       stone localhost:http 443/ssl
            Make WWW server that supports https.
            Access https://fwall/ using a WWW browser.

       stone localhost:telnet 10023/ssl
            Make telnet server that supports SSL.
            Run SSLtelnet -z ssl fwall 10023 on inner.

       stone proxy 8080
            http proxy.

       Where fwall is a http proxy (port 8080):

       stone fwall:8080/http 10023 'POST http://outer:8023 HTTP/1.0'
       stone localhost:telnet 8023/http
              Run stones on inner and outer respectively.
              Repeats packets over http.

       stone fwall:8080/proxy 9080 ?Proxy-Authorization: Basic c2VuZ29rdTpoaXJvYWtp?
              for browser that does not support proxy authorization.


另:redir
  评论这张
 
阅读(230)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017