Netcat (nc) is a versatile networking tool used for port scanning, transferring files, creating chat connections, and testing network services. In Termux, Netcat installs quickly and works just like on a regular Linux system. Below are the installation steps and basic commands to help you get started.
Installation
Update your Termux packages:
pkg update && pkg upgrade -yInstall Netcat:
pkg install netcat-openbsd mandoc -yCheck version/help:
nc -hBasic Commands
Scan for open ports:
nc -zv target-ip 1-1000Start a listener on a port:
nc -lvp 4444Connect to a listener:
nc target-ip 4444Send a file to another device:
Receiver:
nc -lvp 1234 > file.txtSender:
nc target-ip 1234 < file.txtSimple chat between two devices:
Device 1:
nc -lvp 5555Device 2:
nc device1-ip 5555Send text to a port:
echo "Hello" | nc target-ip 80Uninstall Netcat:
pkg uninstall netcat-openbsd