月別アーカイブ: 2020年5月

コマンド「nmap」で開いているポートを調べるポートスキャンする

ポートスキャンコマンド「nmap」で、対象サーバのどのポートが開いているかを調べることができます。

ーOオプションをつけて実行します。

[dacelo@space ~]$ nmap -O example.com
 TCP/IP fingerprinting (for OS scan) requires root privileges.
 QUITTING!

root権限でしか実行できません。

[dacelo@space ~]$ sudo nmap -O example.com                                                                                  

Starting Nmap 5.51 ( http://nmap.org ) at 2020-05-03 13:49 JST
Nmap scan report for example.com  (210.12.345.678)
Host is up (0.00052s latency).
Not shown: 988 filtered ports
PORT      STATE  SERVICE
20/tcp    closed ftp-data
21/tcp    open   ftp
25/tcp    open   smtp
80/tcp    open   http
110/tcp   open   pop3
143/tcp   open   imap
443/tcp   open   https
465/tcp   open   smtps
587/tcp   open   submission
993/tcp   open   imaps
995/tcp   open   pop3s
60020/tcp closed unknown
Device type: WAP|general purpose|specialized
Running (JUST GUESSING): PheeNet embedded (88%), Linux 2.6.X (87%), Netgear embedded (86%), Crestron 2-Series (85%)
Aggressive OS guesses: PheeNet WAP-854GP WAP (88%), Linux 2.6.22 (SPARC) (87%), Linux 2.6.23 - 2.6.26 (87%), Linux 2.6.17 - 2.6.35 (86%), Netgear DG834G WAP (86%), Crestron XPanel control system (85%)
No exact OS matches for host (test conditions non-ideal).

OS detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 8.97 seconds

「open」と表示されているのが、開いているポート/サービスです。