当前位置:网站首页>ctfshow-web352,353(SSRF)
ctfshow-web352,353(SSRF)
2022-07-01 07:06:00 【m0_ sixty-two million ninety-four thousand eight hundred and fo】
web-352
<?php
error_reporting(0);
highlight_file(__FILE__);
$url=$_POST['url'];
$x=parse_url($url);
if($x['scheme']==='http'||$x['scheme']==='https'){
if(!preg_match('/localhost|127.0.0/')){
$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');
}
?> 

There must be http perhaps https
Cannot appear localhost and 127.0.0.1
however
(1)127.1 It can be interpreted as 127.0.0.1
url=http://127.1/flag.php
(2) stay Linux in ,0 It will also be interpreted as 127.0.0.1

(3)127.0.0.0/8 Is a loopback address network segment , from 127.0.0.1 ~ 127.255.255.254 All means localhost

(4)ip Addresses can also be accessed by expressing them in other hexadecimal forms
IP Address hexadecimal conversion (520101.com)
( This question is only useful in decimal system )


web-353
<?php
error_reporting(0);
highlight_file(__FILE__);
$url=$_POST['url'];
$x=parse_url($url);
if($x['scheme']==='http'||$x['scheme']==='https'){
if(!preg_match('/localhost|127\.0\.|\./i', $url)){
$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( All the methods in the above question are ok )

边栏推荐
- [lingo] find the shortest path problem of undirected graph
- Is the account opening of GF Securities safe and reliable? How to open GF Securities Account
- Is it safe to buy funds on the brokerage account
- 发现了一个 MySQL 的巨坑:update 更新别再用影响行数做判断了!!!
- 关于“2022年度网络安全教育线上培训”相关问题的复盘和说明
- LeetCode+ 71 - 75
- go-etcd
- Storage function learning notes
- 图像风格迁移 CycleGAN原理
- Record an online interface slow query problem troubleshooting
猜你喜欢

K8S搭建Redis集群

【LINGO】求七个城市最小连线图,使天然气管道价格最低
![[recommendation technology] matlab simulation of network information recommendation technology based on collaborative filtering](/img/fb/dc03f97f12488e53d706a05da9faea.png)
[recommendation technology] matlab simulation of network information recommendation technology based on collaborative filtering

ctfshow-web354(SSRF)

Dirty reading, unreal reading and unrepeatable reading

Esp32 monitors the battery voltage with ULP when the battery is powered

Why are so many people turning to product managers? What is the development prospect of product manager?

如何画产品架构图?

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

Spark入门(一篇就够了)
随机推荐
rclone中文文档:常用命令大全
Jena default inference query based on OWL
DC-4 target
未来互联网人才还稀缺吗?哪些技术方向热门?
[lingo] solve quadratic programming
為什麼這麼多人轉行產品經理?產品經理發展前景如何?
Principle of introducing modules into node
We found a huge hole in MySQL: do not judge the number of rows affected by update!!!
MySQL constraint learning notes
Dirty reading, unreal reading and unrepeatable reading
Code practice - build your own diffusion models / score based generic models from scratch
Is fixed investment fund a high-risk product?
【分类模型】Q 型聚类分析
关于“2022年度网络安全教育线上培训”相关问题的复盘和说明
Jena基于OWL的默认推理查询
Servlet 和 JSP 中的分页
How to use Alibaba vector font files through CDN
转行做产品经理,如何挑选产品经理课程?
图像风格迁移 CycleGAN原理
[matlab] solve nonlinear programming