# -*- coding: utf-8 -*-
"""File containing a Windows Registry plugin to parse the typed URLs key."""
import re
from plaso.containers import events
from plaso.parsers import winreg_parser
from plaso.parsers.winreg_plugins import interface
[docs]
class TypedURLsEventData(events.EventData):
"""Typed URLs event data attribute container.
Attributes:
entries (str): typed URLs or paths entries.
key_path (str): Windows Registry key path.
last_written_time (dfdatetime.DateTimeValues): entry last written date and
time.
"""
DATA_TYPE = 'windows:registry:typedurls'
[docs]
def __init__(self):
"""Initializes event data."""
super(TypedURLsEventData, self).__init__(data_type=self.DATA_TYPE)
self.entries = None
self.key_path = None
self.last_written_time = None
[docs]
class TypedURLsPlugin(interface.WindowsRegistryPlugin):
"""A Windows Registry plugin for typed URLs history."""
NAME = 'windows_typed_urls'
DATA_FORMAT = 'Windows Explorer typed URLs Registry data'
FILTERS = frozenset([
interface.WindowsRegistryKeyPathFilter(
'HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\'
'TypedURLs'),
interface.WindowsRegistryKeyPathFilter(
'HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\'
'Explorer\\TypedPaths')])
_RE_VALUE_NAME = re.compile(r'^url[0-9]+$', re.I)
winreg_parser.WinRegistryParser.RegisterPlugin(TypedURLsPlugin)