

If I run update-alternatives with the -display option, I can see that there is a symbolic link at /bin/nc, and it points currently to /bin/nc. In a clean Kali install, nc is simply nc (actually nc.traditional, as I’ll show in a moment). Example: update-alternatives -list java /usr/lib/jvm/java-11-openjdk-arm64/bin/java /usr/lib/jvm/java-8-openjdk-arm64/jre/bin/java Switch java version with update-alternative Use update-alternatives -config java to update java version in interactive mode.

This is managed by the alternatives system. Use update-alternatives -list java to list all installed java paths. If you’ve ever installed ncat, you may have noticed that running nc actually now runs ncat. There’s a more powerful version, ncat, that brings in additional functionality, like SSL support, IPv6 support, and proxy support.

Nc is the Swiss Army knife of hacking at things. I’ll use update-altneratives to install the new Java version, and then to change what version java, javac, jar, etc utilize. For example, I’m currently working on a challenge that requires using an older version of Java to interact with a file. But there are times when it is really useful to know how to interact with this yourself. When you run apt install x, it may do some of this behind the scenes for you. First list the JDK installs available on your machine: rootmylaptop: update-java-alternatives -l java-1.7.0-openjdk-amd64 1071 /usr/lib/jvm/java-1.7.0-openjdk-amd64 java-1.8.0-openjdk-amd64 1069 /usr/lib/jvm/java-1.8.0-openjdk-amd64. Most of the time, this is managed by the package management system. Debian Linux (and its derivatives like Ubuntu and Kali) has a system called alternatives that’s designed to manage having different version of some software, or aliasing different commands to different versions within the system.
