8.2.3 Vulnerability Discovery
Vulnerability discovery adalah fase ketiga dalam scanning - mengidentifikasi kerentanan spesifik pada layanan dan aplikasi yang ditemukan selama service enumeration. Fase ini menjembatani antara "apa yang berjalan?" (port scanning + service enumeration) dengan "bagaimana mengeksploitasinya?" (exploitation). Hasil vulnerability discovery adalah daftar CVE, CWE, dan skor CVSS yang menjadi dasar prioritas serangan.
Pendekatan Vulnerability Discovery
Ada tiga pendekatan utama yang digunakan bersama:
- Automated Scanning - Menggunakan scanner kerentanan seperti Nessus, OpenVAS, atau Qualys
- Targeted Scanning - Scanner spesifik aplikasi web (Nikto, WPScan, Nuclei)
- Manual Verification - Validasi manual hasil scan menggunakan NSE vuln scripts dan teknik khusus
Memahami CVE, CWE, dan CVSS
Sebelum menggunakan tools, penting memahami sistem klasifikasi kerentanan.
CVE (Common Vulnerabilities and Exposures)
Format standar untuk mengidentifikasi kerentanan publik:
CVE-TAHUN-NOMOR.
Contoh:
CVE-2021-41773 - Apache HTTP Server path traversal
CVE-2021-44228 - Apache Log4j RCE (Log4Shell)
CVE-2023-44487 - HTTP/2 Rapid Reset Attack
CVE-2024-3094 - XZ Utils backdoor (liblzma)
Setiap CVE memiliki deskripsi, referensi, dan terkadang PoC exploit code di database seperti:
- MITRE CVE: https://cve.mitre.org/
- NVD (NIST): https://nvd.nist.gov/
- Exploit-DB: https://www.exploit-db.com/
CVSS (Common Vulnerability Scoring System)
Skor numerik 0.0 - 10.0 untuk menilai tingkat keparahan kerentanan.
| Skor CVSS | Tingkat | Contoh |
|---|---|---|
| 0.0 | None | - |
| 0.1 - 3.9 | Low | Info disclosure minor |
| 4.0 - 6.9 | Medium | DoS, XSS reflected |
| 7.0 - 8.9 | High | SQL Injection, RCE dengan prasyarat |
| 9.0 - 10.0 | Critical | RCE tanpa autentikasi (Log4Shell, EternalBlue) |
Vektor CVSS:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- AV (Attack Vector): N=Network, A=Adjacent, L=Local, P=Physical
- AC (Attack Complexity): L=Low, H=High
- PR (Privileges Required): N=None, L=Low, H=High
- UI (User Interaction): N=None, R=Required
- S (Scope): U=Unchanged, C=Changed
- C/I/A (Confidentiality/Integrity/Availability): H=High, L=Low, N=None
CWE (Common Weakness Enumeration)
Klasifikasi jenis kelemahan - parent category dari CVE.
CWE-79: Cross-Site Scripting (XSS)
CWE-89: SQL Injection
CWE-200: Information Exposure (information disclosure)
CWE-287: Improper Authentication
CWE-434: Unrestricted File Upload
CWE-787: Out-of-bounds Write (buffer overflow)
Tenable Nessus - Scanner Komersial Standar Industri
Nessus adalah vulnerability scanner komersial paling populer. Versi gratis (Nessus Essentials) terbatas hingga 16 IP.
Instalasi
# Download dari portal Tenable (butuh registrasi)
wget https://www.tenable.com/downloads/api/v1/public/pages/nessus/downloads/.../Nessus-10.7.3-ubuntu1404_amd64.deb
sudo dpkg -i Nessus-10.7.3-ubuntu1404_amd64.deb
sudo systemctl start nessusd
# Akses via https://localhost:8834
Workflow Nessus
1. Discover → scan network range
2. Enumerate → Nessus mendeteksi port, layanan, dan OS
3. Assess → mencocokkan versi layanan dengan database CVE
4. Report → menghasilkan laporan dengan CVSS, remediasi, referensi
Jenis Scan di Nessus
- Basic Network Scan: Scan kerentanan umum
- Advanced Scan: Konfigurasi kustom penuh
- Web Application Test: Scan kerentanan web
- Malware Scan: Deteksi malware dan backdoor
- Credentialed Patch Audit: Scan menggunakan kredensial untuk audit patch
- Compliance Scan: Compliance checklist (CIS, PCI-DSS, HIPAA)
Kelebihan dan Kekurangan Nessus
| Kelebihan | Kekurangan |
|---|---|
| Database kerentanan sangat besar | Berbayar (kecuali Essentials) |
| False positive relatif rendah | Berat di resource (memory + CPU) |
| Laporan yang sangat detail | Waktu scan lama untuk network besar |
| API untuk otomatisasi | Upgrade berbayar untuk full features |
| Compliance scanning built-in | Antarmuka web - kurang CLI-friendly |
OpenVAS (Greenbone Vulnerability Management)
OpenVAS adalah alternatif open-source Nessus. Sekarang dikelola oleh Greenbone Networks sebagai Greenbone Vulnerability Manager (GVM).
Instalasi
# Debian/Ubuntu
sudo apt install openvas
sudo gvm-setup
sudo gvm-start
# Atau via Docker
docker pull greenbone/gvm
docker run -d -p 9392:9392 greenbone/gvm
Komponen OpenVAS
| Komponen | Fungsi |
|---|---|
| Greenbone Security Assistant (GSA) | Antarmuka web (port 9392) |
| OpenVAS Scanner | Mesin scanning kerentanan |
| Greenbone Vulnerability Manager (GVM) | Manajemen konfigurasi dan task |
| NVTs (Network Vulnerability Tests) | Database tes - diperbarui setiap hari |
| Greenbone Feed | Feed NVT + SCAP + CERT + data lainnya |
Penggunaan Dasar
# CLI dengan gvm-cli
gvm-cli --gmp-username admin --gmp-password pass socket --xml "<create_task>..."
# Atau via Greenbone CLI
gvm-cli socket --xml '<get_tasks/>'
OpenVAS memiliki lebih dari 100.000 NVTs dan diperbarui melalui feed harian - menjadikannya basis data kerentanan open-source paling komprehensif.
Nikto - Web Server Scanner
Nikto adalah scanner open-source yang fokus pada web server - mendeteksi file berbahaya, konfigurasi salah, dan kerentanan server.
Instalasi
sudo apt install nikto
# Atau dari GitHub
git clone https://github.com/sullo/nikto.git
cd nikto/program
perl nikto.pl
Penggunaan
# Scan dasar
nikto -h http://target.com
# Scan dengan port non-standar
nikto -h http://target.com -p 8080
# Scan dengan SSL
nikto -h https://target.com -ssl
# Output ke file
nikto -h http://target.com -o nikto-report.html -Format HTML
# Verbose - lihat semua tes
nikto -h target.com -Display V
# Menggunakan database mutasi
nikto -h target.com -mutate 1 # File guessing
nikto -h target.com -mutate 2 # Username guessing
nikto -h target.com -mutate 3 # Directory brute force
Apa yang Dideteksi Nikto
- File konfigurasi sensitif: /config.php, /phpinfo.php, /test.cgi
- Default credentials: admin:admin, root:toor
- CGI vulnerabilities: cgid, test-cgi
- Server misconfiguration: Directory listing enabled, default certificates
- CVE spesifik: Apache, Nginx, IIS vulnerabilities
- Insecure HTTP methods: PUT, DELETE, TRACE enabled
Kelebihan dan Kekurangan Nikto
| Kelebihan | Kekurangan |
|---|---|
| Sangat cepat | Hanya web server - tidak mencakup layanan lain |
| Database signature besar | Tidak mendeteksi kerentanan aplikasi dalam (business logic) |
| Output HTML/XLS/XML | False positive cukup tinggi |
| Update via CVS (dulu) | Tidak diperbarui seaktif dulu |
WPScan - WordPress Vulnerability Scanner
WPScan adalah scanner keamanan khusus WordPress - tools wajib jika target menggunakan CMS WordPress.
Instalasi
# Melalui gem
gem install wpscan
# Melalui Docker
docker pull wpscanteam/wpscan
# Atau di Kali Linux (sudah pre-installed)
wpscan --help
Penggunaan
# Scan dasar
wpscan --url http://target.com
# Enumerasi pengguna
wpscan --url http://target.com --enumerate u
# Enumerasi plugin yang terinstal
wpscan --url http://target.com --enumerate p
# Enumerasi tema
wpscan --url http://target.com --enumerate t
# Enumerasi semuanya
wpscan --url http://target.com --enumerate vp,vt,u
# Aggressive detection
wpscan --url http://target.com --plugins-detection aggressive
# API token untuk mendapatkan data CVE langsung
wpscan --url http://target.com --api-token YOUR_TOKEN
# Brute force login
wpscan --url http://target.com --passwords wordlist.txt --usernames admin
Informasi yang Didapat dari WPScan
- Versi WordPress: 6.2 → CVE tertentu untuk versi tersebut
- Plugin dan versi: Jetpack 12.1, WooCommerce 7.5 → cari CVE plugin
- Tema aktif: Twenty Twenty-Three, dengan versi
- User enumeration: Daftar username admin, editor, subscriber
- Kerentanan: CVE spesifik yang diketahui untuk komponen WordPress
- Password brute force: Testing weak credentials
Nuclei - Fast Vulnerability Scanner Berbasis Template
Nuclei dari ProjectDiscovery adalah scanner modern berbasis YAML template - sangat cepat, extensible, dan memiliki ribuan template.
Instalasi
# Binary release
wget https://github.com/projectdiscovery/nuclei/releases/latest/download/nuclei_linux_amd64.zip
unzip nuclei_linux_amd64.zip
sudo mv nuclei /usr/local/bin/
# Atau via Go
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
Penggunaan
# Update template
nuclei -update-templates
# Scan target
nuclei -u https://target.com
# Scan dengan template kategori tertentu
nuclei -u https://target.com -t cves/ # Template CVE saja
nuclei -u https://target.com -t exposures/ # Information exposure
nuclei -u https://target.com -t misconfig/ # Misconfiguration
# Scan dari list host
nuclei -l hosts.txt
# Output JSON
nuclei -u https://target.com -o results.json -json
Nmap NSE untuk Vulnerability Discovery
Nmap Scripting Engine memiliki kategori vuln yang berisi
skrip untuk mendeteksi kerentanan spesifik.
# Jalankan semua skrip kerentanan
nmap --script vuln target.com
# Skrip spesifik
nmap --script http-vuln-cve2021-41773 target.com # Apache path traversal
nmap --script smb-vuln-ms17-010 target.com # EternalBlue (WannaCry)
nmap --script http-sql-injection target.com # SQL Injection scan
nmap --script http-xssed target.com # XSS detection
nmap --script ssl-heartbleed target.com # Heartbleed (CVE-2014-0160)
nmap --script http-shellshock target.com # Shellshock (CVE-2014-6271)
nmap --script http-vuln-cve2017-5638 target.com # Apache Struts2 (Equifax)
Catatan penting: Beberapa NSE vuln scripts bersifat intrusive dan bisa mengganggu layanan produksi. Gunakan dengan hati-hati dan hanya pada target yang sudah mendapat izin.
Searchsploit - Database Exploit Lokal
Searchsploit adalah replika offline Exploit-DB - mencari PoC exploit untuk kerentanan yang ditemukan.
# Instalasi (Kali sudah pre-install)
sudo apt install exploitdb
# Gunakan
searchsploit apache 2.4.49
searchsploit wordpress 6.2
searchsploit openssh 8.9
# Hasil dengan URL (Exploit-DB)
searchsploit -w openssh
# Copy exploit ke direktori kerja
searchsploit -m exploits/linux/remote/12345.py
Metodologi Vulnerability Discovery
Langkah 1 - Automated Scan (Pendahuluan)
# OpenVAS atau Nessus scan full network
# Sambil menunggu, lakukan:
nmap --script vuln -p 22,80,443 target.com
Langkah 2 - Web Application Scan
# Nikto untuk web server
nikto -h http://target.com -o web-scan.html
# WPScan jika WordPress
wpscan --url http://target.com --enumerate vp,vt,u
# Nuclei untuk CVE terbaru
nuclei -u http://target.com -t cves/
Langkah 3 - Targeted Scan per Layanan
# SMB
nmap --script smb-vuln* -p 445 target.com
# SSL/TLS
nmap --script ssl-enum-ciphers -p 443 target.com
# Database
nmap --script mysql-audit -p 3306 target.com
nmap --script redis-info -p 6379 target.com
# RDP
nmap --script rdp-vuln-ms12-020 -p 3389 target.com
Langkah 4 - Cross-Reference CVE
# Cari CVE di Exploit-DB
searchsploit apache 2.4.49
# Cek CVSS Score
# https://nvd.nist.gov/
Langkah 5 - Validasi Manual
Jangan percaya hasil scannner 100% - selalu validasi:
# Jika scanner bilang ada SQL injection di /product.php?id=1
# Test manual:
curl "http://target.com/product.php?id=1'"
curl "http://target.com/product.php?id=1 AND 1=1"
curl "http://target.com/product.php?id=1 AND 1=2"
# Jika scanner bilang ada path traversal di Apache
# Test manual:
curl "http://target.com/cgi-bin/.%2e/%2e%2e/etc/passwd"
Dokumentasi Temuan
Setiap kerentanan yang ditemukan harus didokumentasikan dengan:
[VULN-01] Apache HTTP Server Path Traversal
---------------------------------------------------
CVE : CVE-2021-41773
CVSS : 7.5 (High)
CWE : CWE-22 (Path Traversal)
Layanan : Apache HTTP Server 2.4.49
Port : 80/tcp
Bukti : GET /cgi-bin/.%2e/%2e%2e/etc/passwd → 200 OK
Remediasi : Upgrade ke Apache 2.4.51+
Referensi : https://nvd.nist.gov/vuln/detail/CVE-2021-41773
Checklist Vulnerability Discovery
- Automated scan dengan Nessus atau OpenVAS (full network)
- Web server scan dengan Nikto
- CMS scan dengan WPScan (jika WordPress)
- Nuclei scan untuk CVE terbaru
- NSE vuln scan pada semua port terbuka
- Cross-reference versi layanan dengan Exploit-DB
- Validasi manual hasil scan
- Dokumentasi temuan dengan CVE, CVSS, CWE
- Prioritas exploitasi berdasarkan CVSS score
- Verifikasi false positive sebelum exploitation phase
Referensi
- NVD (NIST): https://nvd.nist.gov/
- MITRE CVE: https://cve.mitre.org/
- Exploit-DB: https://www.exploit-db.com/
- OpenVAS / Greenbone: https://www.greenbone.net/
- Nessus: https://www.tenable.com/products/nessus
- Nikto: https://github.com/sullo/nikto
- WPScan: https://wpscan.com/
- Nuclei: https://github.com/projectdiscovery/nuclei
- CVSS Calculator: https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator