Skip to content

Commit 7f3df74

Browse files
committed
fixup! Adding Module for Postfixadmin CVE-2017-5930
Add error handling if request fails Fix a typo in doc, add default value to doc
1 parent 289e887 commit 7f3df74

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/auxiliary/admin/http/pfadmin_set_protected_alias.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def run
8787

8888
vprint_status('Requesting virtual_list')
8989
res = send_request_cgi({'uri' => postfixadmin_url_list(target_alias.split("@")[-1]), 'method' => 'GET', 'cookie' => cookie }, 10)
90+
fail_with(Failure::UnexpectedReply, 'The request for the domain list failed') if res.nil?
9091
fail_with(Failure::NoAccess, 'Doesn\'t seem to be admin for the domain the target alias is in') if res.redirect?
9192
body = res.body
9293
vprint_status('Get token')
@@ -144,9 +145,9 @@ def run
144145
#
145146
# @param user [String] Username
146147
# @param pass [String] Password
147-
# @param timeout [Integer] Max seconds to wait before timeout
148+
# @param timeout [Integer] Max seconds to wait before timeout, defaults to 20
148149
#
149-
# @return [String, nil] The session cocie as single string if login was successful, nil otherwise
150+
# @return [String, nil] The session cookie as single string if login was successful, nil otherwise
150151
def postfixadmin_login(user, pass, timeout = 20)
151152
res = send_request_cgi({
152153
'method' => 'POST',

0 commit comments

Comments
 (0)