Add Zoneminder lang exec module - #16514
Conversation
|
I took a quick look over the module code. A few observations.
This code pattern is used a few times in the if res.body =~ %r{<title>ZM - Login</title>}
vprint_error('Service found, but authentication failed')
return Exploit::CheckCode::Detected
elseRather than print then return a checkcode, you can return both at once: return CheckCode::Detected('Service found, but authentication failed')Also The
Is it possible to get the current language before resetting it, rather than presume it was |
|
Hello @bcoles
Yes it is possible, I just learned |
jmartin-tech
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
Made a couple minor comments for review.
Remove RPORT option and rescue block Co-authored-by: Jeffrey Martin <jeffrey_martin@rapid7.com>
space-r7
left a comment
There was a problem hiding this comment.
Hey @krastanoel, thanks for the module! I just left a few small notes mostly about using the cookie jar and checking responses.
Update documentation common default options Co-authored-by: Shelby Pace <40177151+space-r7@users.noreply.github.com>
- use keep_cookies instead of grabbing and set manually - separate login code to its own method - check response is not nil before calling get_html_document method - clear cookie jar in exploit method and authenticate if user disable AutoCheck option
Remove unnecessary check for content-type response Co-authored-by: Shelby Pace <40177151+space-r7@users.noreply.github.com>
…eck if the version is not nil
Version 1.32.3 without authVersion 1.32.3 with authentication |
|
Made some small changes in dd0b124, just fixing a typo and adding some checks on a few responses. |
Release NotesThis leverages a directory traversal and arbitrary file write in vulnerable versions of ZoneMinder to achieve remote code execution as the |
This module exploits arbitrary file write in debug log file option chained with a path traversal in language settings that leads to a remote code execution in ZoneMinder surveillance software versions before 1.36.13 and before 1.37.11.
More vulnerability details and references: CVE-2022-29806
Meterpreter
Upon successful exploitation the module will change the language back to
en_gbto prevent a PHP warning shows in the dashboard like this:The warning is a lot and will be notice by users using the dashboard so it's good to change it back to its default. However, using
php/meterpreter_reverse_tcpwill even made the dashboard stop working, it's like the part of the code that suppose to change the language back is not executing when using meterpreter. The module will configuredphp/reverse_perlas the default payload for good reliability.Verification
List the steps needed to make sure this thing works
msfconsoleuse exploit/unix/webapp/zoneminder_lang_execset RHOSTS [ips]set LHOST [lhost]set VERBOSE truerunDemo
ZoneMinder 1.36.4 on Linux (Ubuntu 18.04 Docker Image)