コード例 #1
0
ファイル: outlook.py プロジェクト: r4w4t/LaZagne
    def run(self):
        key_path = 'Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows Messaging Subsystem\\Profiles\\Outlook'
        try:
            hkey = win.OpenKey(win.HKEY_CURRENT_USER, key_path)
        except Exception as e:
            self.debug(e)
            return

        num = winreg.QueryInfoKey(hkey)[0]
        pwd_found = []
        for x in range(0, num):
            name = winreg.EnumKey(hkey, x)
            skey = win.OpenKey(hkey, name, 0, win.ACCESS_READ)

            num_skey = winreg.QueryInfoKey(skey)[0]
            if num_skey != 0:
                for y in range(0, num_skey):
                    name_skey = winreg.EnumKey(skey, y)
                    sskey = win.OpenKey(skey, name_skey)
                    num_sskey = winreg.QueryInfoKey(sskey)[1]

                    for z in range(0, num_sskey):
                        k = winreg.EnumValue(sskey, z)
                        if 'password' in k[0].lower():
                            values = self.retrieve_info(sskey, name_skey)

                            if values:
                                pwd_found.append(values)

            winreg.CloseKey(skey)
        winreg.CloseKey(hkey)
        return pwd_found
コード例 #2
0
    def trySingleKey(self, keyPath):
        try:
            hkey = win.OpenKey(win.HKEY_CURRENT_USER, keyPath)
        except Exception as e:
            self.debug(e)
            return

        num = winreg.QueryInfoKey(hkey)[0]
        pwd_found = []
        for x in range(0, num):
            name = winreg.EnumKey(hkey, x)
            skey = win.OpenKey(hkey, name, 0, win.ACCESS_READ)

            num_skey = winreg.QueryInfoKey(skey)[0]
            if num_skey != 0:
                for y in range(0, num_skey):
                    name_skey = winreg.EnumKey(skey, y)
                    sskey = win.OpenKey(skey, name_skey)
                    num_sskey = winreg.QueryInfoKey(sskey)[1]

                    for z in range(0, num_sskey):
                        k = winreg.EnumValue(sskey, z)
                        if 'password' in k[0].lower():
                            values = self.retrieve_info(sskey, name_skey)

                            if values:
                                pwd_found.append(values)

            winreg.CloseKey(skey)
        winreg.CloseKey(hkey)
        return pwd_found
コード例 #3
0
ファイル: outlook.py プロジェクト: w2n1ck/LaZagne
    def run(self, software_name=None):
        key_path = 'Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows Messaging Subsystem\\Profiles\\Outlook'
        try:
            hkey = win.OpenKey(win.HKEY_CURRENT_USER, key_path)
        except Exception as e:
            print_debug('DEBUG', str(e))
            print_debug('INFO', u'Outlook not installed or profile not saved')
            return

        num = _winreg.QueryInfoKey(hkey)[0]
        pwd_found = []
        for x in range(0, num):
            name = _winreg.EnumKey(hkey, x)
            skey = win.OpenKey(hkey, name, 0, win.ACCESS_READ)

            num_skey = _winreg.QueryInfoKey(skey)[0]
            if num_skey != 0:
                for y in range(0, num_skey):
                    name_skey = _winreg.EnumKey(skey, y)
                    sskey = win.OpenKey(skey, name_skey)
                    num_sskey = _winreg.QueryInfoKey(sskey)[1]

                    for z in range(0, num_sskey):
                        k = _winreg.EnumValue(sskey, z)
                        if 'password' in k[0].lower():
                            values = self.retrieve_info(sskey, name_skey)

                            if values:
                                pwd_found.append(values)

            _winreg.CloseKey(skey)
        _winreg.CloseKey(hkey)
        return pwd_found
コード例 #4
0
    def run(self):
        creds = []
        results = None

        # Find the location of steam - to make it easier we're going to use a try block
        # 'cos I'm lazy
        try:
            with win.OpenKey(win.HKEY_CURRENT_USER,
                             'Software\Valve\Steam') as key:
                results = winreg.QueryValueEx(key, 'SteamPath')
        except Exception:
            pass

        if results:
            steampath = string_to_unicode(results[0])
            steamapps = os.path.join(steampath, u'SteamApps\common')

            # Check that we have a SteamApps directory
            if not os.path.exists(steamapps):
                self.error(u'Steam doesn\'t have a SteamApps directory.')
                return

            filepath = os.path.join(steamapps, u'Turba\\Assets\\Settings.bin')

            if not os.path.exists(filepath):
                self.debug(u'Turba doesn\'t appear to be installed.')
                return

            # If we're here we should have a valid config file file
            with open(filepath, mode='rb') as filepath:
                # We've found a config file, now extract the creds
                data = filepath.read()
                chunk = data[0x1b:].split('\x0a')
                creds.append({'Login': chunk[0], 'Password': chunk[1]})
            return creds
コード例 #5
0
ファイル: ie.py プロジェクト: yongqin12/LaZagne
    def run(self, historic=''):
        if float(win.get_os_version()) > 6.1:
            print_debug(
                'INFO',
                u'Internet Explorer passwords are stored in Vault (check vault module)'
            )
            return

        pwd_found = []
        try:
            hkey = win.OpenKey(
                win.HKEY_CURRENT_USER,
                'Software\\Microsoft\\Internet Explorer\\IntelliForms\\Storage2'
            )
        except Exception:
            print_debug('DEBUG', traceback.format_exc())
        else:
            nb_site = 0
            nb_pass_found = 0
            lists = []
            if historic:
                if os.path.exists(historic):
                    f = open(historic, 'r')
                    for line in f:
                        lists.append(line.strip())
                else:
                    print_debug('WARNING',
                                u'The text file %s does not exist' % historic)

            # retrieve the urls from the history
            hash_tables = self.get_hash_table(lists)

            num = _winreg.QueryInfoKey(hkey)[1]
            for x in range(0, num):
                k = _winreg.EnumValue(hkey, x)
                if k:
                    nb_site += 1
                    for h in hash_tables:
                        # both hash are similar, we can decipher the password
                        if h[1] == k[0][:40].lower():
                            nb_pass_found += 1
                            cipher_text = k[1]
                            pwd_found += self.decipher_password(
                                cipher_text, h[0])
                            break

            _winreg.CloseKey(hkey)

            # manage errors
            if nb_site > nb_pass_found:
                print_debug(
                    'ERROR',
                    u'%s hashes have not been decrypted, the associate website used to decrypt the '
                    u'passwords has not been found' %
                    str(nb_site - nb_pass_found))

        return pwd_found
コード例 #6
0
    def get_regkey(self):
        try:
            key_path = 'Software\\Skype\\ProtectedStorage'
            try:
                hkey = win.OpenKey(win.HKEY_CURRENT_USER, key_path)
            except Exception, e:
                print_debug('DEBUG', str(e))
                return False

            # num = _winreg.QueryInfoKey(hkey)[1]
            k = _winreg.EnumValue(hkey, 0)[1]
            return win.Win32CryptUnprotectData(k)
コード例 #7
0
    def get_regkey(self):
        try:
            key_path = 'Software\\Skype\\ProtectedStorage'
            try:
                hkey = win.OpenKey(win.HKEY_CURRENT_USER, key_path)
            except Exception as e:
                self.debug(str(e))
                return False

            # num = winreg.QueryInfoKey(hkey)[1]
            k = winreg.EnumValue(hkey, 0)[1]
            return win.Win32CryptUnprotectData(k, is_current_user=constant.is_current_user, user_dpapi=constant.user_dpapi)
        except Exception as e:
            self.debug(str(e))
            return False
コード例 #8
0
    def history_from_regedit(self):
        urls = []
        try:
            hkey = win.OpenKey(win.HKEY_CURRENT_USER, 'Software\\Microsoft\\Internet Explorer\\TypedURLs')
        except Exception:
            self.debug(traceback.format_exc())
            return []

        num = winreg.QueryInfoKey(hkey)[1]
        for x in range(0, num):
            k = winreg.EnumValue(hkey, x)
            if k:
                urls.append(k[1])
        winreg.CloseKey(hkey)
        return urls
コード例 #9
0
    def run(self):
        if float(win.get_os_version()) > 6.1:
            self.debug(
                u'Internet Explorer passwords are stored in Vault (check vault module)'
            )
            return

        pwd_found = []
        try:
            hkey = win.OpenKey(
                win.HKEY_CURRENT_USER,
                'Software\\Microsoft\\Internet Explorer\\IntelliForms\\Storage2'
            )
        except Exception:
            self.debug(traceback.format_exc())
        else:
            nb_site = 0
            nb_pass_found = 0

            # retrieve the urls from the history
            hash_tables = self.get_hash_table()

            num = winreg.QueryInfoKey(hkey)[1]
            for x in range(0, num):
                k = winreg.EnumValue(hkey, x)
                if k:
                    nb_site += 1
                    for h in hash_tables:
                        # both hash are similar, we can decipher the password
                        if h[1] == k[0][:40].lower():
                            nb_pass_found += 1
                            cipher_text = k[1]
                            pwd_found += self.decipher_password(
                                cipher_text, h[0])
                            break

            winreg.CloseKey(hkey)

            # manage errors
            if nb_site > nb_pass_found:
                self.error(
                    u'%s hashes have not been decrypted, the associate website used to decrypt the '
                    u'passwords has not been found' %
                    str(nb_site - nb_pass_found))

        return pwd_found
コード例 #10
0
    def run(self, software_name=None):
        creds = []
        results = None

        # Find the location of steam - to make it easier we're going to use a try block
        # 'cos I'm lazy
        try:
            with win.OpenKey(win.HKEY_CURRENT_USER,
                             'Software\\Valve\\Steam') as key:
                results = _winreg.QueryValueEx(key, 'SteamPath')
        except Exception:
            pass

        if results:
            steampath = unicode(results[0])
            userdata = os.path.join(steampath, u'userdata')

            # Check that we have a userdata directory
            if not os.path.exists(userdata):
                print_debug('ERROR',
                            u'Steam doesn\'t have a userdata directory.')
                return

            # Now look for Galcon Fusion in every user
            for f in os.listdir(userdata):
                filepath = os.path.join(userdata, unicode(f),
                                        u'44200\\remote\\galcon.cfg')
                if not os.path.exists(filepath):
                    continue

                # If we're here we should have a Galcon Fusion file
                with open(filepath, mode='rb') as cfgfile:
                    # We've found a config file, now extract the creds
                    data = cfgfile.read()
                    creds.append({
                        'Login': data[4:0x23],
                        'Password': data[0x24:0x43]
                    })

            return creds