Linux port scanning with netcat (nc) command
Q. How do I find out which ports are opened on my own server? How do I run port scanning using nc command?
A. It may be useful to know which ports are open and running services on a target machine. You can use nmap command for port scanning.
How do I use nc to scan Linux / UNIX / Windows server port scanning?
If nmap is not installed try nc / netcat command. The -z flag can be used to tell nc to report open ports, rather than initiate a connection.
Run nc command with -z flag. You need to specify host name / ip along with the port range to limit and speedup operation.
$ nc -z vip-1.vsnl.nixcraft.in 1-1023
Output:
Connection to localhost 25 port [tcp/smtp] succeeded! Connection to vip-1.vsnl.nixcraft.in 25 port [tcp/smtp] succeeded! Connection to vip-1.vsnl.nixcraft.in 80 port [tcp/http] succeeded! Connection to vip-1.vsnl.nixcraft.in 143 port [tcp/imap] succeeded! Connection to vip-1.vsnl.nixcraft.in 199 port [tcp/smux] succeeded! Connection to vip-1.vsnl.nixcraft.in 783 port [tcp/*] succeeded! Connection to vip-1.vsnl.nixcraft.in 904 port [tcp/vmware-authd] succeeded! Connection to vip-1.vsnl.nixcraft.in 993 port [tcp/imaps] succeeded!
See also
- Linux: Scanning network for open ports
- netcat / nc and nmap command man page
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- Change vsftpd ftp server port 21
- ICMP IP Network Scanning / Probing using a Shell Commands
- How to: Open Ssh Port 22 on Linux APF Firewall under CentOS / RHEL
- Squid proxy How to filter or block a particular port
- Linux scan wireless card for information
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: nc_command, netcat_command, nmap, nmap_command, port_scanning



Recent Comments
Yesterday ~ 7 Comments
Yesterday ~ 33 Comments
Yesterday ~ 2 Comments
Yesterday ~ 1 Comment
Yesterday ~ 2 Comments