<s>
netcat	B-Protocol
(	O
often	O
abbreviated	O
to	O
nc	B-Protocol
)	O
is	O
a	O
computer	B-Architecture
networking	I-Architecture
utility	B-Application
for	O
reading	O
from	O
and	O
writing	O
to	O
network	B-Architecture
connections	O
using	O
TCP	B-Protocol
or	O
UDP	B-Protocol
.	O
</s>
<s>
The	O
command	B-Application
is	O
designed	O
to	O
be	O
a	O
dependable	O
back-end	B-Architecture
that	O
can	O
be	O
used	O
directly	O
or	O
easily	O
driven	O
by	O
other	O
programs	O
and	O
scripts	O
.	O
</s>
<s>
At	O
the	O
same	O
time	O
,	O
it	O
is	O
a	O
feature-rich	O
network	B-Architecture
debugging	O
and	O
investigation	O
tool	O
,	O
since	O
it	O
can	O
produce	O
almost	O
any	O
kind	O
of	O
connection	O
its	O
user	O
could	O
need	O
and	O
has	O
a	O
number	O
of	O
built-in	O
capabilities	O
.	O
</s>
<s>
The	O
original	O
netcat	B-Protocol
's	O
features	O
include	O
:	O
</s>
<s>
Rewrites	O
like	O
GNU	B-Operating_System
's	O
and	O
OpenBSD	B-Operating_System
's	O
support	O
additional	O
features	O
.	O
</s>
<s>
For	O
example	O
,	O
OpenBSD	B-Operating_System
's	O
nc	B-Protocol
supports	O
TLS	B-Protocol
,	O
and	O
GNU	B-Protocol
netcat	I-Protocol
natively	O
supports	O
a	O
tunneling	B-Protocol
mode	O
supporting	O
UDP	B-Protocol
and	O
TCP	B-Protocol
(	O
optionally	O
allowing	O
one	O
to	O
be	O
tunneled	O
over	O
the	O
other	O
)	O
in	O
a	O
single	O
command	B-Application
,	O
where	O
other	O
versions	O
may	O
require	O
piping	O
data	O
from	O
one	O
netcat	B-Protocol
instance	O
to	O
another	O
.	O
</s>
<s>
Netcat	B-Protocol
only	O
serves	O
the	O
file	O
once	O
to	O
the	O
first	O
client	O
that	O
connects	O
and	O
then	O
exits	O
;	O
it	O
also	O
provides	O
the	O
content	O
length	O
for	O
browsers	O
that	O
expect	O
it	O
.	O
</s>
<s>
In	O
some	O
versions	O
of	O
netcat	B-Protocol
like	O
netcat-traditional	O
in	O
Debian	O
8.6	O
,	O
you	O
need	O
to	O
specify	O
-p	O
before	O
the	O
port	O
number	O
.	O
</s>
<s>
UDP	B-Protocol
tests	O
will	O
always	O
show	O
as	O
"	O
open	O
"	O
.	O
</s>
<s>
This	O
test	O
is	O
useful	O
,	O
if	O
you	O
have	O
shell	O
access	O
to	O
the	O
server	O
that	O
should	O
be	O
tested	O
,	O
but	O
you	O
do	O
not	O
know	O
whether	O
there	O
is	O
a	O
firewall	O
blocking	O
a	O
specific	O
UDP	B-Protocol
port	O
on	O
the	O
server	O
.	O
</s>
<s>
If	O
text	O
typed	O
on	O
the	O
sending	O
host	O
(	O
type	O
something	O
and	O
hit	O
enter	O
)	O
is	O
displayed	O
also	O
on	O
the	O
listening	O
host	O
,	O
then	O
the	O
UDP	B-Protocol
port	O
4172	O
is	O
open	O
.	O
</s>
<s>
On	O
some	O
machines	O
,	O
IPv6	B-Protocol
may	O
be	O
the	O
default	O
IP	O
version	O
to	O
use	O
by	O
netcat	B-Protocol
.	O
</s>
<s>
Thus	O
,	O
the	O
host	O
specified	O
by	O
the	O
hostname	O
is	O
contacted	O
using	O
IPv6	B-Protocol
,	O
and	O
the	O
user	O
might	O
not	O
know	O
about	O
this	O
.	O
</s>
<s>
Ports	O
may	O
appear	O
closed	O
in	O
the	O
test	O
,	O
even	O
though	O
they	O
would	O
be	O
open	O
when	O
using	O
IPv4	B-Protocol
.	O
</s>
<s>
You	O
can	O
force	O
the	O
use	O
of	O
IPv4	B-Protocol
by	O
adding	O
-4	O
to	O
the	O
options	O
of	O
the	O
nc	B-Protocol
commands	O
.	O
</s>
<s>
An	O
uncommon	O
use	O
of	O
netcat	B-Protocol
is	O
port	O
scanning	O
.	O
</s>
<s>
The	O
-n	O
parameter	O
here	O
prevents	O
DNS	B-Protocol
lookup	I-Protocol
,	O
-z	O
makes	O
nc	B-Protocol
not	O
receive	O
any	O
data	O
from	O
the	O
server	O
,	O
and	O
-w	O
1	O
makes	O
the	O
connection	O
timeout	O
after	O
1	O
second	O
of	O
inactivity	O
.	O
</s>
<s>
Another	O
useful	O
behaviour	O
is	O
using	O
netcat	B-Protocol
as	O
a	O
proxy	O
.	O
</s>
<s>
This	O
starts	O
a	O
nc	B-Protocol
server	O
on	O
port	O
12345	O
and	O
all	O
the	O
connections	O
get	O
redirected	O
to	O
google.com:80	O
.	O
</s>
<s>
If	O
a	O
web	O
browser	O
makes	O
a	O
request	O
to	O
nc	B-Protocol
,	O
the	O
request	O
will	O
be	O
sent	O
to	O
google	O
but	O
the	O
response	O
will	O
not	O
be	O
sent	O
to	O
the	O
web	O
browser	O
.	O
</s>
<s>
That	O
is	O
because	O
pipes	B-Operating_System
are	O
unidirectional	O
.	O
</s>
<s>
This	O
can	O
be	O
worked	O
around	O
with	O
a	O
named	B-Operating_System
pipe	I-Operating_System
to	O
redirect	B-Device
the	O
input	B-Operating_System
and	I-Operating_System
output	I-Operating_System
.	O
</s>
<s>
Using	O
a	O
named	B-Operating_System
pipe	I-Operating_System
is	O
a	O
more	O
reliable	O
method	O
because	O
using	O
-c	O
option	O
provides	O
only	O
a	O
one-shot	O
proxy	O
.	O
</s>
<s>
This	O
way	O
,	O
the	O
traffic	O
can	O
not	O
be	O
viewed	O
in	O
wire	O
sniffing	O
applications	O
such	O
as	O
wireshark	B-Language
.	O
</s>
<s>
This	O
can	O
be	O
accomplished	O
on	O
UNIXes	B-Application
by	O
utilizing	O
mkfifo	O
,	O
netcat	B-Protocol
,	O
and	O
openssl	B-Language
.	O
</s>
<s>
netcat	B-Protocol
can	O
be	O
used	O
to	O
make	O
any	O
process	O
a	O
network	B-Architecture
server	O
.	O
</s>
<s>
The	O
-e	O
option	O
spawns	O
the	O
executable	O
with	O
its	O
input	B-Operating_System
and	I-Operating_System
output	I-Operating_System
redirected	O
via	O
network	B-Architecture
socket	O
.	O
</s>
<s>
To	O
do	O
so	O
,	O
on	O
a	O
computer	O
A	O
with	O
IP	O
address	O
192.168.1.2	O
,	O
run	O
this	O
command	B-Application
:	O
</s>
<s>
Then	O
,	O
from	O
any	O
other	O
computer	O
on	O
the	O
same	O
network	B-Architecture
,	O
one	O
could	O
run	O
this	O
nc	B-Protocol
command	B-Application
:	O
</s>
<s>
Some	O
administrators	O
perceive	O
this	O
as	O
a	O
risk	O
and	O
thus	O
do	O
not	O
allow	O
netcat	B-Protocol
on	O
a	O
computer	O
.	O
</s>
<s>
The	O
version	O
of	O
netcat	B-Protocol
developed	O
by	O
OpenBSD	B-Operating_System
that	O
is	O
often	O
installed	O
by	O
default	O
on	O
distributions	O
such	O
as	O
Debian	O
and	O
Ubuntu	O
lacks	O
this	O
option	O
due	O
to	O
this	O
potential	O
as	O
a	O
security	O
risk	O
.	O
</s>
<s>
Ncat	O
is	O
a	O
similar	O
tool	O
to	O
netcat	B-Protocol
provided	O
by	O
Nmap	B-Language
suite	O
.	O
</s>
<s>
"	O
While	O
Ncat	O
is	O
n't	O
built	O
on	O
any	O
code	O
from	O
the	O
“	O
traditional	O
”	O
Netcat	B-Protocol
(	O
or	O
any	O
other	O
implementation	O
)	O
,	O
Ncat	O
is	O
most	O
definitely	O
based	O
on	O
Netcat	B-Protocol
in	O
spirit	O
and	O
functionality.	O
"	O
</s>
<s>
Ncat	O
features	O
includes	O
:	O
ability	O
to	O
chain	O
Ncats	O
together	O
,	O
redirect	B-Device
both	O
TCP	B-Protocol
and	O
UDP	B-Protocol
ports	O
to	O
other	O
sites	O
,	O
SSL	O
support	O
,	O
and	O
proxy	O
connections	O
via	O
SOCKS4	O
or	O
HTTP	O
(	O
CONNECT	O
method	O
)	O
proxies	O
(	O
with	O
optional	O
proxy	O
authentication	O
as	O
well	O
)	O
.	O
</s>
<s>
Redirect	B-Device
TCP	B-Protocol
port	O
8080	O
on	O
the	O
local	O
machine	O
to	O
host	O
on	O
port	O
80	O
.	O
:	O
</s>
<s>
Bind	O
to	O
TCP	B-Protocol
port	O
8081	O
and	O
attach	O
/bin/bash	O
for	O
the	O
world	O
to	O
access	O
freely	O
.	O
</s>
<s>
Bind	O
a	O
shell	O
to	O
TCP	B-Protocol
port	O
8081	O
,	O
limit	O
access	O
to	O
hosts	O
on	O
a	O
local	O
network	B-Architecture
,	O
and	O
limit	O
the	O
maximum	O
number	O
of	O
simultaneous	O
connections	O
to	O
3	O
:	O
</s>
<s>
Send	O
a	O
file	O
over	O
TCP	B-Protocol
port	O
9899	O
from	O
host2	O
(	O
client	O
)	O
to	O
host1	O
(	O
server	O
)	O
.	O
</s>
<s>
TCP	B-Protocol
takes	O
care	O
of	O
error	O
correction	O
.	O
</s>
<s>
The	O
original	O
version	O
of	O
netcat	B-Protocol
was	O
a	O
Unix	B-Application
program	O
.	O
</s>
<s>
There	O
are	O
several	O
implementations	O
on	O
POSIX	O
systems	O
,	O
including	O
rewrites	O
from	O
scratch	O
like	O
GNU	B-Protocol
netcat	I-Protocol
or	O
OpenBSD	B-Operating_System
netcat	B-Protocol
,	O
</s>
<s>
the	O
latter	O
of	O
which	O
supports	O
IPv6	B-Protocol
and	O
TLS	B-Protocol
.	O
</s>
<s>
The	O
OpenBSD	B-Operating_System
version	O
has	O
been	O
ported	O
to	O
the	O
FreeBSD	B-Operating_System
base	O
,	O
</s>
<s>
Mac	B-Application
OS	I-Application
X	I-Application
comes	O
with	O
netcat	B-Protocol
installed	O
as	O
of	O
OSX	O
10.13	O
or	O
users	O
can	O
use	O
MacPorts	B-Application
to	O
install	O
a	O
variant	O
.	O
</s>
<s>
A	O
DOS	B-Device
version	O
of	O
netcat	B-Protocol
called	O
NTOOL	O
is	O
included	O
in	O
the	O
FreeDOS	B-Application
Package	O
group	O
Networking	O
.	O
</s>
<s>
Known	O
ports	O
for	O
embedded	O
systems	O
includes	O
versions	O
for	O
Windows	B-Operating_System
CE	I-Operating_System
(	O
named	O
"	O
Netcat	B-Protocol
4	O
wince	B-Operating_System
"	O
)	O
or	O
for	O
the	O
iPhone	B-Device
.	O
</s>
<s>
BusyBox	B-Application
includes	O
by	O
default	O
a	O
lightweight	O
version	O
of	O
netcat	B-Protocol
.	O
</s>
<s>
Solaris	B-Application
11	I-Application
includes	O
netcat	B-Protocol
implementation	O
based	O
on	O
OpenBSD	B-Operating_System
netcat	B-Protocol
.	O
</s>
<s>
Socat	O
is	O
a	O
more	O
complex	O
variant	O
of	O
netcat	B-Protocol
.	O
</s>
<s>
On	O
February	O
1	O
,	O
2016	O
,	O
Santiago	O
Zanella-Beguelin	O
and	O
Microsoft	O
Vulnerability	O
Research	O
issued	O
a	O
security	O
advisory	O
regarding	O
a	O
composite	O
Diffie-Hellman	B-Protocol
parameter	O
which	O
had	O
been	O
hard-coded	O
into	O
the	O
OpenSSL	B-Language
implementation	O
of	O
socat	O
.	O
</s>
<s>
The	O
implausibility	O
that	O
a	O
composite	O
might	O
have	O
been	O
unintentionally	O
introduced	O
where	O
a	O
prime	O
number	O
is	O
required	O
has	O
led	O
to	O
the	O
suspicion	O
of	O
sabotage	B-Device
to	O
introduce	O
a	O
backdoor	O
software	O
vulnerability	O
.	O
</s>
<s>
Cryptcat	O
is	O
a	O
version	O
of	O
netcat	B-Protocol
with	O
integrated	O
transport	O
encryption	O
capabilities	O
.	O
</s>
<s>
In	O
the	O
middle	O
of	O
2005	O
,	O
Nmap	B-Language
announced	O
another	O
netcat	B-Protocol
incarnation	O
called	O
Ncat	O
.	O
</s>
<s>
It	O
features	O
new	O
possibilities	O
such	O
as	O
"	O
Connection	O
Brokering	O
"	O
,	O
TCP/UDP	O
Redirection	B-Device
,	O
SOCKS4	O
client	O
and	O
server	O
support	O
,	O
ability	O
to	O
"	O
Chain	O
"	O
Ncat	O
processes	O
,	O
HTTP	O
CONNECT	O
proxying	O
(	O
and	O
proxy	O
chaining	O
)	O
,	O
SSL	O
connect/listen	O
support	O
and	O
IP	O
address/connection	O
filtering	O
.	O
</s>
<s>
Like	O
Nmap	B-Language
,	O
Ncat	O
is	O
cross-platform	B-Operating_System
.	O
</s>
<s>
On	O
some	O
systems	O
,	O
modified	O
versions	O
or	O
similar	O
netcat	B-Protocol
utilities	O
go	O
by	O
the	O
command	B-Application
name(s )	O
nc	B-Protocol
,	O
ncat	O
,	O
pnetcat	O
,	O
socat	O
,	O
sock	O
,	O
socket	O
,	O
sbd	O
.	O
</s>
