Skip to content

Commit ef7434b

Browse files
authored
added new authentitcity_token scheme
1 parent 55b71e1 commit ef7434b

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)