@@ -23,7 +23,7 @@ def initialize(info={})
23
23
register_options (
24
24
[
25
25
Opt ::RPORT ( 5984 ) ,
26
- OptString . new ( 'TARGETURI' , [ true , "TARGETURI for CouchDB. Default here is /_users/_all_docs" , "/_users/_all_docs " ] ) ,
26
+ OptString . new ( 'TARGETURI' , [ false , "TARGETURI for CouchDB. Default here is /_users/_all_docs" , "/" ] ) ,
27
27
OptPath . new ( 'USERPASS_FILE' , [ false , "File containing users and passwords separated by space, one pair per line" ,
28
28
File . join ( Msf ::Config . install_root , "data" , "wordlists" , "http_default_userpass.txt" ) ] ) ,
29
29
OptPath . new ( 'USER_FILE' , [ false , "File containing users, one per line" ,
@@ -40,8 +40,9 @@ def run_host(ip)
40
40
41
41
vprint_status ( "#{ rhost } :#{ rport } - Trying to login with '#{ user } ' : '#{ pass } '" )
42
42
43
+ uri = target_uri . path
43
44
res = send_request_cgi ( {
44
- 'uri' => normalize_uri ( datastore [ 'TARGETURI' ] ) ,
45
+ 'uri' => normalize_uri ( uri , '_users/_all_docs' ) ,
45
46
'method' => 'GET' ,
46
47
'authorization' => basic_auth ( user , pass )
47
48
} )
@@ -66,9 +67,10 @@ def run_host(ip)
66
67
def do_login ( user , pass )
67
68
vprint_status ( "Trying username:'#{ user } ' with password:'#{ pass } '" )
68
69
begin
70
+ uri = target_uri . path
69
71
res = send_request_cgi (
70
72
{
71
- 'uri' => normalize_uri ( datastore [ 'TARGETURI' ] ) ,
73
+ 'uri' => normalize_uri ( uri , '_users/_all_docs' ) ,
72
74
'method' => 'GET' ,
73
75
'ctype' => 'text/plain' ,
74
76
'authorization' => basic_auth ( user , pass )
0 commit comments