Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
API-dnsdumpster.com — 用于 dnsdumpster.com 的 Python 客户端,可检索 DNS 记录、子域名和网络映射,用于侦察与安全研究。 | Kitploit
工具/GitHubGitHub/paulsec/api-dnsdumpster.com
OSINT (开源情报)侦察信息收集网络安全渗透测试子域名枚举DNS 分析
GitHubpaulsec/api-dnsdumpster.com

API-dnsdumpster.com

用于 dnsdumpster.com 的 Python 客户端,可检索 DNS 记录、子域名和网络映射,用于侦察与安全研究。

查看仓库
2838675个月前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

DNSDumpster API(非官方)

Tests PyPI version Python Versions License

⚠️ 重要声明:这是一个非官方的 dnsdumpster.com API 封装库,通过抓取公共网站实现。

DNSDumpster.com 提供官方 API 套餐,适用于商业及高频使用场景。如果您需要可靠的生产级访问,请考虑其官方 API:https://dnsdumpster.com/

此非官方封装库应负责任地使用,并遵守 DNSDumpster 的服务条款。

概述

一个用于与 dnsdumpster.com 交互以获取 DNS 记录和子域信息的 Python 客户端库。该工具适用于安全研究人员、渗透测试人员和网络管理员进行信息收集。

功能特性

  • 🔍 获取域名的 A、MX、NS 和 TXT 记录
  • 🌐 提取子域信息
  • 🗺️ 下载网络拓扑图
  • 📊 将结果导出为 Excel 格式
  • 🎯 简洁、带类型提示的 API
  • ✅ 全面的测试覆盖
  • 📝 完全向后兼容

安装

通过 PyPI 安装(推荐)

root@kitploit:~
pip install dnsdumpster

通过 GitHub 安装

root@kitploit:~
pip install git+https://github.com/PaulSec/API-dnsdumpster.com.git

从源码安装(开发模式)

root@kitploit:~
# 克隆仓库
git clone https://github.com/PaulSec/API-dnsdumpster.com
cd API-dnsdumpster.com

# 以开发模式安装
pip install -e .

# 安装开发依赖
pip install -r requirements-dev.txt

快速开始

root@kitploit:~
from dnsdumpster.DNSDumpsterAPI import DNSDumpsterAPI

# 初始化 API
api = DNSDumpsterAPI(verbose=True)

# 搜索域名
results = api.search('example.com')

# 访问结果
print(f"域名: {results['domain']}")
print(f"DNS 记录: {results['dns_records']['dns']}")
print(f"MX 记录: {results['dns_records']['mx']}")
print(f"NS 记录: {results['dns_records']['ns']}")
print(f"TXT 记录: {results['dns_records']['txt']}")

使用示例

基本域名查询

root@kitploit:~
from dnsdumpster.DNSDumpsterAPI import DNSDumpsterAPI

api = DNSDumpsterAPI()
results = api.search('microsoft.com')

# 打印所有 A 记录(子域)
for record in results['dns_records']['dns']:
    print(f"{record['host']} - {record['ip']} - {record['country']}")

保存网络拓扑图

root@kitploit:~
import base64

results = api.search('example.com')

if results['image_data']:
    with open('network_map.png', 'wb') as f:
        f.write(base64.b64decode(results['image_data']))
    print(f"网络拓扑图已保存!URL: {results['image_url']}")

导出为 Excel

root@kitploit:~
import base64

results = api.search('example.com')

if results['xls_data']:
    with open('results.xlsx', 'wb') as f:
        f.write(base64.b64decode(results['xls_data']))
    print("Excel 文件已保存!")

使用自定义会话

root@kitploit:~
import requests
from dnsdumpster.DNSDumpsterAPI import DNSDumpsterAPI

# 创建带代理的自定义会话
session = requests.Session()
session.proxies = {
    'http': 'http://proxy.example.com:8080',
    'https': 'https://proxy.example.com:8080',
}

api = DNSDumpsterAPI(session=session)
results = api.search('example.com')

错误处理

root@kitploit:~
from dnsdumpster.DNSDumpsterAPI import (
    DNSDumpsterAPI,
    DNSDumpsterAPIError,
    DNSDumpsterRequestError,
    DNSDumpsterParseError
)

api = DNSDumpsterAPI()

try:
    results = api.search('example.com')
except DNSDumpsterRequestError as e:
    print(f"网络错误: {e}")
except DNSDumpsterParseError as e:
    print(f"解析错误: {e}")
except DNSDumpsterAPIError as e:
    print(f"API 错误: {e}")

API 响应结构

search() 方法返回一个字典,结构如下:

root@kitploit:~
{
    'domain': 'example.com',
    'dns_records': {
        'dns': [  # A 记录(子域)
            {
                'host': 'subdomain.example.com',
                'ip': '192.0.2.1',
                'reverse_dns': 'reverse.dns.com',
                'asn': 'ASN:12345',
                'asn_name': 'Provider Name',
                'country': 'United States',
                'subnet': '192.0.2.0/24',
                'open_services': '80, 443',
                # 向后兼容键:
                'domain': 'subdomain.example.com',
                'as': 'ASN:12345',
                'provider': 'Provider Name'
            }
        ],
        'mx': [  # MX 记录
            {
                'priority': '10',
                'server': 'mail.example.com',
                'ip': '198.51.100.1',
                'reverse_dns': 'mail.reverse.com',
                'asn': 'ASN:23456',
                'asn_name': 'Mail Provider',
                'country': 'Germany',
                'subnet': '198.51.100.0/24'
            }
        ],
        'ns': [  # NS 记录
            {
                'nameserver': 'ns1.example.com',
                'ip': '203.0.113.1',
                'reverse_dns': 'ns1.reverse.com',
                'asn': 'ASN:34567',
                'asn_name': 'DNS Provider',
                'country': 'United Kingdom',
                'subnet': '203.0.113.0/24'
            }
        ],
        'txt': [  # TXT 记录
            'v=spf1 include:_spf.example.com ~all',
            'google-site-verification=abcdef123456'
        ],
        'host': []  # NS 记录的别名(向后兼容)
    },
    'image_data': b'base64_encoded_image_bytes',  # 或 None
    'image_url': 'https://dnsdumpster.com/static/map/example.com.png',
    'xls_data': b'base64_encoded_excel_bytes',  # 或 None
    'xls_url': 'https://dnsdumpster.com/static/xlsx/example-uuid.xlsx'
}

开发

搭建开发环境

root@kitploit:~
# 克隆仓库
git clone https://github.com/PaulSec/API-dnsdumpster.com
cd API-dnsdumpster.com

# 创建虚拟环境
python -m venv venv
source venv/bin/activate  # Windows 系统: venv\Scripts\activate

# 安装依赖
pip install -r requirements.txt
pip install -r requirements-dev.txt

# 安装 pre-commit 钩子(可选)
pip install pre-commit
pre-commit install

运行测试

root@kitploit:~
# 运行所有测试
pytest

# 带覆盖率运行
pytest --cov=dnsdumpster --cov-report=html

# 运行特定测试文件
pytest tests/test_parsing.py

# 带详细输出运行
pytest -v

# 运行特定测试
pytest tests/test_parsing.py::TestRetrieveResults::test_retrieve_results_basic

代码质量

root@kitploit:~
# 使用 black 格式化代码
black dnsdumpster/ tests/

# 排序导入
isort dnsdumpster/ tests/

# 使用 flake8 进行代码检查
flake8 dnsdumpster/ tests/

# 使用 mypy 进行类型检查
mypy dnsdumpster/

# 运行所有质量检查
black dnsdumpster/ tests/ && isort dnsdumpster/ tests/ && flake8 dnsdumpster/ tests/ && mypy dnsdumpster/

项目结构

root@kitploit:~
API-dnsdumpster.com/
├── dnsdumpster/              # 主包
│   ├── __init__.py
│   ├── DNSDumpsterAPI.py    # 主 API 类
│   ├── API_example.py       # 使用示例
│   └── requirements.txt
├── tests/                    # 测试套件
│   ├── __init__.py
│   ├── conftest.py          # Pytest fixtures
│   ├── test_parsing.py      # 单元测试
│   └── test_integration.py  # 集成测试
├── .github/
│   └── workflows/           # CI/CD 工作流
│       ├── tests.yml
│       └── publish.yml
├── requirements.txt         # 生产依赖
├── requirements-dev.txt     # 开发依赖
├── setup.py                 # 包配置
├── README.md
└── LICENSE

贡献

我们欢迎贡献!以下是您可以提供帮助的方式:

报告问题

  • 使用 GitHub Issues 报告错误
  • 包含 Python 版本、操作系统和错误信息
  • 提供最小可复现示例

提交拉取请求

  1. Fork 仓库
  2. 创建功能分支(git checkout -b feature/amazing-feature)
  3. 进行修改
  4. 为新功能添加测试
  5. 确保所有测试通过(pytest)
  6. 运行代码质量检查(black、flake8、mypy)
  7. 提交更改(git commit -m 'Add amazing feature')
  8. 推送到分支(git push origin feature/amazing-feature)
  9. 打开拉取请求

编码规范

  • 遵循 PEP 8 风格指南
  • 为所有函数添加类型提示
  • 为公共方法编写文档字符串
  • 保持向后兼容
  • 保持测试覆盖率在 80% 以上
  • 为新功能更新文档

测试说明

单元测试

测试单个解析方法,无需网络调用:

root@kitploit:~
pytest tests/test_parsing.py -v

集成测试

使用模拟 HTTP 响应测试完整 API 工作流:

root@kitploit:~
pytest tests/test_integration.py -v

覆盖率报告

root@kitploit:~
pytest --cov=dnsdumpster --cov-report=term-missing

CI/CD

该项目使用 GitHub Actions 实现:

  • 测试:在每次推送和 PR 时运行,覆盖 Python 3.8、3.9、3.10、3.11、3.12
  • 代码检查:使用 flake8 和 mypy 进行代码质量检查
  • 发布:在标记版本发布时自动部署到 PyPI

许可证

本项目采用 MIT 许可证 - 详情请参阅 LICENSE 文件。

免责声明

这是一个非官方工具,与 dnsdumpster.com 无关联且未经其认可。请负责任地使用,并遵守目标网站的服务条款和 robots.txt。作者不对该工具的滥用负责。

支持

  • 📧 如有错误和功能请求,请使用 GitHub Issues
  • 💬 如有一般性问题,请发起 GitHub Discussion
  • 🐦 在 Twitter 上关注作者:@PaulWebSec

更新日志

版本 0.10(当前)

  • 使用类型提示完成代码重构
  • 使用自定义异常改进错误处理
  • 使用 pytest 构建全面测试套件
  • 改进文档和示例
  • 使用 GitHub Actions 实现 CI/CD
  • 保持完全向后兼容

先前版本

完整版本历史请参阅 CHANGELOG.md。

致谢

  • 原作者:PaulSec
  • 贡献者:请参阅 CONTRIBUTORS.md
  • 感谢 DNSDumpster.com 提供服务
下载工具