In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to use the netcat command to scan the ports of Linux and Unix. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
How do I use nc to scan the ports of Linux,UNIX and Windows servers?
If nmap is not installed, try the nc/netcat command, as shown below. The-z parameter is used to tell nc to report open ports, not to start a connection. When using the-z parameter in the nc command, you need to limit the scope of the port after the hostname / ip and speed up its operation:
# Syntax # nc-z-v {host-name-here} {port-range-here} nc-z-v host-name-here ssh nc-z-v host-name-here 22 nc-w 1-z-v server-name-here port-Number-her # scan 1 to 1023 port # nc-zv vip-1.vsnl.nixcraft.in 1-1023
Sample 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!
You can also scan a single port:
Nc-zv v.txvip1 443 nc-zv v.txvip1 80 nc-zv v.txvip1 22 nc-zv v.txvip1 21 nc-zv v.txvip1 smtp nc-zvn v.txvip1 ftp # use a timeout of 1 second to scan faster # netcat-v-z-n-w 1 v.txvip1 1-1023
Sample output:
Figure 01:Linux/Unix: use Netcat to test TCP and UDP to establish a connection to the server
◆-z: Port scan mode, that is, zero Imax O mode.
◆-v: displays details [use-vv to output more detailed information].
◆-n: use pure numeric IP addresses, that is, IP addresses are resolved without DNS.
◆-w 1: sets the timeout value to 1.
More examples:
$netcat-z-vv www.cyberciti.biz http www.cyberciti.biz [75.126.153.206] 80 (http) open sent 0 Rcvd 0$ netcat-z-vv google.com https DNS fwd/rev mismatch: google.com! = maa03s16-in-f2.1e100.net DNS fwd/rev mismatch: google.com! = maa03s16-in-f6.1e100.net DNS fwd/rev mismatch: google.com! = maa03s16-in-f5.1e100.net DNS fwd/rev mismatch: google.com! = maa03s16-in-f3.1e100.net DNS fwd/rev mismatch: google.com! = maa03s16-in-f8.1e100.net DNS fwd/rev mismatch: google. Com! = maa03s16-in-f0.1e100.net DNS fwd/rev mismatch: google.com! = maa03s16-in-f7.1e100.net DNS fwd/rev mismatch: google.com! = maa03s16-in-f4.1e100.net google.com [74.125.236.162] 443 (https) open sent 0 Rcvd 0$ netcat-v-z-n-w 1 192.168.1.254 1-1023 (UNKNOWN) [192.168.1.254] 989 (ftps-data) open (UNKNOWN) [192.168.1.254] 443 (https) open (UNKNOWN) [192.168.1.254] 53 (domain) open Thank you for reading! This is the end of the article on "how to use the netcat command to scan the port of Linux and Unix". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.