Metasploit-framework: Exploit -ERR unknown command 'MODULE'

Created on 12 Nov 2019  路  12Comments  路  Source: rapid7/metasploit-framework

Steps to reproduce

  1. Setup server with redis 4.0.9
  2. Open Wireshark with IP of server
  3. Open metasploit
  4. use exploit/linux/redis/redis_unauth_exec
  5. Setup RHOST as remote host, SRVHOST as localhost and LHOST as localhost
  6. run
  7. Look at wireshark TCP Stream
  8. -ERR unknown command 'MODULE'

The server is from HackTheBox VM Postman.

Expected behavior

Exploit says 4.x / 5.x. My redis server says 4.0.9. Payload should go through. Reverse shell should be working.

Current behavior

In Metasploit :
Started reverse TCP handler on [LOCAL_IP]:4444
Exploit completed, but no session was created.

From redis itself (Wireshark) :
-ERR unknown command 'MODULE'.

System stuff

Metasploit version

Framework: 5.0.59-dev
Console : 5.0.59-dev

I installed Metasploit with:

  • [X] Kali package via apt
  • [ ] Omnibus installer (nightly)
  • [ ] Commercial/Community installer (from http://www.rapid7.com/products/metasploit/download.jsp)
  • [ ] Source install (please specify ruby version)

OS

Kali Linux

question

Most helpful comment

This exploit does not work with the postman ctf. There is another way.

All 12 comments

You need to set the LHOST and SRVHOST to ip addresses that are reachable from your target.

I did. I set LHOST and SRVHOST to my ip address, which is reachable from my target. (Not "localhost"... sorry about that)

This exploit does not work with the postman ctf. There is another way.

Alright but shouldn't this exploit be renamed so that it excludes this version? The current name is 4.X / 5.X but 4.0.9 it part of 4.X. Should the version be more specific?

@blindpanic is saying the exploit does not work with the CTF. Let's try to avoid any spoilers here, thanks.

Found another way. I don't think you understood my comment (which wasn't about giving any spoiler) but nevermind.

@VBoucher: Yes, you are correct, the version should probably be more specific. The version range that's affected is likely in the advisory somewhere. It'd be a worthy update to the documentation.

The module should also be renamed from redis_unauth_exec, as it is not an unauthenticated exploit (#12143).

The "bug" mentioned in this issue has nothing to do with the versioning. The Postman machine on HTB had a specific configuration to prevent the attack as stated by 0xdf in his blogpost.
There is no need to update the documentation.

Thanks for confirming, @lyghtnox. My comment was more general than that.

While there may not be a need to update the documentation to exclude 4.0.9, which you've proven to be a false negative, we absolutely should be as specific as we can in listing affected versions. This goes for all modules.

"4.x and 5.x" may be accurate, but it's not precise, and it can lead to situations like this. The functionality this module abuses was added in a specific version or commit. @Green-m may know better.

The answer is precisely 4.0.0: https://redis.io/commands/module-load.

Available since 4.0.0.

Since Redis 6 is in beta, the documentation can perhaps be updated to say "since 4.0.0" if the functionality persists in version 6. If the functionality is removed, we should update for that, too.

@wvu-r7 Thank you for catching that! I did not see this until yesterday. I would update it for more precise.

Was this page helpful?
0 / 5 - 0 ratings