DNSGen 是一款功能强大且灵活的 DNS 名称排列工具,专为安全研究人员和渗透测试人员设计。它会生成智能的域名变体,以辅助子域发现和安全评估。

# Using pip
python -m pip install dnsgen
# Using uv (recommended for development)
git clone https://github.com/AlephNullSK/dnsgen
cd dnsgen/
python -m pip install uv
uv sync
# Basic domain permutation
dnsgen domains.txt
# With custom wordlist and output file
dnsgen -w custom_wordlist.txt -o results.txt domains.txt
# Using fast mode for quick assessment
dnsgen -f domains.txt
# Pipe with massdns for resolution
cat domains.txt | dnsgen - | massdns -r resolvers.txt -t A -o J --flush 2>/dev/null
DNSGen 2.0 实现了多种复杂的排列技术:
单词插入
api.example.com → staging.api.example.com数字操作
api2.example.com → api1.example.com、api3.example.com单词附加
api.example.com → devapi.example.com、api-dev.example.com云提供商模式
example.com → api-aws.example.com、storage-azure.example.com区域前缀
api.example.com → us-east.api.example.com微服务模式
example.com → auth-service.example.com、user-api.example.com内部工具
example.com → jenkins.internal.example.com端口前缀
api.example.com → 8080.api.example.comdnsgen [OPTIONS] FILENAME
Options:
-l, --wordlen INTEGER Min length of custom words (default: 6)
-w, --wordlist PATH Path to custom wordlist
-f, --fast Fast generation mode
-o, --output PATH Output file path
-v, --verbose Enable verbose logging
--help Show this message and exit
DNSGen 2.0 支持带注释的字典,以便更好地组织:
# Environment Names
dev
staging
prod
# Cloud Providers
aws
azure
gcp
# Tools and Services
jenkins
gitlab
grafana
获取干净解析后的域名:
# Generate and resolve
dnsgen hosts.txt > wordlist.txt
massdns -r resolvers.txt -o S wordlist.txt | grep -e ' A ' | \
cut -d 'A' -f 1 | rev | cut -d "." -f1 --complement | \
rev | sort | uniq > resolved_domains.txt
欢迎贡献!以下是您可以提供帮助的方式:
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-feature更多详情请参阅 CONTRIBUTING.md。
本项目基于 MIT 许可证授权 — 详情请参阅 LICENSE 文件。
由安全社区用 ❤️ 制作