Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/misc/wordpress/add_user/module.rb
1154 views
1
#
2
# Copyright (c) Browser Exploitation Framework (BeEF) - https://beefproject.com
3
# See the file 'doc/COPYING' for copying permission
4
#
5
# This is a complete rewrite of the original module exploits/wordpress_add_admin which was not working anymore
6
#
7
# Original Author: Daniel Reece (@HBRN8).
8
# Rewritten by Erwan LR (@erwan_lr | WPScanTeam) - https://wpscan.org/
9
#
10
require_relative '../wordpress_command'
11
12
class Wordpress_add_user < WordPressCommand
13
def self.options
14
super() + [
15
{ 'name' => 'username', 'ui_label' => 'Username', 'value' => 'beef' },
16
{ 'name' => 'password', 'ui_label' => 'Pwd', 'value' => SecureRandom.hex(5) },
17
{ 'name' => 'email', 'ui_label' => 'Email', 'value' => '' },
18
{ 'name' => 'role',
19
'type' => 'combobox',
20
'ui_label' => 'Role',
21
'store_type' => 'arraystore',
22
'store_fields' => ['role'],
23
'store_data' => [['administrator'], ['editor'], ['author'], ['contributor'], ['subscriber']],
24
'value' => 'administrator',
25
'valueField' => 'role',
26
'displayField' => 'role',
27
'mode' => 'local' }
28
# { 'name' => 'domail', 'type' => 'checkbox', 'ui_label' => 'Success mail?:', 'checked' => 'true' },
29
# If one day optional options are supported:
30
# { 'name' => 'url', 'ui_label' => 'Website:', 'value' => '' },
31
# { 'name' => 'fname', 'ui_label' => 'FirstName:', 'value' => '' },
32
# { 'name' => 'lname', 'ui_label' => 'LastName:', 'value' => '' }
33
]
34
end
35
end
36
37