当前位置:网站首页>ctfshow-web355,356(SSRF)
ctfshow-web355,356(SSRF)
2022-07-01 06:48:00 【m0_62094846】
web-355
<?php
error_reporting(0);
highlight_file(__FILE__);
$url=$_POST['url'];
$x=parse_url($url);
if($x['scheme']==='http'||$x['scheme']==='https'){
$host=$x['host'];
if((strlen($host)<=5)){
$ch=curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result=curl_exec($ch);
curl_close($ch);
echo ($result);
}
else{
die('hacker');
}
}
else{
die('hacker');
}
?>host长度小于5,即127.0.0.1要小于5,可以写成127.1或0

web-356
<?php
error_reporting(0);
highlight_file(__FILE__);
$url=$_POST['url'];
$x=parse_url($url);
if($x['scheme']==='http'||$x['scheme']==='https'){
$host=$x['host'];
if((strlen($host)<=3)){
$ch=curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result=curl_exec($ch);
curl_close($ch);
echo ($result);
}
else{
die('hacker');
}
}
else{
die('hacker');
}
?>url=http://0/flag.php
边栏推荐
- Solve the problem that the class defined in meta-inf.services cannot be read
- Principle of introducing modules into node
- Spark入门(一篇就够了)
- 2022 年江苏省职业院校技能大赛(中职) 网络搭建与应用赛项公开赛卷
- Postgraduate entrance examination directory link
- NOC 设计的一些坑
- 第五章 輸入/輸出(I/O)管理
- rclone常用子命令中文解释
- SQL learning notes nine connections 2
- Is it safe to buy funds on Alipay? Where can I buy funds
猜你喜欢
随机推荐
Automated test platform (13): interface automation framework and platform comparison, application scenario analysis and design ideas sharing
发现了一个 MySQL 的巨坑:update 更新别再用影响行数做判断了!!!
自动化测试平台(十三):接口自动化框架与平台对比及应用场景分析及设计思路分享
开源了!文心大模型ERNIE-Tiny轻量化技术,又准又快,效果全开
K8s set up redis cluster
Which securities company does qiniu school cooperate with? Is it safe to open an account?
Is it safe to buy funds on Alipay? Where can I buy funds
RestTemplate使用
SQL learning notes nine connections 2
Interview questions for HW (OD) post
了解ESP32睡眠模式及其功耗
Database notes
MySQL data type learning notes
如何通过cdn方式使用阿里巴巴矢量图字体文件
【微信小程序低代码开发】二,在实操中化解小程序的代码组成
K8S搭建Redis集群
MySQL table partition creation method
在长城证券上做基金定投安全吗?
STM32F1与STM32CubeIDE编程实例-NEC协议红外接收与解码
Notes on probability theory









