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

Wordpress automatic plugin aux module #15776

Merged
merged 4 commits into from
Nov 5, 2021

Conversation

h00die
Copy link
Contributor

@h00die h00die commented Oct 17, 2021

This module exploits an unauthenticated arbitrary wordpress options change vulnerability
in the Automatic (wp-automatic) plugin. We use that, very similar to the GDPR module to optionally:

  1. set the admin's email to one we control
  2. turn on user registration, set default registration role to admin, create a user

Verification

  • install the plugin
  • Do: use auxiliary/admin/http/wp_automatic_plugin_privesc
  • Do: set rhosts [IPs]
  • Do: set email [email address]
  • Do: run
  • Verify the settings were changed
  • Document docs look good

@h00die
Copy link
Contributor Author

h00die commented Oct 17, 2021

If accepted, please add the 'hacktoberfest-accepted' label :)

Copy link
Contributor

@jmartin-tech jmartin-tech left a comment

Choose a reason for hiding this comment

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

This looks good, thank you!

Some minor comments on metadata and logging messages.

]

register_advanced_options [
OptString.new('WPEMAIL', [false, 'Wordpress Administration Email (default: no email modification)', nil])
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
OptString.new('WPEMAIL', [false, 'Wordpress Administration Email (default: no email modification)', nil])
OptString.new('WpEmail', [false, 'Wordpress Administration Email (default: no email modification)', nil])

This is registered as advanced.

Or since this is presented as an option that needed to be called out in descriptions it feels like this may be better presented as a standard option defaulted to nil.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I modeled this after

OptString.new('WPEMAIL', [false, 'Wordpress Administration Email (default: no email modification)', nil])
since they are extremely similar. Can change, but just want to be consistent.

Copy link
Contributor

@jmartin-tech jmartin-tech Oct 21, 2021

Choose a reason for hiding this comment

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

Understood, the comment was made base on review of this module and what I think a user would like to see when reviewing options for this module.

I can live with it as is. To be honest, I still fall on the side of this being an optional standard option for both modules.

@h00die
Copy link
Contributor Author

h00die commented Oct 30, 2021

@jmartin-r7 was there anything still pending on this?

@jmartin-tech
Copy link
Contributor

@h00die all my requests are handled, testing is still in queue.

@cdelafuente-r7 cdelafuente-r7 self-assigned this Nov 4, 2021
Copy link
Contributor

@cdelafuente-r7 cdelafuente-r7 left a comment

Choose a reason for hiding this comment

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

Thanks for this module @h00die! I just left a few minor comments for you to review. Otherwise, it looks good to me. I'll start testing now.

return Exploit::CheckCode::Safe('Wordpress not detected.') unless wordpress_and_online?

# this is for pickup into the vulnerable plugins list
# check_plugin_version_from_readme('wp-automatic', '3.53.3')
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 out of scope, but I'm just wondering if there would be a way to avoid adding a comment to be picked up by the update_wordpress_vulnerabilities.rb tool. Maybe using a specific info hash key/value pair, such as 'WordpressVulnType' => 'plugin'.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in general, like 90+% of plugins use that function, so it seemed like the right answer (especially when not trying to change all of wordpress modules). In theory, anything could be changed, but since wordpress plugin modules tend to be such a small portion of the framework, I didn't want to make anything global.

@cdelafuente-r7
Copy link
Contributor

Thanks for making these changes @h00die ! Everything looks good now. I tested against Wordpress 5.8.1 with Automatic 3.50.7 and verified a new user was created with the correct email, with the admin role. I'll go ahead and land it.

@cdelafuente-r7 cdelafuente-r7 merged commit 836422f into rapid7:master Nov 5, 2021
@cdelafuente-r7 cdelafuente-r7 added the rn-modules release notes for new or majorly enhanced modules label Nov 5, 2021
@cdelafuente-r7
Copy link
Contributor

Release Notes

This adds an auxiliary module that leverages an unauthenticated arbitrary Wordpress options change vulnerability
in the Automatic (wp-automatic) plugin version 3.53.2 and below. The module enables user registration, sets the default user role to admin and create a new privileged user with the provided email address.

@h00die h00die deleted the wp_automatic branch November 5, 2021 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs hacktoberfest-accepted 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

4 participants