Skip to content

Commit fad4cce

Browse files
committed
Only use basic auth in couchdb_enum when credentials are provided
1 parent 8ea5057 commit fad4cce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/auxiliary/scanner/couchdb/couchdb_enum.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ def initialize(info = {})
3434
def run
3535
username = datastore['HttpUsername']
3636
password = datastore['HttpPassword']
37+
auth = basic_auth(username, password) if username && password
3738

3839
begin
3940
res = send_request_cgi(
4041
'uri' => normalize_uri(target_uri.path),
4142
'method' => 'GET',
42-
'authorization' => basic_auth(username, password)
43+
'authorization' => auth
4344
)
4445

4546
temp = JSON.parse(res.body)

0 commit comments

Comments
 (0)