快速模块化Web接口暴力破解器
python3 -m pip install -r requirements.txt
$ python3 web-brutator.py -h
__ __ ___. __________ __ __
/ \ / \ ____\_ |__ \______ \_______ __ ___/ |______ _/ |_ ___________
\ \/\/ // __ \| __ \ ______ | | _/\_ __ \ | \ __\__ \ __\ / _ \_ _ _\
\ /\ ___/| \_\ \ /_____/ | | \ | | \/ | /| | / __ \| | ( <_> ) | \/
\__/\ / \___ >___ / |______ / |__| |____/ |__| (____ /__| \____/|__|
\/ \/ \/ \/ \/
版本 0.2
用法: web-brutator.py [-h] [--url URL] [--target TYPE] [-u USERNAME]
[-U USERLIST] [-p PASSWORD] [-P PASSLIST]
[-C COMBOLIST] [-t THREADS] [-s] [-v] [-e MAX_ERRORS]
[--timeout TIMEOUT] [-l]
可选参数:
-h, --help 显示此帮助信息并退出
--url URL 目标URL
--target TYPE 目标类型
-u, --username USERNAME 单个用户名
-U, --userlist USERLIST 用户名字典
-p, --password PASSWORD 单个密码
-P, --passlist PASSLIST 密码字典
-C, --combolist COMBOLIST 用户名:密码组合列表
-t, --threads THREADS 线程数 [1-50] (默认: 10)
-s, --stoponsuccess 成功后停止
-v, --verbose 打印每一个测试的凭证
-e, --max-errors MAX_ERRORS 允许的最大连续错误次数 (默认: 10)
--timeout TIMEOUT 响应超时时间限制 (默认: 20秒)
-l, --list-modules 显示模块列表
示例:
python3 web-brutator.py --target jenkins --url https://mytarget.com -U ./usernames.txt -P ./passwords.txt -s -t 40
注意:部分产品(如Weblogic、Tomcat等)在多次认证失败后会实现账户锁定机制。如果遇到此类情况,web-brutator会在暴力破解开始时提示用户。在对此类目标发起暴力破解前请务必考虑这一点。
web-brutator可以自动检测标准Web认证表单并自动执行暴力破解。此功能通过standardform模块实现,目前仍处于实验阶段,由于基于多种启发式规则,可能导致误报/漏报。
不支持:
示例:
python3 web-brutator.py --target standardform --url https://mytarget.com -U ./usernames.txt -P ./passwords.txt -s -t 40 -v
此演示针对phpMyAdmin界面
添加一个新的认证暴力破解模块非常简单:
lib/core/modules/ 下创建一个名称合适的文件lib/core/modules/ 下现有模块的示例。注意,HTTP请求应通过 Requester 类提供的静态方法完成:Requester.get()、Requester.post()、Requester.http_auth()。#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from lib.core.Exceptions import AuthException, RequestException
from lib.core.Logger import logger
from lib.core.Requester import AuthMode, Requester
class Mymodule:
def __init__(self, url, verbose=False):
self.url = url
# 其他self变量可在此定义
def check(self):
"""
此方法用于检测目标认证接口是否存在。
:return: 布尔值,表示认证接口是否被检测到
"""
# 在此实现代码
def try_auth(self, username, password):
"""
此方法用于执行一次认证尝试。
:param str username: 要尝试的用户名
:param str password: 要尝试的密码
:return: 布尔值,表示认证状态
:raise AuthException:
"""
# 在此实现代码
-l 选项查看),并可从命令行调用。