xiaomingx/subhunter/prompt

Claude Code and agent skill by xiaomingx/subhunter

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Install

npx vskill@latest install xiaomingx/subhunter/prompt

SKILL.md

Skill: 异步子域名探测实现

1. 环境初始化 (Using uv)

使用 uv 快速搭建高性能开发环境:

bash
uv init subdomain_scanner
cd subdomain_scanner
uv add dnspython httpx aiohttp

2. 核心代码骨架 (Python 3.11)

python
"""
Function: Subdomain Scanner Core
Business Problem: 高效探测企业子域名资产,识别潜在的安全暴露面,支持大规模并发检测与通配符过滤。
"""
import asyncio
import dns.asyncresolver
import httpx
from typing import List, Set
class SubdomainScanner:
def __init__(self, domain: str, limit: int = 100):
self.domain = domain
self.semaphore = asyncio.Semaphore(limit)
self.results = []
self.resolver = dns.asyncresolver.Resolver()
self.resolver.nameservers = ['8.8.8.8', '1.1.1.1']
async def check_dns(self, sub: str) -> str:
"""执行异步 DNS A记录查询"""
target = f"{sub}.{self.domain}"
async with self.semaphore:
try:
answers = await self.resolver.resolve(target, 'A')
return target
except Exception:
return None
async def check_http(self, url: str):
"""执行异步 HTTP 存活性验证"""
async with httpx.AsyncClient(timeout=5.0, follow_redirects=True) as client:
try:
resp = await client.get(f"http://{url}")
if resp.status_code < 400:
self.results.append({"domain": url, "status": resp.status_code, "server": resp.headers.get("Server")})
except Exception:
pass
async def run(self, wordlist: List[str]):
# 1. DNS 爆破阶段
print(f"[*] Starting DNS brute force for {self.domain}...")
dns_tasks = [self.check_dns(sub) for sub in wordlist]
found_domains = await asyncio.gather(*dns_tasks)
active_domains = [d for d in found_domains if d]
# 2. HTTP 验证阶段
print(f"[*] Validating {len(active_domains)} active domains via HTTP...")
http_tasks = [self.check_http(d) for d in active_domains]
await asyncio.gather(*http_tasks)
return self.results
async def main():
scanner = SubdomainScanner("jd.com", limit=200)
# 示例字典
words = ["m", "list", "re", "passport", "pay", "v-api"]
results = await scanner.run(words)
print(f"[+] Found {len(results)} live subdomains.")
for r in results:
print(f" - {r['domain']} [{r['status']}]")
if __name__ == "__main__":
asyncio.run(main())

3. 高级技巧:处理泛解析

在执行探测前,先查询一个随机生成的子域名(如 rand-12345.jd.com)。如果能解析成功,说明存在泛解析,需要记录其 IP 并在后续结果中排除这些重复 IP。

4. 性能优化建议

  • Resolver 池: 使用多个公共 DNS(Google, Cloudflare, OpenDNS)轮询,防止单一 DNS 服务器触发频率限制。
  • 内存优化: 不要一次性将整个大字典(如几百万行)读入内存,应使用迭代器。

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/xiaomingx/subhunter/prompt/badge)](https://verified-skill.com/skills/xiaomingx/subhunter/prompt)

Something wrong with this skill or its page? Tell us.