目录
1、打redis
ssrfme靶场实战

页面直接给出了代码,过滤了file: dict ,等等
但是下面我们看到只要有info就能打印phpinfo()

通过phpinfo()打印的信息,发现有内网其他服务器的ip
直接访问

发现确实访问到了,我们抓包探测一下它开放了哪些端口

发现它只开放了80端口
这个时候我们想,内网的服务器ip一般是连续的,所以我们试一下前面几个ip

访问172.19.0.2这个ip的时候,发现有回显,它说 go away ,叫我离开?我就不离开,它肯定有问题 ,探测它的端口

6379 !! 嘿,找到了!开始打redis
我们要想写webshell必须得知道它的物理路径,这个时候我们猜,一般是/var/www/html
但是这题它就不是一般,/var/www/html权限不够,它有个子目录upload有写的权限
这个时候我们要用gopherus这个工具来生成payload

因为要放在url传入,所以要进行urlcode二次编码

执行之后,直接读文件

2、打fastcgi

抓包探测端口

发现无法探测出9000端口
但是我们看它的response,发现它是nginx

所以我们判断它是默认的9000端口有打开
同样用gopherus工具生成payload

将payload解码分析
我们可以看到它其实就是利用php-fpm未授权访问,修改auto_prepend_file和allow_url_include这两个参数

3、SSRF绕过
1、点分隔符替换:用。可以替换. www。baidu。com
2、@符绕过 https://www.biadu.com@127.0.0.1
= https://127.0.0.1
3、ip地址转换为其他进制数
4、302重定向到部署的vps,再location跳转到内网
5、DNS重绑定
4、SSRF防御
1、白名单过滤,只允许访问信任的ip和rul地址
2、尽量避免使用用户提供的url地址
3、禁用高危协议,dict,gopher,file
4、禁止302跳转
5、限制请求的端口