[Pentest] 用 nmap 檢查本機與遠端電腦上開啟的 Port

[Pentest] 用 nmap 檢查本機與遠端電腦上開啟的 Port

最近看到書上用到 nmap,在自己網誌上查了一下,

原來我是有用過 nmap 來做過一些事情的,像是:

  – 使用 nmap 輔助找出 VirtualBox VM 目前的 IP address

  – 使用 nmap 來搜尋區域網路上的 ESXi server

 

今天在看 網站滲透測試實務入門 這本書,就再來練習一下 nmap 吧,

用它來確認目標電腦上,有多少的 open port 是可以被攻擊的~

 

先用 namp 直接打本機電腦,看看自己電腦開了哪些 port:

testuser@localhost ~ $ nmap localhost
Starting Nmap 7.12 ( https://nmap.org ) at 2016-09-14 00:39 CST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0018s latency).
Other addresses for localhost (not scanned): ::1
Not shown: 498 closed ports, 497 filtered ports
PORT    STATE SERVICE
22/tcp  open  ssh
88/tcp  open  kerberos-sec
445/tcp open  microsoft-ds
548/tcp open  afp
631/tcp open  ipp
Nmap done: 1 IP address (1 host up) scanned in 2.52 seconds

 

嗯,有一些蠻不熟悉的 port…

參考一下 Apple Support: TCP and UDP ports used by Apple software products

  – Port 88: Kerberos (including Screen Sharing authentication)

  – Port 548: AppleShare, Personal File Sharing, Apple File Service

  – Port 631: Mac OS X Printer Sharing, Printing to many common printers

 

看來都是一些分享用的服務,如螢幕共享、檔案分享,和列印功能等等造成的,

但這些服務我都需要使用,所以也不能關…

 

再來用 nmap 測一下測試網站 demo.testfire.net,

保護的不錯,只開了 3 個 port:

testuser@localhost ~ $ nmap demo.testfire.net
Starting Nmap 7.12 ( https://nmap.org ) at 2016-09-14 00:40 CST
Nmap scan report for demo.testfire.net (65.61.137.117)
Host is up (0.18s latency).
Not shown: 997 closed ports
PORT     STATE SERVICE
80/tcp   open  http
443/tcp  open  https
8080/tcp open  http-proxy
Nmap done: 1 IP address (1 host up) scanned in 12.35 seconds

 

其實從這個 nmap 的結果,我們就得到了一些資訊:

像是原本我們只知道 http://demo.testfire.net 這個網站,

但從 port 443 得知,它應該有個 https://demo.testfire.net 的網站,

另外還有一個 port 8080 的通常是 proxy port,也是值得研究的對象囉~

 

(本頁面已被瀏覽過 1,247 次)

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料