@@ -20,8 +20,8 @@ def initialize(info = {})
20
20
The Gitlab 'internal' API is exposed unauthenticated on Gitlab. This
21
21
allows the username for each SSH Key ID number to be retrieved. Users
22
22
who do not have an SSH Key cannot be enumerated in this fashion. LDAP
23
- users, e.g. Active Directory users will also be returned.
24
- This issue was fixed in Gitlab v7.5.0.
23
+ users, e.g. Active Directory users will also be returned. This issue
24
+ was fixed in Gitlab v7.5.0 and is present from Gitlab v5.0 .0.
25
25
" ,
26
26
'Author' => 'Ben Campbell' ,
27
27
'License' => MSF_LICENSE ,
@@ -41,8 +41,7 @@ def initialize(info = {})
41
41
end
42
42
43
43
def run_host ( _ip )
44
- api = '/api/v3'
45
- internal_api = "#{ api } /internal"
44
+ internal_api = '/api/v3/internal'
46
45
check = normalize_uri ( target_uri . path , internal_api , 'check' )
47
46
48
47
print_status ( 'Sending gitlab version request...' )
@@ -56,7 +55,7 @@ def run_host(_ip)
56
55
git_revision = version [ 'gitlab_rev' ]
57
56
print_good ( "GitLab version: #{ git_version } revision: #{ git_revision } " )
58
57
59
- report_service (
58
+ service = report_service (
60
59
host : rhost ,
61
60
port : rport ,
62
61
name : ( ssl ? 'https' : 'http' ) ,
@@ -106,19 +105,11 @@ def run_host(_ip)
106
105
end
107
106
108
107
unless users . nil? || users . to_s . empty?
109
- store_userlist ( users )
108
+ store_userlist ( users , service )
110
109
end
111
110
end
112
111
113
- def store_userlist ( users )
114
- name = datastore [ 'SSL' ] ? 'https' : 'http'
115
- service = report_service (
116
- :host => rhost ,
117
- :port => rport ,
118
- :name => name ,
119
- :proto => 'tcp'
120
- )
121
-
112
+ def store_userlist ( users , service )
122
113
loot = store_loot ( 'gitlab.users' , 'text/plain' , rhost , users , nil , 'Gitlab Users' , service )
123
114
print_good ( "Userlist stored at #{ loot } " )
124
115
end
0 commit comments