Ncat- Netcat Windows and Linux Tutorial

Netcat is one of the best and important tool that plays an important role in the field of IT security, Penetration testing or ethical hacking, it is also called Swiss-army knife for TCP/IP. Here TCP/IP does not show that netcat works for TCP only, it can be use for UPD also. The importance of Netcat is not a hidden truth you can use Ncat for many purposes.

If you are using some Linux distribution like Backtrack, Gnacktrack, Backbox or others than you can find Netcat on this, open terminal and type Netcat if it will response than you don’t need to install it.
In this article I will cover some basic and advance usage of Netcat but before going to actual tutorial I want to explain some background.

What Is Netcat ?

Netcat is a featured networking utility which reads and writes data across network connections, using the TCP/IP protocol. Unix has a CAT command and netcat has been designed to achieve the goal of Cat command you can use netcat on various operating system, Nmap team has been designed Ncat on the concept of Netcat, so it is primely the same thing.

What Netcat Can Do?

This is the most important and simplest question you might be wonder about it, the answer is that netcat can do various things but here is the most important stuffs.
  • Banner grabbing
  • File transferring
  • Telnet usage
  • Shell backdoor



You can use ncat on your Windows box too but for this tutorial I am using backtrack 5 Linux, so here is the tutorial from basic to advance. The basic command is as follows

# ncat <options> <hostname> <port>

The default port for Netcat is 31337, you can use some other ports as well to connect to the server, remember this a ncat tutorial so in the command I will type ncat instead of netcat. You can find help by using this command.
# ncat -h
If you want to learn banner (the process called banner grabbing) of a server software than use the simplest command of ncat.
# ncat google.com 80
You might wonder that why I have used port number 80, port 80 is for HTTP and sometimes a large server uses firewalls or IDS so the other port might be closed. 


So by banner grabbing you can get valuable information.
You can upload any file to any server or client computer here is the main command replace the IP address to your desired IP.
# ncat -l 80 < test.txt

Note: If you want to learn more about Linux and Windows based Penetration testing, you might want to subscribe our RSS feed and Email Subscription  or become our Facebook fan! You will get all the latest updates at both the places.
Ehacking Staff
With more than 50 global partners, we are proud to count the world’s leading cybersecurity training provider. EH Academy is the brainchild of Ehacking, which has been involved in the field of training since the past Five years and continues to help in creating professional IT experts.

Most Popular

What Makes ICS/OT Infrastructure Vulnerable?

Infrastructure security for operational technologies (OT) and industrial control systems (ICS) varies from IT security in several ways, with the inverse confidentiality, integrity, and...

Everything You Must Know About IT/OT Convergence

What is an Operational Technology (OT)? Operational technology (OT) is a technology that primarily monitors and controls physical operations. It can automate and control machines,...

Understand the OT Security and Its Importance

This article discusses OT security and why it is essential for protecting industrial systems from cyberattacks. We will also discuss common control objectives that can...

What is Deepfake, and how does it Affect Cybersecurity?

Producing deepfake is easy. It is hard to detect. They operate with a description of reality rather than reality itself (e.g., a video). Any...