-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Add Zoneminder lang exec module #16514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
else Rather 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @krastanoel, thanks for the module! I just left a few small notes mostly about using the cookie jar and checking responses.
documentation/modules/exploit/unix/webapp/zoneminder_lang_exec.md
Outdated
Show resolved
Hide resolved
documentation/modules/exploit/unix/webapp/zoneminder_lang_exec.md
Outdated
Show resolved
Hide resolved
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 auth
Version 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_gb
to 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_tcp
will 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_perl
as the default payload for good reliability.Verification
List the steps needed to make sure this thing works
msfconsole
use exploit/unix/webapp/zoneminder_lang_exec
set RHOSTS [ips]
set LHOST [lhost]
set VERBOSE true
run
Demo
ZoneMinder 1.36.4 on Linux (Ubuntu 18.04 Docker Image)