当前位置:网站首页>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
边栏推荐
猜你喜欢

脏读、幻读和不可重复读

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

EasyNVS云管理平台功能重构:支持新增用户、修改信息等

灰度何以跌下神坛?

Problem: officeexception: failed to start and connect (II)

Code practice - build your own diffusion models / score based generic models from scratch

【微信小程序】如何搭积木式开发?

SQL statement

如何画产品架构图?

Solve the problem that the class defined in meta-inf.services cannot be read
随机推荐
常用快捷键
NOC 设计的一些坑
Terminology description in the field of software engineering
How to use Alibaba vector font files through CDN
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
[lingo] find the shortest path problem of undirected graph
问题解决:OfficeException: failed to start and connect(一)
代码实战——从零开始搭建自己的Diffusion models/Score-based generative models
Storage function learning notes
[wechat applet low code development] second, resolve the code composition of the applet in practice
Summary of wechat official account embedded program to jump to wechat
Rclone Chinese document: a collection of common commands
Webapck packaging principle -- Analysis of startup process
Several ways of gson's @jsonadapter annotation
Docker 安装部署Redis
K8s set up redis cluster
ESP32 - ULP 协处理器在低功耗模式下读片内霍尔传感器HALL SENSOR
3. Disabling copy construction
Interview questions for HW (OD) post
软件工程领域的名词描述