Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

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

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

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
hoper — 安全工具,用于追踪URL跨rel链接的跳转,以获取最终URL。 | Kitploit
工具/GitHubGitHub/gabamnml/hoper
侦察信息收集Web安全
GitHubgabamnml/hoper

hoper

安全工具,用于追踪URL跨rel链接的跳转,以获取最终URL。

查看仓库网站
55136114天前Kitploit 审核通过
分享

Hoper

Gem Version CI

Hoper 展示一个 URL 在到达最终目的地之前所经过的每一次跳转(重定向)—— 适用于短链接、电子邮件中的跟踪链接、SSO 流程,或调试重定向规则。

$ hoper http://github.com
Tracing http://github.com
   1. → 301 Moved Permanently  http://github.com/  81ms
   2. ✔ 200 OK  https://github.com/  50ms
  1 redirect → https://github.com/

功能特性

  • 可在 Linux、macOS 和 Windows 上运行 — 纯 Ruby 实现,无需原生扩展或 libcurl。
  • 显示每一跳的状态码、原因和响应时间。
  • 重定向循环检测以及可配置的跳数上限。
  • 默认使用 HEAD(不下载响应体),对于拒绝 HEAD 的服务器自动回退到 GET。
  • 为脚本和流水线提供 JSON 输出;具有有意义的退出码。
  • 遵循 HTTP_PROXY / HTTPS_PROXY / NO_PROXY 以及 NO_COLOR。

安装

需要 Ruby 3.1 或更高版本。

gem install hoper

在 Windows 上,使用 RubyInstaller 安装 Ruby,然后运行相同的命令。

用法

hoper [options] URL [URL...]

    -m, --max-hops N                 Maximum redirects to follow (default: 20)
    -t, --timeout SECONDS            Timeout per request (default: 10)
    -X, --method METHOD              HTTP method: HEAD or GET (default: HEAD)
    -A, --user-agent UA              User-Agent header to send
    -H, --header 'NAME: VALUE'       Extra request header (repeatable)
    -k, --insecure                   Do not verify TLS certificates
    -j, --json                       Output results as JSON
        --[no-]color                 Force/disable colored output
    -v, --version                    Print version and exit
    -h, --help                       Show this help

如果省略了协议方案,则默认使用 https://(hoper example.com)。

JSON 输出

hoper --json http://github.com
{
  "start_url": "http://github.com/",
  "final_url": "https://github.com/",
  "final_status": 200,
  "redirects": 1,
  "hops": [
    { "url": "http://github.com/", "status": 301, "reason": "Moved Permanently", "location": "https://github.com/", "duration_ms": 81 },
    { "url": "https://github.com/", "status": 200, "reason": "OK", "duration_ms": 50 }
  ]
}

当有多个 URL 时,输出为一个数组。

退出码

代码含义
0每个 URL 都解析为无错误(< 400)的最终响应
1至少有一个 URL 失败(网络错误、循环、跳转次数过多、4xx/5xx)
2用法/选项无效

作为库使用

require "hoper"

result = Hoper.trace("https://bit.ly/example", max_hops: 10)
result.hops.each { |hop| puts "#{hop.status} #{hop.url}" }
result.final_url  # => "https://example.com/"
result.success?   # => true

开发

bundle install
bundle exec rake test

CI 在 Ubuntu、macOS 和 Windows(Ruby 4.0)上运行测试套件,并在 Ubuntu 上运行支持的最旧 Ruby 版本(3.1)。测试使用本地进程内 HTTP 服务器,因此不需要网络访问。

发布

发布通过 GitHub Actions 和 RubyGems Trusted Publishing 自动化:

  1. 更新 lib/hoper/version.rb 并在 CHANGELOG.md 中添加一节;合并到 master。

  2. 打标签并推送:

    git tag v1.2.3 && git push origin v1.2.3
    

Release 工作流会检查标签是否与版本匹配、运行测试、将 gem 发布到 RubyGems.org,并使用 CHANGELOG 说明创建 GitHub Release。

贡献

欢迎在 GitHub 上提交缺陷报告和拉取请求:https://github.com/gabamnml/hoper。本项目旨在成为一个安全、友好的协作空间,贡献者应遵守 Contributor Covenant 行为准则。

许可证

该 gem 依据 MIT License 条款作为开源软件提供。

下载工具

最受欢迎

查看全部 →

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

暂无热门数据。

探索所有工具

浏览我们的工具集合

查看所有工具 →