forked from AlessandroZ/LaZagne
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bugs (wifi + ie), adding Windows hashes and secrets
- Loading branch information
1 parent
1f91b4d
commit e4c84e1
Showing
9 changed files
with
1,243 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import subprocess | ||
import os, sys | ||
from secretsdump import retrieve_hash | ||
from config.header import Header | ||
from config.write_output import print_debug | ||
from ctypes import * | ||
import logging | ||
|
||
class Secrets(): | ||
def __init__(self): | ||
self.sysFile = ['sam', 'security', 'system'] | ||
self.address = 'LOCAL' | ||
self.ntds = os.environ['systemroot'] + os.sep + 'ntds' + os.sep + 'ntds.dit' | ||
if not os.path.exists(self.ntds): | ||
self.ntds = None | ||
self.history = True | ||
|
||
# check if files have been saved | ||
def check_existing_systemFiles(self): | ||
for f in self.sysFile: | ||
if not os.path.exists('%s.save' % f): | ||
return False | ||
return True | ||
|
||
def delete_existing_systemFiles(self): | ||
for f in self.sysFile: | ||
os.remove('%s.save' % f) | ||
|
||
def retrieve_password(self): | ||
# Need admin privileges | ||
if not windll.Shell32.IsUserAnAdmin(): | ||
if logging.getLogger().isEnabledFor(logging.DEBUG) == True: | ||
Header().title_info('Windows Secrets') | ||
print_debug('ERROR', '[!] This script should be run as admin!') | ||
return | ||
|
||
# print the title | ||
Header().title_info('Windows Secrets') | ||
|
||
# if hives already exists | ||
if self.check_existing_systemFiles(): | ||
self.delete_existing_systemFiles() # delete it | ||
|
||
# save system hives | ||
for f in self.sysFile: | ||
subprocess.Popen('reg.exe save hklm\%s %s.save' % (f,f) , shell=True, stdout=subprocess.PIPE).stdout.read() | ||
|
||
if not self.check_existing_systemFiles(): | ||
print_debug('WARNING', 'Remove existing hive files and launch it again.') | ||
return | ||
|
||
retrieve_hash(self.address, '%s.save' % self.sysFile[2], '%s.save' % self.sysFile[1], '%s.save' % self.sysFile[0], self.ntds, self.history) | ||
|
||
# remove hives files | ||
self.delete_existing_systemFiles() | ||
|
||
|
Oops, something went wrong.