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

简介: [20171201]nc快速判断端口是否打开.txt --//nc快速判断端口是否打开,例子: $ echo exit | nc -w 1 -n -v  192.168.

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

--//nc快速判断端口是否打开,例子:

$ echo exit | nc -w 1 -n -v  192.168.xxx.xx 1521
Connection to 192.168.xxx.xx 1521 port [tcp/*] succeeded!


$ echo exit | nc -w 1 -n -v  192.168.xxx.xx 22
Connection to 192.168.xxx.xx 22 port [tcp/*] succeeded!
SSH-1.99-OpenSSH_3.9p1
Protocol mismatch.


$ echo exit | nc -w 1 -n -v  192.168.xxx.xx 80
Connection to 192.168.xxx.xx 80 port [tcp/*] succeeded!
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>501 Method Not Implemented</title>
</head><body>
<h1>Method Not Implemented</h1>

exit to / not supported.


<hr>
<address>Apache/2.0.52 (Red Hat) Server at 192.168.xxx.xx Port 80</address>
</body></html>


$ echo quit | nc -w 1 -n -v  192.168.xxx.xx 23
Connection to 192.168.xxx.xx 23 port [tcp/*] succeeded!
????

--//关闭23端口测试:

# /etc/rc.d/init.d/xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]

$ echo quit | nc -w 1 -n -v  192.168.xxx.xx 23
nc: connect to 192.168.xxx.xx port 23 (tcp) failed: Connection refused

--//其中-w参数设置超时.
-w timeout
    If a connection and stdin are idle for more than timeout seconds, then the connection is silently closed.  The -w
    flag has no effect on the -l option, i.e. nc will listen forever for a connection, with or without the -w flag.  The
    default is no timeout.

目录
相关文章
|
5月前
|
监控 网络协议 Unix
Linux命令-nc(端口监控、文件传输、反弹shell等)
Linux命令-nc(端口监控、文件传输、反弹shell等)
346 0
|
监控 网络协议 Linux
Linux利用nc命令脚本批量检测服务器指定端口是否开放
nc命令脚本批量检测服务器指定端口是否开放
1092 0
Linux利用nc命令脚本批量检测服务器指定端口是否开放
|
网络协议 数据库
[20171204]nc快速判断端口是否打开2.txt
[20171204]nc快速判断端口是否打开2.txt --//前几天写了一篇通过nc快速判断打开那些端口,链接如下: http://blog.itpub.net/267265/viewspace-2148121/ --//如果要判断一定的范围,可以执行如下: $ echo a | nc -w 1 -n -v  192.
1046 0
|
网络协议 Oracle 关系型数据库
[20161227]打开多个监听端口.txt
[20161227]打开多个监听端口.txt --安全等保的需求,需要在1台数据库打开2个监听端口,并且还不能是1521缺省端口.看了一些文档,做一些记录. --参考连接:http://blog.
807 0
|
关系型数据库 Linux 网络安全
[20160510]ssh端口隧道与转发.txt
[20160510]ssh端口隧道与转发.txt --生产环境要实现一种特殊需求,B能连通A,C不能连通A,但是C可以连通B,要求实现C通过B来访问A. --想到了SSH隧道或者端口转发,自己做一个测试: 1.
794 0
|
网络协议 Oracle 关系型数据库
[20160418]修改oracle监听端口.txt
[20160418]修改oracle监听端口.txt --上午开发提出要修改oracle的监听端口,我以前测试遇到过一些问题: --链接: http://blog.
922 0