scan tcp and udp open ports using netcat
September 3rd, 2006 mysurface Posted in Admin, nc | Hits: 85732 | 8 Comments »
Netcat is a very powerful tools to setup a TCP/UDP connections and listens deamon. I am here to show you how to perform port scanning method. Port scanning is like a knife, you can use it to help you tear up something you couldn’t open by hand and you can use it to perform murder. A lots of “hacker” likes to use port scanner to detect an open port of its target, so that he can perform the art of hacking towards its target. My intention is not to show you how can you do that, port scanner can be use to investigate your network, certain ports have to be open in order to allow certain applications to function correctly.
To scan for a TCP port 22, let say your target IP is 219.90.25.252
nc -z 219.90.25.252 22
To scan for a UDP port 22
nc -zu 219.90.25.252 22
To scan a range of UDP port 13252-13258
nc -zu 219.90.25.252 13252-13258
In order to get more information, you can add v, for more verbose, add another v
nc -vvzu 219.90.25.252 13252-13258
January 30th, 2010 at 12:33 am
UDP tests will always show as “open”. The -uz argument is useless.
December 14th, 2010 at 8:55 am
can use nc to tranfer data ?
February 16th, 2011 at 1:29 am
Yes, see the Data Transfer section of http://linux.die.net/man/1/nc
February 28th, 2011 at 7:25 pm
Jim, No, UDP scanning is not “useless”, but you need to do some additional research on UDP scanning to understand what is happening
November 19th, 2011 at 12:20 am
This is a very helpfull page :) What would you recommend a bash script running multiple nc threads or nmap for scanning a list of ips for a port state open/closed? What would be faster?
January 1st, 2014 at 6:13 pm
what kind of research, be more specific if you want to help.
UDP scan with netcan is useless for too.It always shows udp ports as open.
November 1st, 2016 at 7:01 pm
Wonderful Site, Preserve the very good job. With thanks!.
June 17th, 2019 at 9:11 pm
http://cigmarket.eu/