[20171204]nc快速判断端口是否打开2.txt

简介: [20171204]nc快速判断端口是否打开2.txt --//前几天写了一篇通过nc快速判断打开那些端口,链接如下: http://blog.itpub.net/267265/viewspace-2148121/ --//如果要判断一定的范围,可以执行如下: $ echo a | nc -w 1 -n -v  192.

[20171204]nc快速判断端口是否打开2.txt

--//前几天写了一篇通过nc快速判断打开那些端口,链接如下:
http://blog.itpub.net/267265/viewspace-2148121/

--//如果要判断一定的范围,可以执行如下:
$ echo a | nc -w 1 -n -v  192.168.xxx.xx 1-1521 2>/dev/null | grep "succeeded"
Connection to 192.168.xxx.xx 21 port [tcp/*] succeeded!
Connection to 192.168.xxx.xx 22 port [tcp/*] succeeded!
Connection to 192.168.xxx.xx 80 port [tcp/*] succeeded!
Connection to 192.168.xxx.xx 111 port [tcp/*] succeeded!
Connection to 192.168.xxx.xx 113 port [tcp/*] succeeded!
Connection to 192.168.xxx.xx 443 port [tcp/*] succeeded!
Connection to 192.168.xxx.xx 1521 port [tcp/*] succeeded!

--//在服务端检查如下:
# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 0.0.0.0:32768               0.0.0.0:*                   LISTEN      2553/rpc.statd
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      2533/portmap
tcp        0      0 0.0.0.0:113                 0.0.0.0:*                   LISTEN      27632/xinetd
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      2966/vsftpd
tcp        0      0 :::80                       :::*                        LISTEN      26638/httpd
tcp        0      0 :::1521                     :::*                        LISTEN      26334/tnslsnr
tcp        0      0 :::22                       :::*                        LISTEN      12568/sshd
tcp        0      0 :::443                      :::*                        LISTEN      26638/httpd

--//另外测试发现扫描还很快,如果我从1-65000,大约4-5秒ok(注另外的服务器):

# echo a | nc -w 1 -n -v  192.168.yyy.yy 1-65000 2>/dev/null | grep "succeeded"
Connection to 192.168.yyy.yy 22 port [tcp/*] succeeded!
Connection to 192.168.yyy.yy 111 port [tcp/*] succeeded!
Connection to 192.168.yyy.yy 833 port [tcp/*] succeeded!
Connection to 192.168.yyy.yy 857 port [tcp/*] succeeded!
Connection to 192.168.yyy.yy 953 port [tcp/*] succeeded!
Connection to 192.168.yyy.yy 1521 port [tcp/*] succeeded!
Connection to 192.168.yyy.yy 2049 port [tcp/*] succeeded!
Connection to 192.168.yyy.yy 51082 port [tcp/*] succeeded!
Connection to 192.168.yyy.yy 52744 port [tcp/*] succeeded!
Connection to 192.168.yyy.yy 57371 port [tcp/*] succeeded!

# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 192.168.yyy.yy:1521         0.0.0.0:*                   LISTEN      61210/tnslsnr
tcp        0      0 127.0.0.1:1521              0.0.0.0:*                   LISTEN      61210/tnslsnr
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      25383/sshd
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      29590/cupsd
tcp        0      0 0.0.0.0:953                 0.0.0.0:*                   LISTEN      39779/rpc.statd
tcp        0      0 0.0.0.0:857                 0.0.0.0:*                   LISTEN      39686/rpc.mountd
tcp        0      0 0.0.0.0:57371               0.0.0.0:*                   LISTEN      -
tcp        0      0 0.0.0.0:2049                0.0.0.0:*                   LISTEN      -
tcp        0      0 0.0.0.0:833                 0.0.0.0:*                   LISTEN      39661/rpc.rquotad
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      39531/portmap
tcp        0      0 :::22                       :::*                        LISTEN      25383/sshd
tcp        0      0 :::52744                    :::*                        LISTEN      9755/ora_d000_book
tcp        0      0 :::51082                    :::*                        LISTEN      14344/ora_d000_orcl

--//顺便解答链接的问题 [20170825]不启动监听远程能连接数据库吗2 =>[20170825]不启动监听远程能连接数据库吗
--//如何探测oracle 共享服务器端口,我感觉比nmap还有快.

目录
相关文章
|
5月前
|
监控 网络协议 Unix
Linux命令-nc(端口监控、文件传输、反弹shell等)
Linux命令-nc(端口监控、文件传输、反弹shell等)
117 0
|
监控 网络协议 Linux
Linux利用nc命令脚本批量检测服务器指定端口是否开放
nc命令脚本批量检测服务器指定端口是否开放
938 0
Linux利用nc命令脚本批量检测服务器指定端口是否开放
|
网络协议 Apache Linux
[20171201]nc快速判断端口是否打开.txt
[20171201]nc快速判断端口是否打开.txt --//nc快速判断端口是否打开,例子: $ echo exit | nc -w 1 -n -v  192.168.
1209 0
|
5月前
|
Ubuntu 关系型数据库 MySQL
百度搜索:蓝易云【ubuntu20.4服务器安装mysql社区版并开放3306端口】
现在,你已经在Ubuntu 20.04服务器上成功安装了MySQL社区版,并且已经开放了3306端口,可以通过该端口访问MySQL服务器了。请确保在生产环境中设置安全措施,例如设置强密码、限制访问等,以保护数据库的安全性。
96 2
|
4月前
|
Java Nacos Docker
在集成nacos时,端口9848报错但服务器的这个端口是开放的
在集成nacos时,端口9848报错但服务器的这个端口是开放的【1月更文挑战第14天】【1月更文挑战第67篇】
257 1
|
7月前
|
网络安全 数据安全/隐私保护
百度搜索:蓝易云【多个端口怎么运行SSH服务器?】
记得替换 `username`为你的用户名,`your_server_ip`为你的服务器IP地址。根据需要,可以添加其他端口并进行相应的配置。
87 0