MSYS2-pacman
MSYS2-pacman copied to clipboard
gnu-netcat breaks on various ports
While netcat localhost http
and netcat localhost smtp
work fine, for example netcat localhost imap
(as well as netcat localhost 143
) fails:
$ netcat localhost imap
assertion "dst->netnum == servent->s_port" failed: file "network.c", line 226, function: netcat_getport
Aborted (core dumped)
This is different from the case when the port is just closed:
$ netcat localhost 42
assertion "ret == 0" failed: file "core.c", line 372, function: core_tcp_connect
Aborted (core dumped)
This isn't a solution for gnu-netcat, but you can grab a build of Ncat, which should support everything gnu-netcat does, as well as actually working, since it's been updated within the past 12 years, unlike gnu-netcat. :wink:
https://nmap.org/download.html
I am facing the same issue .. wondering if I should fix netcat or use the workaround proposed ?