@@ -14,14 +14,13 @@ class MetasploitModule < Msf::Auxiliary
14
14
15
15
def initialize
16
16
super (
17
- 'Name' => 'GitLab Login Utility' ,
17
+ 'Name' => 'GitLab Login Utility' ,
18
18
'Description' => 'This module attempts to login to a GitLab instance using a specific user/pass.' ,
19
- 'Author' => [ 'Ben Campbell' ] ,
20
- 'License' => MSF_LICENSE ,
21
- 'References' =>
22
- [
23
- [ 'URL' , 'https://labs.f-secure.com/archive/gitlab-user-enumeration/' ]
24
- ]
19
+ 'Author' => [ 'Ben Campbell' ] ,
20
+ 'License' => MSF_LICENSE ,
21
+ 'References' => [
22
+ [ 'URL' , 'https://labs.f-secure.com/archive/gitlab-user-enumeration/' ]
23
+ ]
25
24
)
26
25
27
26
register_options (
@@ -30,31 +29,32 @@ def initialize
30
29
OptString . new ( 'HttpUsername' , [ true , 'The username to test' , 'root' ] ) ,
31
30
OptString . new ( 'HttpPassword' , [ true , 'The password to test' , '5iveL!fe' ] ) ,
32
31
OptString . new ( 'TARGETURI' , [ true , 'The path to GitLab' , '/' ] )
33
- ] )
32
+ ]
33
+ )
34
34
35
35
register_autofilter_ports ( [ 80 , 443 ] )
36
36
end
37
37
38
38
def run_host ( ip )
39
39
uri = normalize_uri ( target_uri . path . to_s , 'users' , 'sign_in' )
40
40
res = send_request_cgi (
41
- 'method' => 'GET' ,
42
- 'cookie' => 'request_method=GET' ,
43
- 'uri' => uri
41
+ 'method' => 'GET' ,
42
+ 'cookie' => 'request_method=GET' ,
43
+ 'uri' => uri
44
44
)
45
45
46
46
if res && res . body && res . body . include? ( 'user[email]' )
47
- vprint_status ( " GitLab v5 login page" )
47
+ vprint_status ( ' GitLab v5 login page' )
48
48
elsif res && res . body && res . body . include? ( 'user[login]' )
49
- vprint_status ( " GitLab v7 login page" )
49
+ vprint_status ( ' GitLab v7 login page' )
50
50
else
51
51
vprint_error ( 'Not a valid GitLab login page' )
52
52
return
53
53
end
54
54
55
55
cred_collection = build_credential_collection (
56
- username : datastore [ 'HttpUsername ' ] ,
57
- password : datastore [ 'HttpPassword ' ]
56
+ username : datastore [ 'USERNAME ' ] ,
57
+ password : datastore [ 'PASSWORD ' ]
58
58
)
59
59
60
60
scanner = Metasploit ::Framework ::LoginScanner ::GitLab . new (
@@ -70,8 +70,8 @@ def run_host(ip)
70
70
scanner . scan! do |result |
71
71
credential_data = result . to_h
72
72
credential_data . merge! (
73
- module_fullname : fullname ,
74
- workspace_id : myworkspace_id
73
+ module_fullname : fullname ,
74
+ workspace_id : myworkspace_id
75
75
)
76
76
if result . success?
77
77
credential_core = create_credential ( credential_data )
0 commit comments