成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费

資訊專欄INFORMATION COLUMN

Service Verification in Port Scanner

Eminjannn / 755人閱讀

Recently I"m writting a port scanner and I need to verify if some standard services are running on remote hosts as expected. The verification method is quite simple(but took me a long time), that is, using connect() to that port, then analyze the returned messages. All messages will be returned by remote host only when the port being scanned is open, otherwise tag it as Unable to be connected.

HTTP
Send string "GET / HTTP " to port 80 of an ip address. The remote host will send back message like

HTTP/1.0 400 Bad Request
Content-Type: text/html; charset=UTF-8
Content-Length: 1419
Date: Tue, 02 Dec 2014 05:56:25 GMT
Server: GFE/2.0
..

Then parse the first line we can obtain the version of HTTP running on that machine is 1.0.

SSH
Send an empty string to port 22 of a specific ip address(129.79.247.86 is tested in my case, which is the server in my school), then we can get SSH-2.0-OpenSSH_5.3. The SSH service version is 5.3.

SMTP
The port 24, 25, or 587 is open, only in a mailbox ip address. So I tested my code on 113.108.16.44(smtp.qq.com) and 202.108.6.242(smtp.sina.com.cn). After sending an empty string to those hosts, I received 220 smtp.qq.com Esmtp QQ Mail Server and 220 smtp545-123.sinamail.sina.com.cn ESMTP separately. The SMTP versions are Esmtp QQ Mail Server and ESMTP.

POP
I checked port 110 on ip addresses 163.177.65.209(pop.qq.com) and 123.125.50.29(pop3.163.idns.yeah.net). Similarly, an empty string was sent and I received

+OK QQMail POP3 Server v1.0 Service Ready(QQMail v2.0)

and

+OK Welcome to coremail Mail Pop3 Server        (163coms[8db726ec93e9d4e3e9a2fd3d31b05251s])

Both are long statements. So I just put "POP3" in my result when there is a response.

WHOIS
It"s not easy to find a proper ip address with 43 port open. Finally, I found one here, which is 199.7.54.74(whois.crsnic.net). This time a string " " should be sent and the following content will shown on screen.

Whois Server Version 2.0

Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

Select a sub-topic for help; "?" (with no RETURN) for a list of options;
RETURN key to return to WHOIS.
...

A lot of stuff. But we noticed that the service version is 2.0 in first line.

IMAP
As I did before, I sent an empty string to 163.177.65.209(imap.qq.com) and got

* OK [CAPABILITY IMAP4 IMAP4rev1 IDLE XAPPLEPUSHSERVICE ID UIDPLUS AUTH=LOGIN NAMESPACE] QQMail IMAP4Server ready

So I put "IMAP" in my result if there is a response.

This is a basic idea to verify the services on remote hosts. If the port we want to check is open, it will response something once we send a appropriate query to it. The service information is then exposed by the port itself. When the port is closed or filtered, it won"t response on any request messages. In this case, the service should be unknown instead of a simply hardcode result.

文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請注明本文地址:http://systransis.cn/yun/11121.html

相關(guān)文章

  • k8s與監(jiān)控--解讀prometheus監(jiān)控kubernetes的配置文件

    摘要:前言是一個(gè)開源和社區(qū)驅(qū)動(dòng)的監(jiān)控報(bào)警時(shí)序數(shù)據(jù)庫的項(xiàng)目。集群上部署的應(yīng)用監(jiān)控部署在集群上的應(yīng)用。通過和的接口采集。相應(yīng),配置文件官方也提供了一份,今天我們就解讀一下該配置文件。對于服務(wù)的終端節(jié)點(diǎn),也需要加注解,為則會(huì)將作為監(jiān)控目標(biāo)。 前言 Prometheus 是一個(gè)開源和社區(qū)驅(qū)動(dòng)的監(jiān)控&報(bào)警&時(shí)序數(shù)據(jù)庫的項(xiàng)目。來源于谷歌BorgMon項(xiàng)目。現(xiàn)在最常見的Kubernetes容器管理系統(tǒng)中,...

    UCloud 評論0 收藏0
  • sonarqube For PHP 代碼質(zhì)量管理

    摘要:如果有報(bào)錯(cuò)官方文檔即可是時(shí)候來張圖了具體的和漢化,可以通過頁面對應(yīng)的插件。 下載jdk&sonarqube&sonar-scanner 安裝jdk 基于ubuntu 16.04+apache[具體webserver采用缺省安裝]推薦下載安裝【底部有網(wǎng)盤地址】 sonarqube-5.6.6.zip jdk-8u121-linux-x64.tar.gz sonar-scanner-2...

    hzc 評論0 收藏0
  • Java編程基礎(chǔ)35——學(xué)生管理系統(tǒng)

    摘要:視圖層表示層數(shù)據(jù)傳遞給層實(shí)現(xiàn)接收用戶輸入并調(diào)用打印菜單獲取用戶輸入調(diào)用對應(yīng)方法歡迎來到學(xué)生管理系統(tǒng)添加用戶編輯用戶查詢用戶刪除用戶退出系統(tǒng)請輸入要操作的功能序號(hào)接收用戶的菜單選擇對選擇的菜單判 showImg(https://segmentfault.com/img/bVbiXjw?w=939&h=509); 1.視圖層 package net.allidea.studentoa.ui...

    mingde 評論0 收藏0

發(fā)表評論

0條評論

最新活動(dòng)
閱讀需要支付1元查看
<