Username/Password Authentication for SOCKS V5
Extracted elements (7)
This subnegotiation is designed to fit within the SOCKS V5 generalized authentication framework, which allows arbitrary authentication protocols to be negotiated during initial connection setup rather than mandating a single scheme.
This protocol is only applicable after a SOCKS V5 client and server have agreed to use Username/Password Authentication during the SOCKS V5 initial method negotiation; it cannot be used standalone.
If the server returns a failure STATUS (any value other than X'00'), it MUST close the connection.
The VER field in the client subnegotiation request must be X'01', identifying version 1 of the username/password subnegotiation protocol.
The username/password subnegotiation transmits the password in cleartext and is therefore not recommended for environments where packet sniffing is possible and practical.
The client authentication request contains five fields: VER (1 octet, value X'01'), ULEN (1 octet, length of UNAME), UNAME (1–255 octets, username), PLEN (1 octet, length of PASSWD), and PASSWD (1–255 octets, password).
The server authentication response contains two fields: VER (1 octet) and STATUS (1 octet). A STATUS value of X'00' indicates success; any other value indicates failure.