SOCKS
It is an Internet protocol that allows client-server applications to transparently use the services of a network firewall. SOCKS is an abbreviation of "SOCKetS".
Clients behind a firewall that need access to servers outside can connect to a SOCKS proxy server instead. Such a proxy server controls which client can access the external server and passes the request to the server. SOCKS can also be used in the opposite way, allowing clients outside the firewall ("external clients") to connect to servers inside the firewall (internal servers).
The protocol was originally developed by David Koblas, an administrator of MIPS Computer Systems. After MIPS was controlled by Silicon Graphics in 1992, Koblas presented an article on SOCKS at the annual Usenix security symposium and SOCKS became publicly available.
SOCKS5
An extension of the SOCKS 4 protocol that offers more authentication options. The initial handshake now consists of the following:
● The client connects and sends a greeting in which it includes a list of the authentication methods supported.
● The server chooses one (or sends a fault response if none of the methods offered is acceptable).
● Some messages can now pass between the client and the server depending on the chosen authentication method.
● The client sends a connection request similar to SOCKS4.
● The server responds similarly to SOCKS4.
The supported authentication methods are listed as follows:
● 0x00 - No authentication
● 0x01 - GSSAPI
● 0x02 - User Name / Password
● 0x03..0x7F - methods assigned by IANA
● 0x80..0xFE - reserved methods for private use
The initial greeting from the client is:
● field 1: version number socks, it must be 0x05 for this version
● field 2: number of authentication methods supported, 1 byte
● field 3: authentication methods, variable length, 1- byte by supported method
The choice of server is communicated:
● field 1: socks version, 1 byte, 0x05 for this version
● field 2: chosen authentication method, 1 byte, or 0xFF when acceptable methods are not offered.
Subsequent authentication is dependent on the method. The client connection request is:
● field 1: version number socks, 1 byte, it must be 0x05 for this version
● field 2: command code, 1 byte:
• 0x01 = establish a stream connection tcp / ip
• 0x02 = establish a tcp / ip port binding (binding)
• 0x03 = associate an udp port
● field 3: reserved, it must be 0x00
● field 4: address type, 1 byte :
• 0x01 = IPV4 address (the address field is 4 bytes long)
• 0x03 = Domain name (the address field is variable)
• 0x04 = IPV6 address (the address field) it has a length of 16 bytes)
● field 5: destination address, 4/16 bytes or length of name 1 + domain.
• If the address type is 0x03 then the address consists of a byte of length followed of the domain name.
● field 6: port number in the network byte order, 2 bytes
Server response:
● field 1: protocol version socks, 1 byte, 0x05 for this version
● field 2: status, 1 byte:
• 0x00 = request granted,
• 0x01 = general failure, < br> • 0x02 = the connection was not allowed by the rule set (ruleset)
• 0x03 = unreachable network
• 0x04 = unreachable host
• 0x05 = connection rejected by the target host
• 0x06 = TTL expired
• 0x07 = unsupported command / protocol error
• 0x08 = unsupported address type
● field 3: reserved, 0x00
● field 4: address type, 1 byte:
• 0x01 = IPV4 address (the address field has a length of 4 bytes)
• 0x03 = Domain name (the address field is variable)
• 0x04 = IPV6 address (the field of addresses have a length of 16 bytes)
● field 5: destination address, 4/16 byt is or length of name 1 + domain.
• If the address type is 0x03 then the address consists of a byte in length followed by the domain name.
You can purchase SOCKS5 services from different providers on the web.