Netcat is a simple Unix utility which reads and writes data across network connections, using TCP or UDP protocol. It is designed to be a reliable backend tool that can be used directly or easily driven by other programs time, it is a feature-rich network debugging and exploration tool, since it can create almost any kind of connection you would need and has several interesting built-in capabilities.
| Tags | Networking |
|---|---|
| Licenses | Freeware Public Domain |
Recent releases


Changes: This release fixes several bugs in IPv6 handling and reintroduces host names (reverse-resolved using the getnameinfo function) in verbose messages, which were disabled until now. The argument to -q now works as advertised. It also improves portability.


Changes: This release fixes a bug in which only 8k of the data to be sent to the remote host was accepted.


Changes: This release cleans up the code in netcat 1.10, modernizes some things (including support for IPv6), and has some popular patches, including those that Debian uses for its own netcat. It does not do reverse DNS lookups anymore, but this is only temporary. Instead, source routing has been removed because nobody leaves it enabled anymore. autoconf is now used.
An extendable extract-transform-load tool where jobs are Perl or Java scripts.
A Linux device driver for the Catweasel Advanced Floppy Controller.
- All comments
Recent commentsRe: IPv6 Port
> Change USHRT_MAX to 65535, then compile.
> Works like a charm.
Or include limits.h. Silly me.
IPv6 Port
I had a problem compiling the IPv6 version on FreeBSD 5.0. Changed the following to make it work:
first_port = strtoul (argv[optind], &tail, 0);
if (first_port > USHRT_MAX || *tail || first_port == 0)
bail ("invalid port %s", argv[optind]);
last_port = strtoul (cp, &tail, 0);
if (last_port > USHRT_MAX || *tail || last_port == 0)
bail ("invalid port %s", cp);
Change USHRT_MAX to 65535, then compile. Works like a charm.
Re: Compile error
>
> % When I compile netcat on Linux it gives
> % me this errors:
> %
> % /tmp/cccUSCm5.o: In function `main':
> % /tmp/cccUSCm5.o(.text+0x1b1a): undefined
> % reference to `res_init'
> % collect2: ld returned 1 exit status
> %
>
>
> Check the comments a little down the
> page titled 'compile for linux.' The
> error you mention goes away by adding
> 'include resolv.h' to netcat.c
>
The debian guys have a whole bunch of patches for netcat
get ftp://ftp.debian.org/debian/pool/n/netcat/netcat_1.10-23.diff.gz
installation, in netcat dir:
zcat ~/src/netcat_1.10-23.diff.gz | patch
for i in `cat 00list` ; do cat $i.dpatch | patch;done
Re: Compile error
> When I compile netcat on Linux it gives
> me this errors:
>
> /tmp/cccUSCm5.o: In function `main':
> /tmp/cccUSCm5.o(.text+0x1b1a): undefined
> reference to `res_init'
> collect2: ld returned 1 exit status
>
Check the comments a little down the page titled 'compile for linux.' The error you mention goes away by adding 'include resolv.h' to netcat.c
Compile error
When I compile netcat on Linux it gives me this errors:
/tmp/cccUSCm5.o: In function `main':
/tmp/cccUSCm5.o(.text+0x1b1a): undefined reference to `res_init'
collect2: ld returned 1 exit status