当前位置: 代码网 > 服务器>服务器>Linux > 使用curl命令查看服务器端口开放情况的方法

使用curl命令查看服务器端口开放情况的方法

2024年05月26日 Linux 我要评论
1.ssh端口 22curl -v 10.10.10.205:22curl -v 10.10.10.205:22* trying 10.10.10.205:22...* connected to

1.ssh端口 22

curl -v 10.10.10.205:22

curl -v 10.10.10.205:22
*   trying 10.10.10.205:22...
* connected to 10.10.10.205 (10.10.10.205) port 22
> get / http/1.1
> host: 10.10.10.205:22
> user-agent: curl/8.4.0
> accept: */*
>
* received http/0.9 when not allowed
* closing connection
curl: (1) received http/0.9 when not allowed

2.mysql数据库端口 3306

curl -v 10.10.10.205:3306

curl -v 10.10.10.205:3306
*   trying 10.10.10.205:3306...
* connected to 10.10.10.205 (10.10.10.205) port 3306
> get / http/1.1
> host: 10.10.10.205:3306
> user-agent: curl/8.4.0
> accept: */*
>
* received http/0.9 when not allowed
* closing connection
curl: (1) received http/0.9 when not allowed

3.web应用端口 (jellyfin 8082)

curl -v 10.10.10.205:8082

curl -v 10.10.10.205:8082
*   trying 10.10.10.205:8082...
* connected to 10.10.10.205 (10.10.10.205) port 8082
> get / http/1.1
> host: 10.10.10.205:8082
> user-agent: curl/8.4.0
> accept: */*
>
< http/1.1 302 found
< content-length: 0
< date: tue, 07 may 2024 13:22:55 gmt
< server: kestrel
< location: /web/index.html
<
* connection #0 to host 10.10.10.205 left intact

(wordpress 8088)

curl -v 10.10.10.205:8088

curl -v 10.10.10.205:8088
*   trying 10.10.10.205:8088...
* connected to 10.10.10.205 (10.10.10.205) port 8088
> get / http/1.1
> host: 10.10.10.205:8088
> user-agent: curl/8.4.0
> accept: */*
>
< http/1.1 200 ok
< date: tue, 07 may 2024 13:20:40 gmt
< server: apache/2.4.57 (debian)
< x-powered-by: php/8.2.18
< link: <http://10.10.10.205:8088/wp-json/>; rel="https://api.w.org/"
< vary: accept-encoding
< transfer-encoding: chunked
< content-type: text/html; charset=utf-8
<
<!doctype html>
。。。
。。。

(tomcat 8080)

curl -v 10.10.10.205:8080

curl -v 10.10.10.205:6666
*   trying 10.10.10.205:6666...
* connect to 10.10.10.205 port 6666 failed: connection refused
* failed to connect to 10.10.10.205 port 6666 after 2051 ms: couldn't connect to server
* closing connection
curl: (7) failed to connect to 10.10.10.205 port 6666 after 2051 ms: couldn't connect to server
 
c:\users>curl -v 10.10.10.205:8080
*   trying 10.10.10.205:8080...
* connected to 10.10.10.205 (10.10.10.205) port 8080
> get / http/1.1
> host: 10.10.10.205:8080
> user-agent: curl/8.4.0
> accept: */*
>
< http/1.1 200
< content-type: text/html;charset=utf-8
< transfer-encoding: chunked
< date: tue, 07 may 2024 13:19:25 gmt
<
 
 
 
<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>apache tomcat/9.0.30</title>
。。。
。。。

4.不存在的端口

curl -v 10.10.10.205:6666

curl -v 10.10.10.205:6666
*   trying 10.10.10.205:6666...
* connect to 10.10.10.205 port 6666 failed: connection refused
* failed to connect to 10.10.10.205 port 6666 after 2051 ms: couldn't connect to server
* closing connection
curl: (7) failed to connect to 10.10.10.205 port 6666 after 2051 ms: couldn't connect to server

5.被防火墙阻挡的端口

连接一段时间后,提示timeout

以上就是使用curl命令查看服务器端口开放情况的方法的详细内容,更多关于curl查看端口开放情况的资料请关注代码网其它相关文章!

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com