Skip to content

Commit c0efb7b

Browse files
committed
Land rapid7#8573, Adapted the authentitcity_token scheme
2 parents 722d9a2 + ef7434b commit c0efb7b

File tree

1 file changed

+4
-0
lines changed
  • lib/metasploit/framework/login_scanner

1 file changed

+4
-0
lines changed

lib/metasploit/framework/login_scanner/gitlab.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ def attempt_login(credential)
6161
local_session_cookie = res.get_cookies.scan(/(_gitlab_session=[A-Za-z0-9%-]+)/).flatten[0]
6262
auth_token = res.body.scan(/<input name="authenticity_token" type="hidden" value="(.*?)"/).flatten[0]
6363

64+
# New versions of GitLab use an alternative scheme
65+
# Try it, if the old one was not successfull
66+
auth_token = res.body.scan(/<input type="hidden" name="authenticity_token" value="(.*?)"/).flatten[0] unless auth_token
67+
6468
fail RuntimeError, 'Unable to get Session Cookie' unless local_session_cookie
6569
fail RuntimeError, 'Unable to get Authentication Token' unless auth_token
6670

0 commit comments

Comments
 (0)