Skip to content

Commit 84cacb5

Browse files
committed
TeamCity: Fire and forget logout request
1 parent ef51254 commit 84cacb5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/metasploit/framework/login_scanner/teamcity.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def try_login(username, password, public_key)
129129
# Send a logout request for the provided user's headers.
130130
# This header stores the user's cookie.
131131
# @return [Hash] A hash with the status and an error or the response.
132-
def logout(headers)
132+
def logout_with_headers(headers)
133133
logout_params = {
134134
'method' => 'POST',
135135
'uri' => normalize_uri(@uri.to_s, LOGOUT_PAGE),
@@ -169,8 +169,7 @@ def attempt_login(credential)
169169
return Result.new(result_options.merge(login_result)) if login_result[:status] != :success
170170

171171
# Ensure we log the user out, so that our logged in session does not appear under the user's profile.
172-
logout_result = logout(login_result[:proof].headers)
173-
return Result.new(result_options.merge(logout_result)) if logout_result[:status] != :success
172+
logout_with_headers(login_result[:proof].headers)
174173

175174
result_options[:status] = SUCCESSFUL
176175
Result.new(result_options)

0 commit comments

Comments
 (0)