Ncat Installation & Usage in Termux
Ncat is widely considered the 'Swiss Army Knife' of networking. It allows you to read, write, and redirect data across networks in Termux, making it an essential tool for debugging, testing, and transferring data.
Installation Commands
Ncat is part of the nmap package. Follow these steps to install it in Termux.
1. Update Packages
pkg update && pkg upgrade -y
2. Install Nmap
pkg install nmap -y
3. Verify Installation
ncat --version
Practical Usage Examples
Once installed, you can use Ncat for a variety of tasks.
Listening on a Port
Start a listening server on port 4444. Useful for receiving connections.
ncat -lvnp 4444
Connecting to a Port
Connect to a remote device listening on port 4444.
ncat <IP_ADDRESS> 4444
File Transfer
Send a file to a listening receiver:
ncat <IP_ADDRESS> 4444 < file.txt
Receive a file (acting as a listener):
ncat -lvnp 4444 > received.txt
Basic Network Analysis
Check if a specific port is open on a target (e.g., port 80):
ncat -zv <IP_ADDRESS> 80
Scan a range of ports (e.g., 20-100):
ncat -zv <IP_ADDRESS> 20-100