Thuta Learning
ရှာဖွေရန်
IntermediateSecurityintermediate

Nmap Deep Dive (Scan Types, Version Detection)

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

ဒီခန်းပြီးရင် ဘာတတ်သွားမလဲ

  • Nmap Deep Dive (Scan Types, Version Detection) ကို ကြောက်စရာမလိုအောင် နားလည်မယ်
  • ကိုယ်တိုင် authorized lab environment ထဲမှာ tool ကို run ကြည့်တတ်မယ်
  • Real assessment/report ထဲမှာ ဒီ concept ကို ချက်ချင်း အသုံးချတတ်မယ်

ခဏလေး ဒီလိုပဲ စဉ်းစားကြည့်

SYN Scan (`-sS`) က TCP handshake ကို အပြည့်အစုံ မဖြစ်ဘဲ scan လုပ်ခြင်းပါ ('half-open scan') — traditional connect scan ထက် stealthy ပြီး fast ပါတယ် (root/admin permission လိုအပ်ပါတယ်)။ Service/Version Detection (`-sV`) က port ဖွင့်ထားရုံသာမက, ဘယ် software/version run နေလဲ ခန့်မှန်းပေးပါတယ် (ဥပမာ - Apache 2.4.29) — version သိမှသာ 'ဒီ version မှာ known vulnerability ရှိလား' ဆိုတာ ရှာနိုင်ပါတယ်။ OS Detection (`-O`) ကတော့ target ရဲ့ operating system ကို TCP/IP stack behavior ကနေ ခန့်မှန်းပေးပါတယ်.

လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်

`nmap -sV -O 192.168.56.101` run ရင် — port list ရော, Apache/MySQL version ရော, target OS (Linux kernel version) ရောကို တစ်ပြိုင်နက် ရနိုင်ပါတယ် — version number (ဥပမာ - vsftpd 2.3.4) ကို public vulnerability database (CVE, Exploit-DB) မှာ ရှာကြည့်ရင် known vulnerability ရှိမရှိ သိနိုင်ပါတယ် (Metasploitable ရဲ့ vsftpd 2.3.4 က famous backdoor vulnerability ရှိတာနဲ့ ကျော်ကြားပါတယ်, CTF practice အတွက် intentionally ထားထားတာပါ).

အတူတူ ကြည့်မယ်

bash
# SYN scan with version detection and OS detection
nmap -sS -sV -O 192.168.56.101

# Scan all 65535 ports (not just the common 1000)
nmap -p- 192.168.56.101

# Save output to a file for later reference
nmap -sV -oN scan-results.txt 192.168.56.101
You should see
PORT   STATE SERVICE VERSION
21/tcp open  ftp     vsftpd 2.3.4
OS details: Linux 2.6.9 - 2.6.33

၅ မိနစ် စမ်းကြည့်

Lab VM ကို `nmap -sV -O` ဖြင့် scan ကြည့်ပြီး, ရလာတဲ့ service version (ဥပမာ - vsftpd) ကို Google/CVE database မှာ ရှာကြည့်ပါ — known vulnerability ရှိမရှိ confirm လုပ်ကြည့်ပါ (research ရုံသာ, exploit မလုပ်ပါနှင့်)။

သတိလေးတစ်ချက်

SYN scan (`-sS`) ကို root/administrator permission မရှိဘဲ run ရင် Nmap က automatic ဖြစ်ဖြစ် connect scan (`-sT`) ဆီ fallback လုပ်ပါလိမ့်မယ် — result ကွာနိုင်ကြောင်း သတိထားပါ။

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • `-p-` (all port scan) ကို production system ပေါ်မှာ authorization မရှိဘဲ run ခြင်း — scan time ကြာပြီး network traffic များစေတတ်ပါတယ်
  • Version detection result ကို 100% correct လို့ blindly ယုံကြည်ခြင်း — banner grabbing ကို admin တွေက intentionally spoof/hide ထားနိုင်ပါတယ် (version obscure လုပ်ခြင်း)

အခု ကိုယ်တိုင် စမ်းကြည့်

Lab VM ကို `nmap -sV -O` ဖြင့် scan ကြည့်ပြီး, ရလာတဲ့ service version (ဥပမာ - vsftpd) ကို Google/CVE database မှာ ရှာကြည့်ပါ — known vulnerability ရှိမရှိ confirm လုပ်ကြည့်ပါ (research ရုံသာ, exploit မလုပ်ပါနှင့်)။

You'll know it worked when: PORT STATE SERVICE VERSION 21/tcp open ftp vsftpd 2.3.4 OS details: Linux 2.6.9 - 2.6.33

Nmap Deep Dive (Scan Types, Version Detection) | Thuta Learning