DEV Community

Cover image for Day 2: Netcat Tutorial for Beginners — Master the Swiss Army Knife of Networking in Kali Linux (2026)
Mr Elite
Mr Elite

Posted on • Originally published at securityelites.com

Day 2: Netcat Tutorial for Beginners — Master the Swiss Army Knife of Networking in Kali Linux (2026)

📰 Originally published on SecurityElites — the canonical, fully-updated version of this article.

Day 2: Netcat Tutorial for Beginners — Master the Swiss Army Knife of Networking in Kali Linux (2026)

DAY 2 OF 180
KALI LINUX MASTERY COURSE
FREE — ALL 180 DAYS

View Full Course →

🔵 Day 2 — Netcat Tutorial

Day 180 — Advanced Kali Mastery

← Day 1: Nmap

Day 3: Gobuster →

Before You Start Day 2 — Day 1 Quick Check
Completed Day 1’s Nmap tasks? You should have run a basic scan on your router, used -sV for version detection, discovered live hosts on your subnet, and saved output with -oA. If yes — let’s go. If not — Day 1 takes 90 minutes. Do it first. The course builds cumulatively.

02

Yesterday you used Nmap to see everything on a network. Today you’re going to reach out and touch it. Netcat — shortened to nc — is the raw, direct way to make a network connection with nothing between you and the destination except TCP or UDP packets. No browser. No client software. Just you, a port number, and a stream of bytes flowing both directions.

People call it the Swiss Army Knife of networking because it does an extraordinary number of things with a tiny, single tool: connect to any port, listen on any port, send files, receive files, scan ports, grab service banners, and create direct communication channels between machines. Almost every advanced technique in this course — reverse shells in Metasploit, file exfiltration in penetration tests, catching callbacks from exploited systems — uses Netcat or relies on the same concepts Netcat teaches.

When you finish today, you will understand networking at a level most developers never reach. Let’s begin with the fundamentals — and build up to the techniques that matter in real security work.

📋 Day 2 Contents — Netcat Complete Tutorial

  1. What Is Netcat and Why Learn It?
  2. Step 1 — Verify Netcat in Kali
  3. Step 2 — Netcat Flags Explained
  4. Step 3 — Connect to a Remote Port
  5. Step 4 — Set Up a Netcat Listener
  6. Step 5 — Two-Machine Communication
  7. Step 6 — File Transfer with Netcat
  8. Step 7 — Port Scanning with Netcat
  9. Step 8 — Banner Grabbing
  10. Step 9 — UDP Mode
  11. Step 10 — Bind vs Reverse (Concept)
  12. Bonus — Ncat (the Modern Netcat)
  13. Netcat Cheat Sheet
  14. Day 2 Task and Challenge

What Is Netcat and Why Is It Called the Swiss Army Knife of Networking?

Netcat was originally written by Hobbit in 1995 — one year before the first iPhone prototype was even conceived. Like Nmap, it has outlasted a generation of flashier tools because its design is fundamentally correct: do one thing (move bytes across a network connection) and do it perfectly, without unnecessary complexity.

The reason Netcat is called the Swiss Army Knife is not marketing — it is literal. A Swiss Army Knife has the same physical blade performing different functions depending on which attachment you flip open. Netcat has the same underlying mechanism (TCP/UDP socket) performing completely different functions depending on which flags you give it:

🔧 The Same Tool — Completely Different Jobs

🔌
TCP/UDP CLIENT
Connect to any port on any host

👂
PORT LISTENER
Wait for incoming connections on any port

📁
FILE TRANSFER
Send and receive files without SCP/FTP

🔍
PORT SCANNER
Quick check — which ports are open?

🏷️
BANNER GRABBER
Read what a service announces when you connect

💬
NETWORK CHAT
Raw terminal-to-terminal communication

STEP 1 Verify Netcat Is Installed in Kali Linux

Kali Linux ships with multiple Netcat variants. The two you will encounter most are nc (the traditional OpenBSD Netcat) and ncat (the modern Nmap reimplementation). Let’s verify both are available.

kali@kali: ~$ — Verify Netcat Installation

Check the traditional nc command

┌──(kali㉿kali)-[~]
└─$ nc -h
OpenBSD netcat (Debian patchlevel 1.226-1)
usage: nc [-46CDdFhklNnrStUuvZz] [-I length] [-i interval] [-M ttl]
[-m minttl] [-O length] [-P proxy_username] [-p source_port]
[-q seconds] [-s sourceaddr] [-T keyword] [-V rtable] [-W recvlimit]
[-w timeout] [-X proxy_protocol] [-x proxy_address[:port]]
[destination] [port]

Check the modern ncat (from Nmap)

└─$ ncat –version
Ncat: Version 7.94SVN ( https://nmap.org/ncat )

Confirm which nc binary is actually running

└─$ which nc
/usr/bin/nc
└─$ ls -la /usr/bin/nc
lrwxrwxrwx 1 root root 20 Feb 12 2026 /usr/bin/nc -> /etc/alternatives/nc

If you see “command not found,” install with sudo apt install netcat-openbsd -y. For ncat: sudo apt install ncat -y. Both come with Kali by default.

STEP 2 Netcat Flags Explained — Know Every Option Before You Type

The power of Netcat is in its flags. Understanding what each flag does before you combine them eliminates confusion. Here are the flags you will use in every real-world scenario:

securityelites.com

NETCAT (nc) FLAGS — COMPLETE REFERENCE

FLAG
NAME
WHAT IT DOES

-l
Listen
Put Netcat in server mode — wait for an incoming connection instead of initiating one. The most important flag you will use.

-v
Verbose
Print status messages to stderr — shows “Listening on…” and “Connection received from…” confirmation messages.

-n
Numeric
No DNS resolution — use raw IP addresses only. Faster connections. Prevents information leakage via DNS queries.


📖 Read the complete guide on SecurityElites

This article continues with deeper technical detail, screenshots, code samples, and an interactive lab walk-through. Read the full article on SecurityElites →


This article was originally written and published by the SecurityElites team. For more cybersecurity tutorials, ethical hacking guides, and CTF walk-throughs, visit SecurityElites.

Top comments (0)