Ncat is a powerful networking utility from the Nmap project that helps you create connections, transfer files, test ports, and communicate between devices directly from the terminal. It supports TCP and UDP connections and is useful for networking practice, local communication testing, and learning client-server networking concepts on Android using Termux. What You Can Do with Ncat in Termux:
- Test network communication.
- Transfer files between devices.
- Create simple chat connections.
- Test open ports.
- Learn TCP and UDP networking.
- Practice basic networking commands.
- Create lightweight local servers.
Installation Commands
Update and upgrade Termux packages:
pkg update && pkg upgrade -yInstall Nmap package which also includes the Ncat networking utility:
pkg install nmap -yCheck installed Ncat version:
ncat --versionUsage Commands
Ncat can be used to create connections between devices, transfer files, test ports, and practice networking communication directly from the terminal.
Start a listening server on port 4444:
ncat -lvnp 4444This command opens port 4444 and waits for incoming connections.
Connect to a remote device:
ncat 192.168.1.10 4444Replace 192.168.1.10 with the IP address of the target device.
Send a simple message:
echo "Hello" | ncat 192.168.1.10 4444Transfer a file to another device:
ncat 192.168.1.10 4444 < file.txtReceive a file from another device:
ncat -lvnp 4444 > received.txtCreate a simple chat server:
ncat -lvnp 5555Connect to the chat server:
ncat 192.168.1.10 5555Check if a port is open:
ncat -zv 192.168.1.10 80Scan multiple ports:
ncat -zv 192.168.1.10 20-100Test localhost connection:
ncat 127.0.0.1 8080Ncat Basic Commands
Ncat basic commands help you control connections, test networking communication, and manage listening servers directly from the terminal.
Show Ncat help menu:
ncat --helpUse UDP connection mode:
ncat -u 192.168.1.10 4444Enable verbose output:
ncat -v 192.168.1.10 80Set connection timeout:
ncat -w 5 192.168.1.10 80Listen on a custom port:
ncat -l 8080Keep server active for multiple connections:
ncat -lk 8080Save received data into a file:
ncat -lvnp 4444 > output.txtCheck local IP address:
curl ifconfig.meClear terminal screen:
clearNow Ncat is successfully running in Termux on your Android device, allowing you to test network connections, transfer files, and practice networking commands directly from your phone. Ncat provides a simple and lightweight way to explore networking concepts and improve your terminal networking skills.

