开发者

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

开发者 https://www.devze.com 2024-08-10 11:57 出处:网络 作者: sun0322
目录1.ssh端口 222.mysql数据库端口 33063.web应用端口 (Jellyf编程in 8082)(WordPress 8088)(tomcat 8080)4.不存在的端口5.被防火墙阻挡的端口1.ssh端口 22
目录
  • 1.ssh端口 22
  • 2.mysql数据库端口 3306
  • 3.web应用端口 (Jellyf编程in 8082)
    • (WordPress 8088)
    • (tomcat 8080)
  • 4.不存在的端口
    • 5.被防火墙阻挡的端口

      1.ssh端口 22

      curl -v 10.10.10.205:22

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

      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命令查看服务器端口开放情况的方法

      curl -v 10.10.10.205:3306
      *   Tryinghttp://www.devze.com 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命令查看服务器端口开放情况的方法

      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: cuandroidrl/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命令查看服务器端口开放情况的方法

      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 (De编程客栈bian)
      < 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命令查看服务器端口开放情况的方法

      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
      <python; 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命令查看服务器端口开放情况的方法

      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查看端口开放情况的资料请关注编程客栈(www.devze.com)其它相关文章!

      0

      精彩评论

      暂无评论...
      验证码 换一张
      取 消

      关注公众号