0xdfxyz
  • Penetration Testing Process
    • README.md
    • Whois
  • Nikto
  • Search Engine Discovery
  • FinalRecon
  • Nessus
  • 0_新手上路
    • 0_新手上路
  • 1_訊息收集
    • 服務枚舉
      • Page 6
      • Nmap
      • DNS
    • 應用枚舉
      • Page 6
    • A D枚舉
      • Page 6
    • web枚舉
      • Page 6
      • Web Fuzzing
      • Subdomain
  • 2_漏洞前準備
    • 反彈 Shell
    • 工具彙總
    • 字典生成
  • 3_漏洞利用
    • 應用漏洞利用
    • AD 攻擊
    • 二進位漏洞利用
    • Web漏洞利用
      • XSS
      • IDOR
      • Webshel​​l
      • File uploads
      • SSTI
      • LFI
      • SQL injection
      • XXE
      • HTTP Verb Tampering
      • Command Injection
    • 服務漏洞利用
      • CMS
        • Wordpress
        • Joolmla
        • Drupal
      • Servlet 容器/軟體開發
        • Jenkins
        • Tomcat
      • 基礎設施/網路監控工具
        • Splunk
        • PRTG Network Monitor
      • 客戶服務管理與配置管理
        • osTicket
        • Gitlab
      • 通用網關介面
        • 攻擊通用網關介面 (CGI) 應用程式 - Shellshock
      • 其他應用
        • ColdFusion
        • IIS Tilde
        • LDAP
      • 常見應用程式
        • Thick client(也稱為rich客戶端或fat客戶端
        • Web 批量分配漏洞 ( Ruby on Rails)
        • 攻擊連接到服務的應用程式(SSH)
  • 4_滲透
    • Linux 權限提升
    • Windows 權限提升
    • Windows + Linux 工具
  • 5_橫向移動
    • 工具
    • 跳板 Pivoting
    • AD 橫向移動
    • Linux 橫向移動
    • Windows 橫向移動
  • 6_NetExec
    • 常見模組
    • 命令執行
    • 漏洞掃描模組
    • 模組使用
    • 憑證轉儲
    • Kerberos 認證
    • LDAP RDP 枚舉
    • SMB 枚舉
由 GitBook 提供支持
在本页
  • 1️⃣ 找到 subdomains-top1million-110000.txt
  • 2️⃣ 使用 dnsenum 進行 DNS 枚舉
  • 3️⃣ 使用 Gobuster 搜索虛擬主機 (VHOST)
  • 4️⃣ 使用 crt.sh 查詢 SSL/TLS 証書中的子域名

这有帮助吗?

  1. 1_訊息收集
  2. web枚舉

Subdomain

1️⃣ 找到 subdomains-top1million-110000.txt

list=$(sudo find / -iname subdomains-top1million-110000.txt 2>/dev/null)

📌 說明:

  • 使用 find 命令在整個系統 (/) 搜索 subdomains-top1million-110000.txt 文件

  • 2>/dev/null:避免錯誤訊息顯示


2️⃣ 使用 dnsenum 進行 DNS 枚舉

dnsenum --enum inlanefreight.com -f $list -r

📌 說明:

  • --enum:開啟所有可能的 DNS 枚舉方式

  • -f $list:提供子域名字典 (subdomains-top1million-110000.txt)

  • -r:執行反向查找 (Reverse Lookup)


3️⃣ 使用 Gobuster 搜索虛擬主機 (VHOST)

gobuster vhost -u http://inlanefreight.htb:81 -w $list --append-domain

📌 說明:

  • vhost:暴力破解虛擬主機 (VHOST)

  • -u:指定目標網址 (http://inlanefreight.htb:81)

  • -w $list:使用 subdomains-top1million-110000.txt 進行爆破

  • --append-domain:自動在字典中每個子域名後面追加 inlanefreight.htb

在發現了子域名後,為了方便存取,可以將它們添加到 /etc/hosts 文件中。這

- 手動編輯 /etc/hosts

sudo vim /etc/hosts

📌 在文件底部添加:

10.129.201.50  sub1.inlanefreight.com
10.129.201.50  sub2.inlanefreight.com
10.129.201.50  sub3.inlanefreight.com

✅ :wq


- 測試解析

ping -c 3 sub1.inlanefreight.com

如果成功解析,說明 /etc/hosts 配置成功!🎯 🚀


4️⃣ 使用 crt.sh 查詢 SSL/TLS 証書中的子域名

curl -s "https://crt.sh/?q=/example.com&output=json" | jq -r '.[].name_value' | sort -u | while read -r domain; do 
    status_code=$(curl -o /dev/null -s -w "%{http_code}" "https://$domain")
    if [[ "$status_code" -eq 200 ]]; then 
        echo -e "\e[32m$domain - response: $status_code\e[0m"
    elif [[ "$status_code" -eq 400 ]] || [[ "$status_code" -eq 000 ]]; then 
        echo "$domain - response: $status_code"
    else 
        echo -e "\e[33m$domain - response: $status_code\e[0m"
    fi
done

📌 說明:

  1. curl -s "https://crt.sh/?q=/example.com&output=json" 🔹 查詢 crt.sh,獲取 example.com 的所有 SSL/TLS 証書子域名

  2. jq -r '.[].name_value' | sort -u 🔹 使用 jq 解析 JSON,提取所有 name_value,並去重

  3. while read -r domain; do ... done 🔹 遍歷每個子域名,使用 curl 測試 HTTP 回應狀態碼

  4. 根據 HTTP Code 分類輸出:

    • 🟢 200 (成功響應) ✅

    • 🟠 其他狀態碼 ⚠️

    • 🔴 400/000 (無效) ❌


🔗 5️⃣ 進一步攻擊思路

✅ 找到有效的子域名後,可以嘗試:

  • 使用 nmap 掃描端口:

    nmap -p- -sV -sC inlanefreight.com
  • 使用 ffuf 尋找隱藏目錄:

    ffuf -u https://inlanefreight.com/FUZZ -w /usr/share/wordlists/dirb/common.txt
  • 嘗試 子域接管 (Subdomain Takeover):

    host subdomain.inlanefreight.com
上一页Web Fuzzing下一页反彈 Shell

最后更新于2个月前

这有帮助吗?