Skip to main content

High-performance HTTP probing engine written in Rust

Project description

Hprobe 🚀

A high-performance HTTP probing tool for asset discovery.

hprobe 是一个高性能 HTTP 探测引擎,基于 Rust 实现,并通过 Python 提供简单易用接口。 它支持同步和异步调用,能够快速探测目标 HTTP 服务、端口、指纹等,适用于大规模资产发现/网络空间测绘。

  • 跨平台(Linux / Windows / macOS)
  • 支持多线程和异步模式
  • 可统一全局配置,方便批量调用
  • 提供参数化和字典配置两种接口

Quick Start⚡| 快速开始

# PyPI 安装(Python >=3.7)
pip install hprobe

下面示例展示了 同步调用 和 异步调用,以及两种调用方式:参数化接口和字典接口。

import os
import asyncio
import hprobe

# -------------------------------
# 全局唯一配置(所有方法共用)
# -------------------------------
UNIFIED_CONFIG = {
    "target": "192.168.1.1",      # 统一目标
    "ports": [80],                # 统一端口
    "threads": 80,
    "timeout": 5.0,
    "max_redirects": 3,
    "methods": "GET",
    "scheme_policy": "Auto",
    "user_agent": None,
    "asn": False,
    "tech_detect": False,
    "fingerprint": False,
    "screenshot": False,
    "common_ports": False,
    "silent": True,
    "post_data": None,
    "post_file": None,
    "content_type": "application/x-www-form-urlencoded",
    "mode": "active",
    "response_file": None,  # 被动模式响应文件,仅 passive 模式需配置
}

# ⚠️ 可选:自定义数据目录
# import os
# os.environ["HPROBE_DATA_ROOT"] = r"C:\mydata\"

# 1. 同步调用
def sync_scan_demo():
    print("="*60)
    print("【同步调用】参数化接口")
    print("="*60)
    result1 = hprobe.scan_target(**UNIFIED_CONFIG)
    print(f"结果: {result1 if result1 else '无有效结果'}\n")

    print("="*60)
    print("【同步调用】配置字典接口")
    print("="*60)
    result2 = hprobe.scan_target_with_config(UNIFIED_CONFIG)
    print(f"结果: {result2 if result2 else '无有效结果'}\n")

# 2. 异步调用
async def async_scan_demo():
    print("="*60)
    print("【异步调用】参数化接口")
    print("="*60)
    result1 = await hprobe.scan_target_async(**UNIFIED_CONFIG)
    print(f"结果: {result1 if result1 else '无有效结果'}\n")

    print("="*60)
    print("【异步调用】配置字典接口")
    print("="*60)
    result2 = await hprobe.scan_target_with_config_async(UNIFIED_CONFIG)
    print(f"结果: {result2 if result2 else '无有效结果'}\n")

# 3. 主函数示例
def main():
    run_sync = True
    run_async = True

    if run_sync:
        sync_scan_demo()

    if run_async:
        asyncio.run(async_scan_demo())

if __name__ == "__main__":
    main()
    print("="*60)
    print("所有扫描任务执行完成!")
    print("="*60)

参数配置说明 target : 目标 IP 或域名

ports : 探测端口列表

threads : 并发线程数

timeout : 单请求超时时间(秒)

max_redirects : 最大重定向次数

methods : HTTP 方法(GET/POST)

scheme_policy : 协议策略(Auto/HTTP/HTTPS)

user_agent : 自定义 User-Agent

asn / tech_detect / fingerprint / screenshot / common_ports : 功能开关

silent : 是否静默模式(仅输出结果,不打印日志)

post_data / post_file : POST 数据或文件

content_type : POST Content-Type

mode : active/passive

response_file : 被动模式响应文件

License 📄 | 许可证

Copyright (c) 2026 FlyfishSec All rights reserved.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

hprobe-0.2.1.post1-cp37-abi3-win_amd64.whl (11.7 MB view details)

Uploaded CPython 3.7+Windows x86-64

hprobe-0.2.1.post1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ x86-64

File details

Details for the file hprobe-0.2.1.post1-cp37-abi3-win_amd64.whl.

File metadata

  • Download URL: hprobe-0.2.1.post1-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 11.7 MB
  • Tags: CPython 3.7+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for hprobe-0.2.1.post1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7113caaf41709b503589b827c9d249d9b1cfe8f90154c576dc9e7e7e9c5ef194
MD5 1bbd3fdc27c8d9455658e3ebe9333903
BLAKE2b-256 653996e0b9f18a27c61945441d6125491fc275b8b5ca9bcfc23a19b8038bb576

See more details on using hashes here.

File details

Details for the file hprobe-0.2.1.post1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hprobe-0.2.1.post1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 658db3381192ed662690268c164e48cd8feef9b2896a9a4601397e9017a8febe
MD5 56fccfbd9bf92f9796fca64c18307d91
BLAKE2b-256 ed7544a509d29fd3c418b87695c108a887a89dcd763eb29d75a27ac58bc0ef3a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page