Community程式設計與開發github.com

yaklang/401-403 繞過技巧

401/403 繞過劇本。在管理面板、API 端點或受限路徑上遇到拒絕存取回應時使用。涵蓋路徑操作、HTTP 方法篡改、標頭注入、協定降級及自動化繞過工具。

401-403 繞過技巧 是什麼?

此技能專為開發者與安全研究人員設計,提供一套系統性的 401 和 403 HTTP 狀態碼繞過技術。當目標端點(如管理後台、敏感 API 或路徑限制)返回拒絕存取回應時,使用者可依序測試多種繞過策略,包括路徑操作(如使用萬用字元、路徑參數)、HTTP 方法篡改(如將 GET 改為 POST、HEAD 或 OPTIONS)、標頭注入(如 X-Forwarded-For、X-Original-URL)、協定降級(從 HTTPS 改為 HTTP)以及結合自動化工具(如 ffuf、Burp Suite Intruder)進行大量測試。該技能支援 Yaklang 平台,可搭配 Yakit 或命令列環境使用,並提供實例 payload 與注意事項,幫助使用者在授權測試中快速識別配置漏洞並繞過存取控制。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/yaklang/hack-skills/tree/main/skills/401-403-bypass-techniques

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

401-403 繞過技巧 是做什麼的?

401/403 繞過劇本。在管理面板、API 端點或受限路徑上遇到拒絕存取回應時使用。涵蓋路徑操作、HTTP 方法篡改、標頭注入、協定降級及自動化繞過工具。

簡介

當目標應用程式返回 401 Unauthorized 或 403 Forbidden 狀態碼時,表示未經授權的存取被拒絕。然而,許多 Web 應用程式因其存取控制邏輯實作不完整,可能允許透過特定技巧繞過限制。本技能提供一系列已驗證的技術,用於在授權測試中探索此類漏洞。

平台支援

  • Yaklang:可直接作為 Yak 模組使用,或透過 Yakit 圖形化介面執行。
  • 自動化工具整合:劇本中包含 ffuf、Burp Suite 等工具的 payload 範例。

繞過技術

1. 路徑操作

透過修改 URL 路徑來欺騙伺服器接受請求。

技術範例 payload說明
萬用字元/admin/*使用星號表示任意路徑
路徑參數/admin;foo分號後接參數
URL 編碼/admin%2F對斜線進行編碼
大小寫變異/Admin, /ADMIN改變大小寫
結尾斜線/admin vs /admin/增加或移除斜線
雙重斜線//admin使用雙斜線開頭
後綴繞過/admin..;/使用點點分號路徑
子目錄繞過/./admin/../admin/利用相對路徑混淆

2. HTTP 方法篡改

變更請求的 HTTP 方法,繞過僅針對特定方法的限制。

技術範例說明
HEAD 方法HEAD /admin僅取得回應標頭
OPTIONS 方法OPTIONS /admin查看允許的方法
PUT/PATCH 方法PUT /admin/config嘗試修改資源
DELETE 方法DELETE /admin/user/1嘗試刪除資源
TRACE 方法TRACE /admin診斷用方法,有時未限制
X-HTTP-Method-Override標頭:X-HTTP-Method-Override: POST欺騙後端

3. 標頭注入

在請求中插入特定 HTTP 標頭,繞過基於 IP 或來源的存取控制。

標頭名稱範例值說明
X-Forwarded-For127.0.0.1, localhost偽造客戶端 IP
X-Original-URL/admin/指定原始請求路徑
X-Rewrite-URL/admin/重寫 URL 路徑
X-Custom-IP-Authorization127.0.0.1自訂授權 IP
X-Forwarded-Hostinternal-admin.com偽造主機標頭
Client-IP127.0.0.1客戶端 IP
X-Real-IP127.0.0.1真實 IP
X-Auth-Tokennull, 0, false嘗試空或假值

4. 協定降級

將 HTTPS 請求降級為 HTTP,規避基於協定的限制。

  • 將 URL 中的 https:// 改為 http://。
  • 保留路徑其餘部分不變。
  • 注意:現代瀏覽器可能自動升級為 HTTPS,建議使用 curl 或 wget 測試。
curl -v http://target.com/admin/

5. 自動化繞過

利用工具批量測試繞過 payload。

ffuf 範例:

ffuf -w /path/to/payloads.txt -u https://target.com/FUZZ/admin -H "X-Forwarded-For: 127.0.0.1" -fc 401,403

Burp Suite Intruder:

  • settings 中匯入 payload 清單
  • 設定 Position 為路徑或標頭
  • 過濾掉 401 與 403 狀態碼

注意事項

  • 只能在獲得授權的目標上執行測試。
  • 單一技巧可能無效,建議組合使用。
  • 部分方法可能觸發 WAF 或入侵偵測系統,操作時請謹慎。
  • 記錄所有測試結果以便後續分析。

參考資源

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

yaklang/active-directory-acl-abuse

Active Directory ACL abuse playbook. Use when exploiting misconfigured AD permissions including GenericAll, WriteDACL, DCSync rights, shadow credentials, LAPS reading, GPO abuse, and BloodHound-guided attack paths.

yaklang/active-directory-certificate-services

AD Certificate Services attack playbook. Use when targeting misconfigured AD CS for privilege escalation via ESC1-ESC13 template abuse, NTLM relay to enrollment, CA officer abuse, and certificate-based persistence.

yaklang/active-directory-kerberos-attacks

Kerberos attack playbook for Active Directory. Use when targeting AD authentication via AS-REP roasting, Kerberoasting, golden/silver/diamond tickets, delegation abuse, or pass-the-ticket attacks.

yaklang/ai-ml-security

AI/ML security playbook. Use when assessing model supply chain attacks (pickle RCE, poisoned weights), adversarial examples, model poisoning, model stealing, data privacy attacks (membership inference, model inversion), and autonomous agent security risks.

yaklang/android-pentesting-tricks

Android pentesting playbook. Use when testing Android applications for SSL pinning bypass, exported component abuse, WebView vulnerabilities, intent redirection, root detection bypass, tapjacking, and backup extraction during authorized mobile security assessments.

yaklang/anti-debugging-techniques

Anti-debugging detection and bypass playbook. Use when reversing protected binaries that detect debuggers via ptrace, PEB flags, timing checks, or signal/exception handlers on Linux and Windows.

yaklang/api-auth-and-jwt-abuse

API authentication and JWT abuse playbook. Use when testing bearer tokens, API keys, claim trust, header spoofing, rate limits, and API auth boundary weaknesses.

yaklang/api-authorization-and-bola

API authorization and BOLA testing playbook. Use when APIs expose object identifiers, nested resources, hidden writable fields, or weak function-level authorization.

yaklang/api-recon-and-docs

API reconnaissance and documentation review playbook. Use when discovering endpoints, schemas, versions, OpenAPI specs, hidden docs, and surface area for API testing.

yaklang/api-sec

Entry P1 category router for API security. Use when choosing between API recon, authorization, token abuse, and hidden-parameter workflows before any deeper API topic skill.

yaklang/arbitrary-write-to-rce

Arbitrary write to RCE playbook. Use when you have an arbitrary write primitive (from heap exploitation, format string, or OOB write) and need to convert it into code execution by targeting GOT, hooks, _IO_FILE vtable, exit_funcs, TLS_dtor_list, modprobe_path, .fini_array, or C++ vtables.

yaklang/authbypass-authentication-flaws

Authentication bypass testing playbook. Use when assessing login flows, password reset logic, account recovery, MFA bypass, token predictability, brute-force resistance, and session boundary flaws.

yaklang/auth-sec

Entry P1 category router for authentication and authorization. Use when testing login flows, sessions, object authorization, JWT, OAuth, CORS, CSRF, and enterprise SSO weaknesses before any deeper auth topic skill.

yaklang/binary-protection-bypass

Binary protection bypass playbook. Use when identifying and bypassing ASLR, PIE, NX/DEP, stack canary, RELRO, FORTIFY_SOURCE, CET, and MTE protections in ELF binaries to enable exploitation.

yaklang/browser-exploitation-v8

Browser and V8 exploitation playbook. Use when exploiting JavaScript engine vulnerabilities including JIT type confusion, incorrect bounds elimination, and V8 sandbox bypass to achieve renderer RCE and sandbox escape in Chrome/Chromium.

yaklang/business-logic-vuln

Entry P1 category router for business logic testing. Use when workflow abuse, race conditions, pricing flaws, or multi-step state attacks matter more than parser-level input injection.

yaklang/business-logic-vulnerabilities

Business logic vulnerability playbook. Use when reasoning about workflows, race conditions, price manipulation, coupon abuse, state machines, and multi-step authorization gaps.

yaklang/classical-cipher-analysis

Classical cipher analysis playbook. Use when encountering substitution ciphers, Vigenere, transposition, XOR, or encoded text in CTF challenges that requires frequency analysis, Kasiski examination, or known-plaintext cryptanalysis.

yaklang/clickjacking

Clickjacking playbook. Use when testing whether target pages can be framed, whether X-Frame-Options or CSP frame-ancestors are properly configured, and whether UI redress attacks can trigger sensitive actions.

yaklang/cmdi-command-injection

Command injection playbook. Use when user input may reach shell commands, process execution, converters, import pipelines, or blind out-of-band command sinks.

相關技能