当前位置:网站首页>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
边栏推荐
- Using fuseki query when there are multiple models in TDB
- Insufficient free space after clearing expired cache entries - consider increasing the maximum cache space
- ESP32 ESP-IDF ADC监测电池电压(带校正)
- 在长城证券上做基金定投安全吗?
- SQL language learning record I
- Webapck packaging principle -- Analysis of startup process
- K8s set up redis cluster
- Draw a directed graph based on input
- Gson的@JsonAdater注解的几种方式
- [wechat applet] how to build a building block development?
猜你喜欢

MySQL learning

比赛即实战!中国软件杯发布全新产业创新赛项,校企可联合参赛

K8S搭建Redis集群

(上)苹果有开源,但又怎样呢?

Figure out the difference between event coordinates screenx, clientx, pagex and offsetx

Product learning (I) - structure diagram

清除过期缓存条目后可用空间仍不足 - 请考虑增加缓存的最大空间

树莓派4的WiFi设置

Product learning (II) - competitive product analysis

关于变量是否线程安全的问题
随机推荐
DSBridge
转行做产品经理,如何挑选产品经理课程?
如果我在广州,到哪里开户比较好?究竟网上开户是否安全么?
rclone 访问web界面
Database notes
用手机在指南针上开户靠谱吗?这样有没有什么安全隐患
关于变量是否线程安全的问题
灰度何以跌下神坛?
Webapck packaging principle -- Analysis of startup process
第五章 输入/输出(I/O)管理
Figure out the difference between event coordinates screenx, clientx, pagex and offsetx
Using fuseki query when there are multiple models in TDB
Problem: officeexception: failed to start and connect (III)
解决无法读取META-INF.services里面定义的类
H5 web page determines whether an app is installed. If it is installed, it will jump to the summary of the scheme to download if it is not installed
buildroot override 机制
如何画产品架构图?
【LINGO】求解二次规划
JSP - 分页
MySQL learning