@@ -14,17 +14,16 @@ def initialize(info = {})
14
14
super ( update_info ( info ,
15
15
'Name' => 'CouchDB Enum Utility' ,
16
16
'Description' => %q{
17
- This module enumerates databases and your values on CouchDB
18
- (without authentication by default). It uses the REST API
19
- in order to make it.
17
+ This module enumerates databases on CouchDB using the REST API
18
+ (without authentication by default).
20
19
} ,
21
- 'References' =>
20
+ 'References' =>
22
21
[
23
22
[ 'URL' , 'https://wiki.apache.org/couchdb/HTTP_database_API' ]
24
23
] ,
25
24
'Author' => [ 'Roberto Soares Espreto <robertoespreto[at]gmail.com>' ] ,
26
25
'License' => MSF_LICENSE
27
- ) )
26
+ ) )
28
27
29
28
register_options (
30
29
[
@@ -40,20 +39,19 @@ def run
40
39
password = datastore [ 'PASSWORD' ]
41
40
42
41
begin
43
- res = send_request_cgi ( {
42
+ res = send_request_cgi (
44
43
'uri' => normalize_uri ( target_uri . path ) ,
45
44
'method' => 'GET' ,
46
45
'authorization' => basic_auth ( username , password )
47
- } )
46
+ )
48
47
49
48
temp = JSON . parse ( res . body )
50
49
rescue ::Rex ::ConnectionRefused , ::Rex ::HostUnreachable , JSON ::ParserError => e
51
50
print_error ( "#{ peer } - The following Error was encountered: #{ e . class } " )
52
51
return
53
52
end
54
53
55
- if res . code == 200 && res . headers [ 'Server' ] =~ /CouchDB/
56
-
54
+ if res . code == 200 && res . headers [ 'Server' ] . include? ( 'CouchDB' )
57
55
print_status ( 'Enumerating...' )
58
56
results = JSON . pretty_generate ( temp )
59
57
print_good ( "Found:\n \n #{ results } \n " )
0 commit comments