0
votes

I am facing issue in executing the code in redis-cli using lua.

Below are the things that I have done so far:-

root@ubuntu:~# redis-cli -h 127.0.0.1 -p 6379 eval "return 'hello'" 0

"hello"

If I am doing like this to read a system file:-

root@ubuntu:~# redis-cli -h 127.0.0.1 -p 6379 eval "dofile('/etc/passwd')" 0

I am getting error like

(error) ERR Error running script (call to f_afdc51b5f9e34eced5fae459fc1d856af181aaf1): @user_script:1: /etc/passwd:1: function arguments expected near ':

Is it possible to read complete file ?

Also, I am thinking to get reverse shell. How that can be possible using lua and eval ?

1

1 Answers

1
votes

Lua's dofile is disabled in Redis' Lua sandbox. A reverse shell is also unsupported (but if you find a way, that would be a good catch of a potential security breach).