Skip to content

Commit be47648

Browse files
committed
Fix and Rubocop formatting
1 parent 233f6dc commit be47648

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

modules/auxiliary/scanner/http/gitlab_login.rb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ class MetasploitModule < Msf::Auxiliary
1414

1515
def initialize
1616
super(
17-
'Name' => 'GitLab Login Utility',
17+
'Name' => 'GitLab Login Utility',
1818
'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+
]
2524
)
2625

2726
register_options(
@@ -30,31 +29,32 @@ def initialize
3029
OptString.new('HttpUsername', [ true, 'The username to test', 'root' ]),
3130
OptString.new('HttpPassword', [ true, 'The password to test', '5iveL!fe' ]),
3231
OptString.new('TARGETURI', [true, 'The path to GitLab', '/'])
33-
])
32+
]
33+
)
3434

3535
register_autofilter_ports([ 80, 443 ])
3636
end
3737

3838
def run_host(ip)
3939
uri = normalize_uri(target_uri.path.to_s, 'users', 'sign_in')
4040
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
4444
)
4545

4646
if res && res.body && res.body.include?('user[email]')
47-
vprint_status("GitLab v5 login page")
47+
vprint_status('GitLab v5 login page')
4848
elsif res && res.body && res.body.include?('user[login]')
49-
vprint_status("GitLab v7 login page")
49+
vprint_status('GitLab v7 login page')
5050
else
5151
vprint_error('Not a valid GitLab login page')
5252
return
5353
end
5454

5555
cred_collection = build_credential_collection(
56-
username: datastore['HttpUsername'],
57-
password: datastore['HttpPassword']
56+
username: datastore['USERNAME'],
57+
password: datastore['PASSWORD']
5858
)
5959

6060
scanner = Metasploit::Framework::LoginScanner::GitLab.new(
@@ -70,8 +70,8 @@ def run_host(ip)
7070
scanner.scan! do |result|
7171
credential_data = result.to_h
7272
credential_data.merge!(
73-
module_fullname: fullname,
74-
workspace_id: myworkspace_id
73+
module_fullname: fullname,
74+
workspace_id: myworkspace_id
7575
)
7676
if result.success?
7777
credential_core = create_credential(credential_data)

0 commit comments

Comments
 (0)