0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

nmapのオプション”-A”考察

Posted at

nmapのオプション”-A”

ポートスキャンツールである、nmapのオプション”-A”で何をしているかを調査。”-A”はヘルプによると
-A: Enable OS detection, version detection, script scanning, and traceroute
とあり、OS及びバージョン検出、スクリプトスキャン、tracerouteとある。SYNスキャンとは異なり、TCPセッション確立後に情報を取得しようとする。ここでは、nmap側が得ている情報を視点に記載。

実行方法

単純である。

$ sudo nmap -A 192.168.2.2

以降、この結果をWireshark(キャプチャが小さくて申し訳ない)で取得したデータとともに説明。

結果

対象はLinux(Ubuntu)とWindows10とした。オープンしていると検出し、付加情報があるポートについて記載。

Ubuntu

22(ssh)

22/tcp    open  ssh                   OpenSSH 9.6p1 Ubuntu 3ubuntu13.8 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   256 xx:yy:aa:11:dd:44:gg:44:dd:33:pp:pp:ww:22:33:44 (ECDSA)
|_  256 xx:yy:aa:11:dd:44:gg:44:dd:33:pp:pp:ww:22:33:44 (ED25519)

Wiresharkの状況は下記であった。以降、nmapの結果の次にWiresharkの結果を記す。

Serverからのレスポンス”OpenSSH 9.6p1 Ubuntu 3ubuntu13.8”をnmapの結果として表示している。”ssh-hostkey”については詳細不明。

25(smtp)

25/tcp    open  smtp                  Postfix smtpd
| ssl-cert: Subject: commonName=XXXX
| Subject Alternative Name: DNS:XXXX
| Not valid before: 2024-08-31T23:39:22
|_Not valid after:  2034-08-29T23:39:22
|_ssl-date: TLS randomness does not represent time
|_smtp-commands: XXXX.YY2dc.com, PIPELINING, SIZE 10240000, ETRN, STARTTLS, AUTH PLAIN LOGIN, ENHANCEDSTATUSCODES, 8BITMIME, DSN, SMTPUTF8, CHUNKING

port25のコピー.png
EHLOコマンドのレスポンス(サポートしているオプションコマンド)を表示している。SMTPサーバーとして、postfixを使っており、それを表示しているのであるが、Wiresharkの検索ではこの文字列は見つからず(暗号化されている部分に含まれている?)。何らかの特徴から、postfixと判断したのであろうか?

80(http)

80/tcp    open  http                  Apache httpd 2.4.58 ((Ubuntu))
|_http-server-header: Apache/2.4.58 (Ubuntu)
|_http-title: Apache2 Ubuntu Default Page: It works

port80.png
port80_Apache2のコピー.png

OPTIONSコマンドなど情報を得ようとしていることがわかり、HTTPレスポンスの”Apache”を表示している。その他HTTPレスポンスがあるのだが、ほとんど結果表示していないようだ。

110(pop3)

110/tcp   open  pop3                  Dovecot pop3d
| ssl-cert: Subject: commonName=aspero
| Subject Alternative Name: DNS:aspero
| Not valid before: 2024-08-31T23:39:22
|_Not valid after:  2034-08-29T23:39:22
|_ssl-date: TLS randomness does not represent time
|_pop3-capabilities: CAPA TOP SASL STLS AUTH-RESP-CODE RESP-CODES PIPELINING UIDL

port110のコピー.png

CAPAコマンドにより、オプショナルでサポートしている機能を表示している。POPサーバーであるDovecotも表示されている。

465(smtps)

465/tcp   open  ssl/smtp              Postfix smtpd
|_ssl-date: TLS randomness does not represent time
|_smtp-commands: XXX.YY2dc.com, PIPELINING, SIZE 10240000, ETRN, AUTH PLAIN LOGIN, ENHANCEDSTATUSCODES, 8BITMIME, DSN, SMTPUTF8, CHUNKING
| ssl-cert: Subject: commonName=aspero
| Subject Alternative Name: DNS:aspero
| Not valid before: 2024-08-31T23:39:22
|_Not valid after:  2034-08-29T23:39:22

port465.png

どのようにSMTPサポートコマンドを検出したのか不明。(TLS内?)

587(smtp submission)

587/tcp   open  smtp                  Postfix smtpd
| ssl-cert: Subject: commonName=XXX
| Subject Alternative Name: DNS:XXX
| Not valid before: 2024-08-31T23:39:22
|_Not valid after:  2034-08-29T23:39:22
|_ssl-date: TLS randomness does not represent time
|_smtp-commands: aspero.annecy2dc.com, PIPELINING, SIZE 10240000, ETRN, STARTTLS, ENHANCEDSTATUSCODES, 8BITMIME, DSN, SMTPUTF8, CHUNKING

port587のコピー.png

ここは、port25とほぼ同じ。

995(pop3 over tls/ssl)

995/tcp   open  ssl/pop3              Dovecot pop3d
|_pop3-capabilities: CAPA TOP SASL(PLAIN LOGIN) RESP-CODES AUTH-RESP-CODE USER PIPELINING UIDL
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=XXX
| Subject Alternative Name: DNS:XXX
| Not valid before: 2024-08-31T23:39:22
|_Not valid after:  2034-08-29T23:39:22

port995.png

POP3機能をどのように把握したかわからず。

9090(WebSM:cockpit)

9090/tcp  open  ssl/http              Cockpit web service 282 or later
|_http-title: Loading...
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=XXX/organizationName=7de7df5891ca4e8faa4b8244c9d5f395
| Subject Alternative Name: IP Address:127.0.0.1, DNS:localhost
| Not valid before: 2025-03-25T09:04:23
|_Not valid after:  2026-04-24T09:04:23

port9090のコピー.png

CockpitはWebベースのリモート管理を行うもの。Wiresharkではhttpで翻訳される。レスポンス内容が”Client Error”のため、結果表示はそれほど存在しない。

10000(Network Data Management Protocol?)
10000/tcp open  ssl/snet-sensor-mgmt?
| fingerprint-strings: 
|   GetRequest: 
|     HTTP/1.0 200 Document follows
|     Date: Sat, 29 Mar 2025 11:32:17 GMT
|     Server: MiniServ
|     Connection: close
|     Auth-type: auth-required=1
|     Set-Cookie: redirect=1; path=/; secure; httpOnly
|     Set-Cookie: testing=1; path=/; secure; httpOnly
|     X-Frame-Options: SAMEORIGIN
|     Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval'; frame-src 'self'; child-src 'self'
|     X-Content-Type-Options: nosniff
|     X-no-links: 1
|     Content-type: text/html; Charset=UTF-8
|     <!DOCTYPE HTML>

長いので略

SF:ipt\]\x20{\x20color:\x20#979ba080;\x20}\x20html\[data-slider-fixed='1'\
SF:]\x20{\x20margin-right:\x200\x20!important;\x20}\x20body\x20>\x20div\[d
SF:ata-noscript\]\x20~\x20\*\x20{\x20display:\x20none\x20!impo");

port10000のコピー.png

ここは、HTMLレスポンスをそのまま結果表示しており、portによって、結果表示に差がある感じ。理由はわからず。

その他

MAC Address: AC:87:A3:XX:YY:B8 (Apple)

Device type: general purpose|router
Running: Linux 5.X, MikroTik RouterOS 7.X
OS CPE: cpe:/o:linux:linux_kernel:5 cpe:/o:mikrotik:routeros:7 cpe:/o:linux:linux_kernel:5.6.3
OS details: Linux 5.0 - 5.14, MikroTik RouterOS 7.2 - 7.5 (Linux 5.6.3)
Network Distance: 1 hop
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT     ADDRESS
1   0.51 ms 192.168.2.2

MacアドレスとTracerouteの結果はさておき、それ以外の部分であるが、Wiresharkで取得したキャプチャデータに見つからず、、であった。よって、これらは、取得した情報からの推測であろう。

Windows10

小生の環境でのUbuntuとの差異を下記。

445(smb)

445/tcp   open  microsoft-ds    Windows 10 Pro 19045 microsoft-ds (workgroup: WORKGROUP)

W-port445.png

それなりの情報を取得しているのだが、結果表記はほとんどなし。

902,912(vmware)

902/tcp   open  ssl/vmware-auth VMware Authentication Daemon 1.10 (Uses VNC, SOAP)

W-port902のコピー.png

912/tcp   open  vmware-auth     VMware Authentication Daemon 1.0 (Uses VNC, SOAP)

W-port912のコピー.png

デーモン名を取得&表示。

3389(rdp)

3389/tcp  open  ms-wbt-server   Microsoft Terminal Services
| ssl-cert: Subject: commonName=LXXXXer
| Not valid before: 2024-12-04T11:46:20
|_Not valid after:  2025-06-05T11:46:20
| rdp-ntlm-info: 
|   Target_Name: LXXXXER
|   NetBIOS_Domain_Name: LXXXXER
|   NetBIOS_Computer_Name: LXXXXER
|   DNS_Domain_Name: LXXXXer
|   DNS_Computer_Name: LXXXXer
|   Product_Version: 10.0.19041
|_  System_Time: 2025-03-29T01:20:15+00:00
|_ssl-date: 2025-03-29T01:20:43+00:00; -5s from scanner time.

W-port3389.png

よくわからず。

5357(wsd)

5357/tcp  open  http            Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Service Unavailable
|_http-server-header: Microsoft-HTTPAPI/2.0

W -port5357.png

HTTPライク。レスポンスがほとんどないので、結果表示も寂しい。

その他

MAC Address: 6C:B3:11:YY:51:UU (Shenzhen Lianrui Electronics)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 10|11|2019 (97%)
OS CPE: cpe:/o:microsoft:windows_10 cpe:/o:microsoft:windows_11 cpe:/o:microsoft:windows_server_2019
Aggressive OS guesses: Microsoft Windows 10 1803 (97%), Microsoft Windows 10 1903 - 21H1 (97%), Microsoft Windows 11 (94%), Microsoft Windows 10 1809 (92%), Microsoft Windows 10 1909 (91%), Microsoft Windows 10 1909 - 2004 (91%), Windows Server 2019 (91%), Microsoft Windows 10 20H2 (88%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 1 hop
Service Info: Host: LXXXXXER; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb-security-mode: 
|   account_used: guest
|   authentication_level: user
|   challenge_response: supported
|_  message_signing: disabled (dangerous, but default)
|_clock-skew: mean: -1h48m04s, deviation: 4h01m29s, median: -5s
| smb-os-discovery: 
|   OS: Windows 10 Pro 19045 (Windows 10 Pro 6.3)
|   OS CPE: cpe:/o:microsoft:windows_10::-
|   Computer name: Lxxxxxer
|   NetBIOS computer name: LXXXXXER\x00
|   Workgroup: WORKGROUP\x00
|_  System time: 2025-03-29T10:20:14+09:00
|_nbstat: NetBIOS name: LXXXXXER, NetBIOS user: <unknown>, NetBIOS MAC: 6c:b3:11:YY:51:UU (Shenzhen Lianrui Electronics)
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled but not required
| smb2-time: 
|   date: 2025-03-29T01:20:15
|_  start_date: N/A

TRACEROUTE
HOP RTT     ADDRESS
1   0.86 ms 192.168.2.44

最後に取得した総合解析結果(推測との記載もあり)を表示している。

終わりに

まとまりのない話となってしまった。結局は、nmapのソースコードなりを見ないと把握できないのであろう。ある程度のデータを持って、解析&推測していると思われる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?