Skip to content

Commit b5cbfc5

Browse files
committed
mimikatz (wdigest password) module added
Former-commit-id: 2049543 [formerly 2049543 [formerly 2049543 [formerly f9dc346]]] Former-commit-id: 9c63871620b31a3f70197a37dbcb09929a2ed26b Former-commit-id: 41e6426 Former-commit-id: c9cd40c
1 parent da9cb31 commit b5cbfc5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+963
-408
lines changed

CHANGELOG

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
LaZagne 2.3.2 (13/03/2018)
1+
LaZagne 2.3.2 (21/03/2018)
22
- Windows
33
* Big code review
44
* Lots of minor bug fixed
@@ -7,6 +7,11 @@ LaZagne 2.3.2 (13/03/2018)
77
* New modules added postgresql and psi-im (thanks to @m41nt41n3r)
88
* XP managed
99
* Adding support for newest firefox version. Awesome work from lclevy: https://github.com/lclevy/firepwd
10+
* Adding Wdigest passwords (using mimikatz signature)
11+
* Works on Vista / Win7 x86 and x64
12+
* Thanks to
13+
* n1nj4sec for https://github.com/n1nj4sec/memorpy/
14+
* Francesco Picasso for https://github.com/RealityNet/hotoloti/blob/master/volatility/mimikatz.py
1015

1116
- Linux
1217
* Big code review

Windows/laZagne.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# Configuration
1616
from lazagne.config.write_output import parseJsonResultToBuffer, print_debug, StandartOutput
17-
from lazagne.config.changePrivileges import ListSids, rev2self, impersonate_sid_long_handle
17+
from lazagne.config.change_privileges import list_sids, rev2self, impersonate_sid_long_handle
1818
from lazagne.config.manageModules import get_categories, get_modules
1919
from lazagne.config.dpapi_structure import *
2020
from lazagne.config.constant import *
@@ -115,7 +115,7 @@ def launch_module(module, dpapi_used=True, registry_used=True, system_module=Fal
115115
if args[i] and i in module:
116116
modulesToLaunch.append(i)
117117
except:
118-
# if no args
118+
# If no args
119119
pass
120120

121121
# Launch all modules
@@ -142,7 +142,7 @@ def launch_module(module, dpapi_used=True, registry_used=True, system_module=Fal
142142
)
143143
continue
144144

145-
# run module
145+
# Run module
146146
for m in run_module(title=i, module=module[i]):
147147
yield m
148148

@@ -169,9 +169,9 @@ def runModule(category_choosed, dpapi_used=True, registry_used=True, system_modu
169169
yield r
170170

171171
if constant.module_to_exec_at_end:
172-
# these modules will need the windows user password to be able to decrypt dpapi blobs
172+
# These modules will need the windows user password to be able to decrypt dpapi blobs
173173
constant.dpapi = Decrypt_DPAPI(password=constant.user_password)
174-
# add username to check username equals passwords
174+
# Add username to check username equals passwords
175175
constant.passwordFound.append(constant.username)
176176
constant.dpapi.check_credentials(constant.passwordFound)
177177

@@ -224,7 +224,7 @@ def get_user_list_on_filesystem(impersonated_user=[]):
224224
return all_users
225225

226226
def set_env_variables(user, toImpersonate=False):
227-
# restore template path
227+
# Restore template path
228228
template_path = {
229229
'APPDATA' : u'{drive}:\\Users\\{user}\\AppData\\Roaming\\',
230230
'USERPROFILE' : u'{drive}:\\Users\\{user}\\',
@@ -262,7 +262,7 @@ def clean_temporary_files():
262262

263263
def runLaZagne(category_choosed='all', password=None):
264264

265-
# useful if this function is called from another tool
265+
# Useful if this function is called from another tool
266266
if password:
267267
constant.user_password = password
268268

@@ -285,7 +285,7 @@ def runLaZagne(category_choosed='all', password=None):
285285

286286
# --------- Impersonation using tokens ---------
287287

288-
sids = ListSids()
288+
sids = list_sids()
289289
impersonateUsers = {}
290290
impersonated_user = [constant.username]
291291

@@ -403,6 +403,7 @@ def runLaZagne(category_choosed='all', password=None):
403403
categories[c]['subparser'] += tmp
404404

405405
# ------------------------------------------- Print all -------------------------------------------
406+
406407
parents = [PPoptional] + all_subparser + [PPwd, PWrite]
407408
dic = {'all':{'parents':parents, 'help':'Run all modules', 'func': runModule}}
408409
for c in categories:

Windows/lazagne/config/DPAPI/masterkey.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@ def decrypt_with_password(self, sid, pwd):
4040
Decrypts the masterkey with the given user's password and SID.
4141
Simply computes the corresponding key, then calls self.decrypt_with_hash()
4242
"""
43+
try:
44+
pwd = pwd.encode("UTF-16LE")
45+
except:
46+
return
47+
4348
for algo in ["sha1", "md4"]:
44-
self.decrypt_with_hash(sid=sid, pwdhash=hashlib.new(algo, pwd.encode("UTF-16LE")).digest())
49+
self.decrypt_with_hash(sid=sid, pwdhash=hashlib.new(algo, pwd).digest())
4550
if self.decrypted:
4651
break
4752

@@ -136,7 +141,7 @@ def __init__(self):
136141
'password' : None, # contains cleartext password
137142
'keys' : [], # contains all decrypted mk keys
138143
}
139-
)
144+
)
140145
self.mkfiles = []
141146
self.credhists = {}
142147
self.mk_dir = None
@@ -177,7 +182,7 @@ def get_master_keys(self, guid):
177182
"""
178183
Returns an array of Masterkeys corresponding to the given GUID.
179184
"""
180-
return self.keys.get(guid, [])['keys']
185+
return self.keys.get(guid, {}).get('keys')
181186

182187
def get_password(self, guid):
183188
"""

Windows/lazagne/config/changePrivileges.py

Lines changed: 0 additions & 196 deletions
This file was deleted.

0 commit comments

Comments
 (0)