8
8
require 'metasploit/framework/login_scanner/jenkins'
9
9
10
10
class Metasploit3 < Msf ::Auxiliary
11
-
12
11
include Msf ::Auxiliary ::Scanner
13
12
include Msf ::Exploit ::Remote ::HttpClient
14
13
include Msf ::Auxiliary ::Report
15
14
include Msf ::Auxiliary ::AuthBrute
16
-
15
+
17
16
def initialize
18
17
super (
19
18
'Name' => 'Jenkins-CI Login Utility' ,
@@ -28,7 +27,7 @@ def initialize
28
27
] , self . class )
29
28
30
29
register_autofilter_ports ( [ 80 , 443 , 8080 , 8081 , 8000 ] )
31
-
30
+
32
31
deregister_options ( 'RHOST' )
33
32
end
34
33
@@ -40,7 +39,7 @@ def run_host(ip)
40
39
user_file : datastore [ 'USER_FILE' ] ,
41
40
userpass_file : datastore [ 'USERPASS_FILE' ] ,
42
41
username : datastore [ 'USERNAME' ] ,
43
- user_as_pass : datastore [ 'USER_AS_PASS' ] ,
42
+ user_as_pass : datastore [ 'USER_AS_PASS' ]
44
43
)
45
44
46
45
scanner = Metasploit ::Framework ::LoginScanner ::Jenkins . new (
@@ -53,11 +52,11 @@ def run_host(ip)
53
52
user_agent : datastore [ 'UserAgent' ] ,
54
53
vhost : datastore [ 'VHOST' ]
55
54
)
56
-
55
+
57
56
scanner . scan! do |result |
58
57
credential_data = result . to_h
59
58
credential_data . merge! (
60
- module_fullname : self . fullname ,
59
+ module_fullname : fullname ,
61
60
workspace_id : myworkspace_id
62
61
)
63
62
if result . success?
@@ -68,10 +67,8 @@ def run_host(ip)
68
67
print_good "#{ ip } :#{ rport } - LOGIN SUCCESSFUL: #{ result . credential } "
69
68
else
70
69
invalidate_login ( credential_data )
71
- vprint_status "#{ ip } :#{ rport } - LOGIN FAILED: #{ result . credential } (#{ result . status } : #{ result . proof } )"
70
+ print_status "#{ ip } :#{ rport } - LOGIN FAILED: #{ result . credential } (#{ result . status } )"
72
71
end
73
72
end
74
-
75
73
end
76
-
77
74
end
0 commit comments