<s>
SOCKS	B-Application
is	O
an	O
Internet	O
protocol	O
that	O
exchanges	O
network	B-Protocol
packets	I-Protocol
between	O
a	O
client	B-Protocol
and	O
server	B-Application
through	O
a	O
proxy	B-Application
server	I-Application
.	O
</s>
<s>
SOCKS5	B-Application
optionally	O
provides	O
authentication	O
so	O
only	O
authorized	O
users	O
may	O
access	O
a	O
server	B-Application
.	O
</s>
<s>
Practically	O
,	O
a	O
SOCKS	B-Application
server	I-Application
proxies	O
TCP	O
connections	O
to	O
an	O
arbitrary	O
IP	O
address	O
,	O
and	O
provides	O
a	O
means	O
for	O
UDP	B-Protocol
packets	I-Protocol
to	O
be	O
forwarded	O
.	O
</s>
<s>
SOCKS	B-Application
performs	O
at	O
Layer	B-Application
5	I-Application
of	O
the	O
OSI	O
model	O
(	O
the	O
session	B-Application
layer	I-Application
,	O
an	O
intermediate	O
layer	O
between	O
the	O
presentation	B-Application
layer	I-Application
and	O
the	O
transport	B-Architecture
layer	I-Architecture
)	O
.	O
</s>
<s>
A	O
SOCKS	B-Application
server	I-Application
accepts	O
incoming	O
client	B-Protocol
connection	O
on	O
TCP	O
port	O
1080	O
,	O
as	O
defined	O
in	O
.	O
</s>
<s>
After	O
MIPS	O
was	O
taken	O
over	O
by	O
Silicon	O
Graphics	O
in	O
1992	O
,	O
Koblas	O
presented	O
a	O
paper	O
on	O
SOCKS	B-Application
at	O
that	O
year	O
's	O
Usenix	O
Security	O
Symposium	O
,	O
making	O
SOCKS	B-Application
publicly	O
available	O
.	O
</s>
<s>
The	O
SOCKS	B-Application
reference	O
architecture	O
and	O
client	B-Protocol
are	O
owned	O
by	O
Permeo	O
Technologies	O
,	O
a	O
spin-off	O
from	O
NEC	O
.	O
</s>
<s>
The	O
SOCKS5	B-Application
protocol	O
was	O
originally	O
a	O
security	O
protocol	O
that	O
made	O
firewalls	B-Application
and	O
other	O
security	O
products	O
easier	O
to	O
administer	O
.	O
</s>
<s>
SOCKS	B-Application
is	O
a	O
de	O
facto	O
standard	O
for	O
circuit-level	B-Protocol
gateways	I-Protocol
(	O
level	O
5	O
gateways	O
)	O
.	O
</s>
<s>
The	O
circuit/session	O
level	O
nature	O
of	O
SOCKS	B-Application
make	O
it	O
a	O
versatile	O
tool	O
in	O
forwarding	O
any	O
TCP	O
(	O
or	O
UDP	B-Protocol
since	O
SOCKS5	B-Application
)	O
traffic	O
,	O
creating	O
an	O
interface	O
for	O
all	O
types	O
of	O
routing	O
tools	O
.	O
</s>
<s>
Since	O
SOCKS	B-Application
is	O
very	O
detectable	O
,	O
a	O
common	O
approach	O
is	O
to	O
present	O
a	O
SOCKS	B-Application
interface	O
for	O
more	O
sophisticated	O
protocols	O
:	O
</s>
<s>
The	O
Tor	B-Application
onion	I-Application
proxy	O
software	O
presents	O
a	O
SOCKS	B-Application
interface	O
to	O
its	O
clients	O
.	O
</s>
<s>
Providing	O
similar	O
functionality	O
to	O
a	O
virtual	B-Application
private	I-Application
network	I-Application
,	O
allowing	O
connections	O
to	O
be	O
forwarded	O
to	O
a	O
server	B-Application
's	O
"	O
local	O
"	O
network	O
:	O
</s>
<s>
Some	O
SSH	O
suites	O
,	O
such	O
as	O
OpenSSH	B-Language
,	O
support	O
dynamic	O
port	O
forwarding	O
that	O
allows	O
the	O
user	O
to	O
create	O
a	O
local	O
SOCKS	B-Application
proxy	I-Application
.	O
</s>
<s>
This	O
can	O
free	O
the	O
user	O
from	O
the	O
limitations	O
of	O
connecting	O
only	O
to	O
a	O
predefined	O
remote	O
port	O
and	O
server	B-Application
.	O
</s>
<s>
A	O
typical	O
SOCKS4	B-Application
connection	O
request	O
looks	O
like	O
this	O
:	O
</s>
<s>
ID	O
the	O
user	O
ID	O
string	O
,	O
variable	O
length	O
,	O
null-terminated	B-Data_Structure
.	O
</s>
<s>
For	O
example	O
,	O
this	O
a	O
SOCKS4	B-Application
request	O
to	O
connect	O
Fred	O
to	O
66.102.7.99:80	O
,	O
the	O
server	B-Application
replies	O
with	O
an	O
"	O
OK	O
"	O
:	O
</s>
<s>
The	O
last	O
field	O
is	O
"	O
Fred	O
"	O
in	O
ASCII	B-Protocol
,	O
followed	O
by	O
a	O
null	O
byte	O
.	O
</s>
<s>
The	O
SOCKS4	B-Application
protocol	O
specifies	O
that	O
the	O
values	O
of	O
these	O
bytes	O
should	O
be	O
ignored	O
.	O
</s>
<s>
From	O
this	O
point	O
onwards	O
,	O
any	O
data	O
sent	O
from	O
the	O
SOCKS	B-Application
client	B-Protocol
to	O
the	O
SOCKS	B-Application
server	I-Application
is	O
relayed	O
to	O
66.102.7.99	O
,	O
and	O
vice	O
versa	O
.	O
</s>
<s>
The	O
command	O
field	O
may	O
be	O
0x01	O
for	O
"	O
connect	O
"	O
or	O
0x02	O
for	O
"	O
bind	O
"	O
;	O
the	O
"	O
bind	O
"	O
command	O
allows	O
incoming	O
connections	O
for	O
protocols	O
such	O
as	O
active	O
FTP	B-Protocol
.	O
</s>
<s>
SOCKS4a	B-Application
extends	O
the	O
SOCKS4	B-Application
protocol	O
to	O
allow	O
a	O
client	B-Protocol
to	O
specify	O
a	O
destination	O
domain	O
name	O
rather	O
than	O
an	O
IP	O
address	O
;	O
this	O
is	O
useful	O
when	O
the	O
client	B-Protocol
itself	O
cannot	O
resolve	O
the	O
destination	O
host	O
's	O
domain	O
name	O
to	O
an	O
IP	O
address	O
.	O
</s>
<s>
It	O
was	O
proposed	O
by	O
Ying-Da	O
Lee	O
,	O
the	O
author	O
of	O
SOCKS4	B-Application
.	O
</s>
<s>
The	O
client	B-Protocol
should	O
set	O
the	O
first	O
three	O
bytes	O
of	O
DSTIP	O
to	O
NULL	O
and	O
the	O
last	O
byte	O
to	O
a	O
non-zero	O
value	O
.	O
</s>
<s>
(	O
This	O
corresponds	O
to	O
IP	O
address	O
0.0.0.x	O
,	O
with	O
x	O
nonzero	O
,	O
an	O
inadmissible	O
destination	O
address	O
and	O
thus	O
should	O
never	O
occur	O
if	O
the	O
client	B-Protocol
can	O
resolve	O
the	O
domain	O
name	O
.	O
)	O
</s>
<s>
Following	O
the	O
NULL	O
byte	O
terminating	O
USERID	O
,	O
the	O
client	B-Protocol
must	O
send	O
the	O
destination	O
domain	O
name	O
and	O
terminate	O
it	O
with	O
another	O
NULL	O
byte	O
.	O
</s>
<s>
Client	B-Protocol
to	O
SOCKS	B-Application
server	I-Application
:	O
</s>
<s>
A	O
server	B-Application
using	O
protocol	O
SOCKS4a	B-Application
must	O
check	O
the	O
DSTIP	O
in	O
the	O
request	O
packet	B-Protocol
.	O
</s>
<s>
If	O
it	O
represents	O
address	O
0.0.0.x	O
with	O
nonzero	O
x	O
,	O
the	O
server	B-Application
must	O
read	O
in	O
the	O
domain	O
name	O
that	O
the	O
client	B-Protocol
sends	O
in	O
the	O
packet	B-Protocol
.	O
</s>
<s>
The	O
server	B-Application
should	O
resolve	O
the	O
domain	O
name	O
and	O
make	O
connection	O
to	O
the	O
destination	O
host	O
if	O
it	O
can	O
.	O
</s>
<s>
The	O
SOCKS5	B-Application
protocol	O
is	O
defined	O
in	O
.	O
</s>
<s>
It	O
is	O
an	O
incompatible	O
extension	O
of	O
the	O
SOCKS4	B-Application
protocol	O
;	O
it	O
offers	O
more	O
choices	O
for	O
authentication	O
and	O
adds	O
support	O
for	O
IPv6	B-Protocol
and	O
UDP	B-Protocol
,	O
the	O
latter	O
of	O
which	O
can	O
be	O
used	O
for	O
DNS	B-Protocol
lookups	I-Protocol
.	O
</s>
<s>
Client	B-Protocol
connects	O
and	O
sends	O
a	O
greeting	O
,	O
which	O
includes	O
a	O
list	O
of	O
authentication	O
methods	O
supported	O
.	O
</s>
<s>
Server	B-Application
chooses	O
one	O
of	O
the	O
methods	O
(	O
or	O
sends	O
a	O
failure	O
response	O
if	O
none	O
of	O
them	O
are	O
acceptable	O
)	O
.	O
</s>
<s>
Several	O
messages	O
may	O
now	O
pass	O
between	O
the	O
client	B-Protocol
and	O
the	O
server	B-Application
,	O
depending	O
on	O
the	O
authentication	O
method	O
chosen	O
.	O
</s>
<s>
Client	B-Protocol
sends	O
a	O
connection	O
request	O
similar	O
to	O
SOCKS4	B-Application
.	O
</s>
<s>
Server	B-Application
responds	O
similar	O
to	O
SOCKS4	B-Application
.	O
</s>
<s>
The	O
initial	O
greeting	O
from	O
the	O
client	B-Protocol
is	O
:	O
</s>
<s>
Since	O
clients	O
are	O
allowed	O
to	O
use	O
either	O
resolved	O
addresses	O
or	O
domain	O
names	O
,	O
a	O
convention	O
from	O
cURL	B-Language
exists	O
to	O
label	O
the	O
domain	O
name	O
variant	O
of	O
SOCKS5	B-Application
"	O
socks5h	O
"	O
,	O
and	O
the	O
other	O
simply	O
"	O
socks5	B-Application
"	O
.	O
</s>
<s>
A	O
similar	O
convention	O
exists	O
between	O
SOCKS4a	B-Application
and	O
SOCKS4	B-Application
.	O
</s>
<s>
Sun	B-Application
Java	I-Application
System	I-Application
Web	I-Application
Proxy	I-Application
Server	I-Application
is	O
a	O
caching	O
proxy	B-Application
server	I-Application
running	O
on	O
Solaris	O
,	O
Linux	B-Application
and	O
Windows	B-Application
servers	O
that	O
support	O
HTTPS	O
,	O
NSAPI	O
I/O	O
filters	O
,	O
dynamic	O
reconfiguration	O
,	O
SOCKSv5	B-Application
and	O
reverse	B-General_Concept
proxy	I-General_Concept
.	O
</s>
<s>
WinGate	B-Application
is	O
a	O
multi-protocol	O
proxy	B-Application
server	I-Application
and	O
SOCKS	B-Application
server	I-Application
for	O
Microsoft	B-Application
Windows	I-Application
which	O
supports	O
SOCKS4	B-Application
,	O
SOCKS4a	B-Application
and	O
SOCKS5	B-Application
(	O
including	O
UDP-ASSOCIATE	O
and	O
GSSAPI	O
auth	O
)	O
.	O
</s>
<s>
It	O
also	O
supports	O
handing	O
over	O
SOCKS	B-Application
connections	O
to	O
the	O
HTTP	O
proxy	O
,	O
so	O
can	O
cache	O
and	O
scan	O
HTTP	O
over	O
SOCKS	B-Application
.	O
</s>
<s>
SocksGate5	O
is	O
an	O
application-SOCKS	O
firewall	B-Application
with	O
inspection	O
feature	O
on	O
Layer	O
7	O
of	O
the	O
OSI	O
model	O
,	O
the	O
Application	O
Layer	O
.	O
</s>
<s>
Because	O
packets	B-Protocol
are	O
inspected	O
at	O
7	O
OSI	O
Level	O
the	O
application-SOCKS	O
firewall	B-Application
may	O
search	O
for	O
protocol	O
non-compliance	O
and	O
blocking	O
specified	O
content	O
.	O
</s>
<s>
is	O
a	O
circuit-level	O
SOCKS	B-Application
server	I-Application
that	O
can	O
be	O
used	O
to	O
provide	O
convenient	O
and	O
secure	O
network	O
connectivity	O
,	O
requiring	O
only	O
the	O
host	O
Dante	O
runs	O
on	O
to	O
have	O
external	O
network	O
connectivity	O
.	O
</s>
<s>
OpenSSH	B-Language
allows	O
dynamic	O
creation	O
of	O
tunnels	O
,	O
specified	O
via	O
a	O
subset	O
of	O
the	O
SOCKS	B-Application
protocol	O
,	O
supporting	O
the	O
CONNECT	O
command	O
.	O
</s>
<s>
PuTTY	B-Operating_System
is	O
a	O
Win32	O
SSH	O
client	B-Protocol
that	O
supports	O
local	O
creation	O
of	O
SOCKS	B-Application
(	O
dynamic	O
)	O
tunnels	O
through	O
remote	O
SSH	O
servers	O
.	O
</s>
<s>
is	O
a	O
SSH	O
client	B-Protocol
for	O
iOS	O
and	O
macOS	B-Operating_System
that	O
includes	O
a	O
SOCKS	B-Application
server	I-Application
.	O
</s>
<s>
ShimmerCat	B-Protocol
is	O
a	O
web	O
server	B-Application
that	O
uses	O
SOCKS5	B-Application
to	O
simulate	O
an	O
internal	O
network	O
,	O
allowing	O
web	O
developers	O
to	O
test	O
their	O
local	O
sites	O
without	O
modifying	O
their	O
/etc/hosts	B-Protocol
file	O
.	O
</s>
<s>
Tor	B-Application
is	O
a	O
system	O
intended	O
to	O
enable	O
online	O
anonymity	O
.	O
</s>
<s>
Tor	B-Application
offers	O
a	O
TCP-only	O
SOCKS	B-Application
server	I-Application
interface	O
to	O
its	O
clients	O
.	O
</s>
<s>
Shadowsocks	B-Language
is	O
a	O
circumvent	O
censorship	O
tool	O
.	O
</s>
<s>
It	O
provides	O
a	O
SOCKS5	B-Application
interface	O
.	O
</s>
<s>
netcat	B-Protocol
implementations	O
,	O
as	O
Ncat	O
and	O
socat	O
.	O
</s>
<s>
Client	B-Protocol
software	I-Protocol
must	O
have	O
native	O
SOCKS	B-Application
support	O
in	O
order	O
to	O
connect	O
through	O
SOCKS	B-Application
.	O
</s>
<s>
,	O
which	O
enables	O
applications	O
to	O
access	O
the	O
network	O
through	O
SOCKS5	B-Application
,	O
HTTPS	O
or	O
Shadowsocks	B-Language
.	O
</s>
<s>
tun2socks	O
,	O
an	O
open	O
source	O
tool	O
that	O
creates	O
virtual	O
TCP	O
TUN	O
adapters	O
from	O
a	O
SOCKS	B-Application
proxy	I-Application
,	O
capable	O
of	O
UDP	B-Protocol
if	O
supported	O
on	O
another	O
end	O
.	O
</s>
<s>
Works	O
on	O
Linux	B-Application
and	O
Windows	B-Application
,	O
has	O
a	O
macOS	B-Operating_System
port	O
and	O
reimplementation	O
in	O
Golang	B-Application
.	O
</s>
<s>
proxychains	O
,	O
a	O
Unix	O
program	O
that	O
forces	O
TCP	O
traffic	O
through	O
SOCKS	B-Application
or	O
HTTP	O
proxies	O
on	O
(	O
dynamically-linked	O
)	O
programs	O
it	O
launches	O
.	O
</s>
<s>
Works	O
on	O
various	O
Unix-like	B-Operating_System
systems	I-Operating_System
.	O
</s>
<s>
Polipo	B-Protocol
,	O
a	O
forwarding	O
and	O
caching	O
HTTP/1.1	O
proxy	B-Application
server	I-Application
with	O
IPv4	B-Protocol
support	O
.	O
</s>
<s>
Open	O
Source	O
running	O
on	O
Linux	B-Application
,	O
OpenWrt	B-Application
,	O
Windows	B-Application
,	O
Mac	B-Operating_System
OS	I-Operating_System
X	I-Operating_System
,	O
and	O
FreeBSD	B-Operating_System
.	O
</s>
<s>
Privoxy	B-Language
,	O
a	O
non-caching	O
SOCKS-to-HTTP	O
proxy	O
.	O
</s>
<s>
It	O
presents	O
an	O
http	O
proxy	O
interface	O
and	O
can	O
connect	O
to	O
SOCKS4/5	O
and	O
http	O
upstream	O
proxies	O
.	O
</s>
<s>
Due	O
to	O
lack	O
of	O
request	O
and	O
packets	B-Protocol
exchange	O
encryption	O
it	O
makes	O
SOCKS	B-Application
practically	O
vulnerable	O
to	O
man-in-the-middle	O
attacks	O
and	O
IP	O
addresses	O
eavesdropping	O
which	O
in	O
consequence	O
clears	O
a	O
way	O
to	O
censorship	O
by	O
governments	O
.	O
</s>
