Page cover

Redis Pentesting

Redis is the In-Memory NoSQL Database. A default port is 6379.

nmap --script redis-info -p 6379 <target-ip>
nmap --script redis-brute -p 6379 <target-ip>

msf> use auxiliary/scanner/redis/redis_server
Copied!

If we have access to target system, find the configuration file then we may be able to get passwords.

find / -name "redis.conf" 2>/dev/null
grep -i pass /path/to/redis.conf
Copied!

If we get the line with password written as below,

requirepass "password"
Copied!

We can set the password in a redis client.

> auth "password"
Copied!

After connecting and execute the first arbitrary command, we may got the following output.

If so, we need to authenticate to communicate with the redis server.

Non-RESP (REdis Serialization Protocol) is such like the other protocol's command. Commands are separated with spaces.

RESP (REdis Serialization Protocol) is The syntax is…

  • *<num> The number of arguments.

  • $<num> The string length of the argument.

Below is the command same as set name "john".

We can connect to redis socket using curl command.

In local machine, start SMB server.

Now execute the following command in Redis client.

We might get a NTLM hash in the incoming connection to the SMB server. We can see the SMB server logs in terminal. If the NTLM hash found, crack it.

In local machine,

In target machine,

Last updated