Although it isn’t as well-known as MySQL, MariaDB, or MongoDB, Redis is still one of the most widely used databases. During a hands-on lab called Keyspace, after a standard nmap scan, I happened to come across an open port 6379 that is used specifically for this service.

nmap scan

The 6379 - Pentesting Redis section on HackTricks shows that using redis-cli -h with the target IP and then the command INFO can immediately shows if unauthenticated access is permitted, like our case.

redis-cli

Reading further on the same section, it appears that is possible to find the home folder of the redis user with the command config get * in order to upload a public ssh key and access via ssh with that user. But the only folder showing up in this lab was the root folder.

the root folder

Even better that a generic user I would say! Obviously, an automatic exploit for that was already written, the only issue was that is written for Python 2. So, after a quick update on the code and after providing the right folder to update the ssh, I’ve tried to launch the updated version:

Redis Server Exploit

Aaaand…an easy win!

Success1

You can find the full updated code here. Happy hacking!