Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create 403-429-bypass.bcheck #238

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions other/bypass/403-429-bypass.bcheck
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
metadata:
language: v2-beta
name: "403/429 bypass using HTTP Header"
description: "Attempts to bypass 403/429 using the HTTP headers with local IP address"
author: "Shadow Surface"
tags: "bypass"

define:
bypass_ip = "127.0.0.1"

run for each:
bypass_header =
"Forwarded",
"Via",
"X-Client-IP",
"X-Forwarded-For",
"X-Forwarded-Host",
"X-Forwarded-Proto",
"X-Forwarded-Server",
"X-Forward-For",
"X-Forwared-Host",
"X-Host",
"X-Originating-IP",
"X-Real-IP",
"X-Remote-Addr",
"X-Remote-IP",
"X-Requested-By",
"X-Requested-For",
"X-Trusted-IP"

given request then
if {base.response.status_code} matches "(403|429)" then
send request:
replacing headers:
{bypass_header}: {bypass_ip}

if not( {latest.response.status_code} is {base.response.status_code} ) then
report issue:
severity: high
confidence: tentative
detail: `Potential {base.response.status_code} bypass using {bypass_header} header.`
remediation: `Avoid using {bypass_header} for authorization or rate limiting.`
end if
end if