Netcat VS NCat VS NC in OpenWRT

Wiki.TerraBase.info
Jump to navigation Jump to search

This is just a few quick notes on the NETCAT Command in OpenWRT.

The Scenario

Here's the scenario: The functionality of Netcat in BusyBox is not sufficient (to be clear, this isn't a slight against BusyBox, just saying that sometimes the full command is needed), so the full version of NCat is installed because Netcat is just too darned old.

All of the below referenced NETCAT, NCAT, NC commands are located in the /usr/bin Directory

The Facts

By default, when using the NETCAT Command, the 'compact' version in BusyBox is utilized. In addition, a symbolic link is created such that NC points to the BusyBox version of Netcat.

If NETCAT, the full version of the program is installed (opkg install netcat), then the BusyBox version is overridden. In addition, when installed the original symbolic link is removed and NC is changed to point at Netcat

Netcat is apparently old. The latest version is .0.7.1 in 2004. OpenWRT provides a substitute, NCat. NCat works great.

What doesn't work so well is OpenWRT's installer for NCat isn't as nice as the installer for Netcat, and neglects to provide the the same or additional symbolic links.

So what should be done about (aside from OpenWRT modifying the installer for NCat)? Fix it yourself with the below commands

  • Remove the rm Symbolic Link: rm /usr/bin/nc
  • Create Symbolic Link: nc > ncat (ln -s /usr/bin/ncat /usr/bin/nc)
  • Create Symbolic Link: netcat > ncat (ln -s /usr/bin/ncat /usr/bin/netcat)
  • Just so it's know, the default Symbolic Link is nc > ../../bin/busybox (with busybox NC implied)