使用curl命令查看服務器端口開放情況的方法
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數(shù)據(jù)庫端口 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命令查看服務器端口開放情況的方法的詳細內(nèi)容,更多關于curl查看端口開放情況的資料請關注腳本之家其它相關文章!
相關文章
Shell腳本中的位置變量參數(shù)(特殊字符)實例講解
這篇文章主要介紹了Shell腳本中的位置變量參數(shù)(特殊字符)實例講解,本文講解了$#、$* 、$$ 、$!、$@、$-、$?等特殊字符的作用,并給出使用實例,比較清晰和簡潔,需要的朋友可以參考下2015-05-05
shell腳本將Oracle服務器中數(shù)據(jù)定時增量刷新到ftp服務器中
這篇文章主要介紹了shell腳本將Oracle服務器中數(shù)據(jù)定時增量刷新到ftp服務器中,非常不錯,具有一定的參考借鑒價值 ,需要的朋友可以參考下2019-08-08
Linux文件傳輸利器SCP命令使用詳解與實戰(zhàn)技巧
scp憑借其簡單、安全、跨平臺的特點,成為Linux文件傳輸?shù)氖走x工具,通過靈活使用參數(shù)和組合命令,可以應對大多數(shù)傳輸場景,這篇文章給大家介紹Linux文件傳輸利器SCP命令使用詳解與實戰(zhàn)技巧,感興趣的朋友一起看看吧2025-05-05
Linux shell ftp命令根據(jù)文件日期下載文件的方法
最近做項目遇到這樣的需求要求ftp獲取遠程數(shù)據(jù)的文件,根據(jù)文件的創(chuàng)建時間點下載文件。下面小編給大家分享知識點小結,感興趣的朋友要求看看吧2017-09-09
一天一個shell命令 linux文本內(nèi)容操作系列-awk命令詳解
awk是一個強大的文本分析工具,相對于grep的查找,sed的編輯,awk在其對數(shù)據(jù)分析并生成報告時,顯得尤為強大。簡單來說awk就是把文件逐行的讀入,以空格為默認分隔符將每行切片,切開的部分再進行各種分析處理2016-06-06

