盾怪网教程:是一个免费提供流行杀毒软件教程、在线学习分享的学习平台!

VB6中使用Winsock穿越各种代理的完成(TCP协议)

时间:2025/3/12作者:未知来源:盾怪网教程人气:

[摘要]+----+-----+-------+------+----------+----------+ Where: o VER protocol version: X...

        +----+-----+-------+------+----------+----------+

     Where:

          o  VER    protocol version: X''05''          ------------ 固定 05
          o  REP    Reply field:
             o  X''00'' succeeded                      ------------ 若为 00 成功 其余可以都看成失败
             o  X''01'' general SOCKS server failure
             o  X''02'' connection not allowed by ruleset
             o  X''03'' Network unreachable
             o  X''04'' Host unreachable
             o  X''05'' Connection refused
             o  X''06'' TTL expired
             o  X''07'' Command not supported
             o  X''08'' Address type not supported
             o  X''09'' to X''FF'' unassigned
          o  RSV    RESERVED
          o  ATYP   address type of following address

             o  IP V4 address: X''01''
             o  DOMAINNAME: X''03''
             o  IP V6 address: X''04''
          o  BND.ADDR       server bound address
          o  BND.PORT       server bound port in network octet order

   Fields marked RESERVED (RSV) must be set to X''00''.


可见,对于返回信息,只须判断第二字节是否为00.若为 00 连接成功,剩下的操作和直连一样,Winsock可直接用SendData 和 GetData 发送\接受数据.

下面介绍需要验证用户名/密码的socks5穿透

第一步还是发送三个字节,只是内容有变,展开来写为: 05 01 02

服务器返回信息也有所不同,正确的返回为 05 02

成功后发送用户/密码信息,请看RFC 说明:

Once the SOCKS V5 server has started, and the client has selected the
   Username/Password Authentication protocol, the Username/Password
   subnegotiation begins.  This begins with the client producing a
   Username/Password request:

           +----+------+----------+------+----------+
           

关键词:VB6中运用Winsock穿越各种代理的完成(TCP协议)




Copyright © 2012-2018 盾怪网教程(http://www.dunguai.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版