iT邦幫忙

2025 iThome 鐵人賽

DAY 10
0

當我們完成路徑掃描後,下一步就是檢測這些發現的網頁服務是否存在安全漏洞。今天要介紹幾個強大的網頁漏洞掃描工具!

Nikto

經典的網頁伺服器掃描工具,專門檢測常見的網頁安全問題。

基本用法:

# 基本掃描
nikto -h http://target.com

# 掃描特定端口
nikto -h http://target.com -p 80,443,8080

# 輸出結果到檔案
nikto -h http://target.com -o scan_results.html -Format html

檢測項目:

  • 過期的軟體版本
  • 危險的檔案和程式
  • 伺服器設定問題
  • 預設帳號和密碼

OWASP ZAP (Zed Attack Proxy)

OWASP 開發的開源網頁安全測試工具,功能全面且持續更新。

主要功能:

  • 自動化掃描
  • 手動滲透測試
  • 被動式掃描
  • API 測試

基本操作:

# 啟動 ZAP
zap.sh -daemon -port 8080 -config api.disablekey=true

# 命令列快速掃描
zap-baseline.py -t http://target.com

Nuclei

現代化的漏洞掃描器,使用 YAML 模板進行快速檢測。

基本用法:

# 安裝 nuclei
go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest

# 基本掃描
nuclei -u http://target.com

# 使用特定模板
nuclei -u http://target.com -t cves/

# 批量掃描
nuclei -l targets.txt -o results.txt

模板類別:

  • CVE 漏洞檢測
  • 技術檢測
  • 暴露檢測
  • 誤配置檢測

Burp Suite

專業級網頁應用程式安全測試平台,包含多種測試工具。

核心功能:

  • Proxy: 攔截和修改 HTTP 請求
  • Scanner: 自動化漏洞掃描
  • Intruder: 暴力破解工具
  • Repeater: 重送和修改請求

使用流程:

  1. 設定瀏覽器代理到 Burp (預設 127.0.0.1:8080)
  2. 瀏覽目標網站建立站點地圖
  3. 啟動自動掃描或手動測試

SQLmap

專門檢測 SQL 注入漏洞的強大工具。

基本用法:

# 檢測 GET 參數
sqlmap -u "http://target.com/page.php?id=1"

# 檢測 POST 資料
sqlmap -u "http://target.com/login.php" --data="username=admin&password=test"

# 使用 cookie
sqlmap -u "http://target.com/page.php" --cookie="PHPSESSID=abc123"

# 檢測並嘗試取得資料庫內容
sqlmap -u "http://target.com/page.php?id=1" --dbs --tables --dump

Wapiti

Python 編寫的網頁應用程式漏洞掃描器,檢測多種攻擊向量。

基本用法:

# 基本掃描
wapiti -u http://target.com

# 設定模組
wapiti -u http://target.com -m sql,xss,file

# 設定輸出格式
wapiti -u http://target.com -f html -o /path/to/report

常見漏洞類型

OWASP Top 10 常見漏洞:

  1. 注入攻擊 (SQL, NoSQL, OS 命令)
  2. 身份驗證破解
  3. 敏感資料暴露
  4. XML 外部實體 (XXE)
  5. 存取控制破解
  6. 安全設定錯誤
  7. 跨站腳本攻擊 (XSS)
  8. 不安全的反序列化
  9. 使用有已知漏洞的元件
  10. 日誌記錄和監控不足

掃描策略建議

1. 分階段掃描

# 第一階段:快速概覽
nuclei -u http://target.com -t technologies/

# 第二階段:深度掃描
nikto -h http://target.com
zap-baseline.py -t http://target.com

# 第三階段:特定漏洞測試
sqlmap -u "http://target.com/page.php?id=1"

2. 結合多種工具

  • 使用 Nuclei 快速檢測已知漏洞
  • 用 Burp Suite 進行深度手動測試
  • 針對發現的參數使用 SQLmap

3. 設定合適的掃描參數

# 避免過於激進的掃描
nuclei -u http://target.com -rate-limit 10
nikto -h http://target.com -Tuning 1,2,3

結果分析與報告

優先處理高風險漏洞:

  • SQL 注入
  • 跨站腳本攻擊 (XSS)
  • 檔案上傳漏洞
  • 認證繞過

產生專業報告:

# Nuclei 產生詳細報告
nuclei -u http://target.com -json-export results.json

# ZAP 產生 HTML 報告
zap-cli report -o security_report.html -f html

重要提醒

⚠️ 進行漏洞掃描前必須注意:

  • 確保擁有合法的測試授權
  • 避免影響生產環境服務
  • 遵守相關法律法規和道德準則
  • 掃描完成後應負責任地報告漏洞

上一篇
[Day 9] 掃掃掃,路徑旅人
系列文
帶著筆電勇闖從零開始的滲透測試異世界10
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言