forked from xl7dev/WebShell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsocks5.h
68 lines (62 loc) · 1.38 KB
/
socks5.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//Based on http://www.ietf.org/rfc/rfc1928.txt
//HTTP:http://www.ietf.org/rfc/rfc2616.txt
#ifndef SOCKS5_H
#define SOCKS5_H
/****
+----+----------+----------+
|VER | NMETHODS | METHODS |
+----+----------+----------+
| 1 | 1 | 1 to 255 |
+----+----------+----------+
****/
typedef struct
{
char ver;
char nmethods;
char methods[255];
}SELECT,*pSELECT;
/****
+----+--------+
|VER | METHOD |
+----+--------+
| 1 | 1 |
+----+--------+
****/
typedef struct
{
char ver;
char method;
}SELECT_RESPONSE,*pSELECT_RESPONSE;
/****
+----+-----+-------+------+----------+----------+
|VER | CMD | RSV | ATYP | DST.ADDR | DST.PORT |
+----+-----+-------+------+----------+----------+
| 1 | 1 | X'00' | 1 | Variable | 2 |
+----+-----+-------+------+----------+----------+
****/
typedef struct
{
char ver;
char cmd;
char rsv;
char atyp;
char addr;
//Other sections
}REQUEST,*pREQUEST;
/****
+----+-----+-------+------+----------+----------+
|VER | REP | RSV | ATYP | BND.ADDR | BND.PORT |
+----+-----+-------+------+----------+----------+
| 1 | 1 | X'00' | 1 | Variable | 2 |
+----+-----+-------+------+----------+----------+
****/
typedef struct
{
char ver;
char rep;
char rsv;
char atyp;
char bndAddr[4];
char bndPort[2];
}REQUEST_RESPONSE,*pREQUEST_RESPONSE;
#endif