科技行者

行者学院 转型私董会 科技行者专题报道 网红大战科技行者

知识库

知识库 安全导航

至顶网软件频道VB6中使用Winsock穿越各种代理的实现

VB6中使用Winsock穿越各种代理的实现

  • 扫一扫
    分享文章到微信

  • 扫一扫
    关注官方公众号
    至顶头条

由于缺乏测试环境,本程序只在我自己编写的代理模拟器上测试过,其结果和腾讯QQ,MSN,网易泡泡穿越该模拟器时得出的结果基本一致.因此,代码可能有错误的地方,请各位有条件的用户自行改正,请见谅!

作者:吴滂 来源:csdn 2007年10月14日

关键字:

  • 评论
  • 分享微博
  • 分享邮件

在本页阅读全文(共7页)

关于我是怎么把16进制码换成10进制的,请自己看程序

  最后,接受服务器返回数据,看RFC:

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

  |VER | REP | RSV | ATYP | BND.ADDR | BND.PORT |

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

  | 1 | 1 | X'00' | 1 | Variable | 2 |

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

  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:

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

  |VER | ULEN | UNAME | PLEN | PASSWD |

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

  | 1 | 1 | 1 to 255 | 1 | 1 to 255 |

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

  The VER field contains the current version of the subnegotiation,

  which is X'01'. The ULEN field contains the length of the UNAME field

  that follows. The UNAME field contains the username as known to the

  source operating system. The PLEN field contains the length of the

  PASSWD field that follows. The PASSWD field contains the password

  association with the given UNAME.

  The server verifies the supplied UNAME and PASSWD, and sends the

  following response:

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

  |VER | STATUS |

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

  | 1 | 1 |

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

  A STATUS field of X'00' indicates success. If the server returns a

  `failure' (STATUS value other than X'00') status, it MUST close the

  connection.

    • 评论
    • 分享微博
    • 分享邮件
    邮件订阅

    如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。

    重磅专题
    往期文章
    最新文章