All     Ethical Hacking     Networking     Programming     OSINT

Netcat in Termux – Installation & Basic Commands

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 -y

Install Netcat:

pkg install netcat-openbsd mandoc -y

Check version/help:

nc -h

Basic Commands

Scan for open ports:

nc -zv target-ip 1-1000

Start a listener on a port:

nc -lvp 4444

Connect to a listener:

nc target-ip 4444

Send a file to another device:
Receiver:

nc -lvp 1234 > file.txt

Sender:

nc target-ip 1234 < file.txt

Simple chat between two devices:
Device 1:

nc -lvp 5555

Device 2:

nc device1-ip 5555

Send text to a port:

echo "Hello" | nc target-ip 80

Uninstall Netcat:

pkg uninstall netcat-openbsd