Beispiel #1
0
    def testProcess(self):
        """Tests the Process function."""
        key_path = (
            'HKEY_CURRENT_USER\\Software\\Microsoft\\Office\\15.0\\Outlook\\'
            'Search')
        time_string = '2012-08-28 09:23:49.002031'
        registry_key = self._CreateTestKey(key_path, time_string)

        plugin = outlook.OutlookSearchMRUPlugin()
        storage_writer = self._ParseKeyWithPlugin(registry_key, plugin)

        self.assertEqual(storage_writer.number_of_warnings, 0)
        self.assertEqual(storage_writer.number_of_events, 1)

        events = list(storage_writer.GetEvents())

        event = events[0]

        # This should just be the plugin name, as we're invoking it directly,
        # and not through the parser.
        self.assertEqual(event.parser, plugin.plugin_name)

        self.CheckTimestamp(event.timestamp, '2012-08-28 09:23:49.002031')

        expected_message = (
            '[{0:s}] '
            'C:\\Users\\username\\AppData\\Local\\Microsoft\\Outlook\\'
            '[email protected]: 0x00372bcf').format(key_path)
        expected_short_message = '{0:s}...'.format(expected_message[:77])

        self._TestGetMessageStrings(event, expected_message,
                                    expected_short_message)
Beispiel #2
0
    def testProcess(self):
        """Tests the Process function."""
        key_path = (
            'HKEY_CURRENT_USER\\Software\\Microsoft\\Office\\15.0\\Outlook\\'
            'Search')
        time_string = '2012-08-28 09:23:49.002031'
        registry_key = self._CreateTestKey(key_path, time_string)

        plugin = outlook.OutlookSearchMRUPlugin()
        storage_writer = self._ParseKeyWithPlugin(registry_key, plugin)

        self.assertEqual(storage_writer.number_of_events, 1)
        self.assertEqual(storage_writer.number_of_extraction_warnings, 0)
        self.assertEqual(storage_writer.number_of_recovery_warnings, 0)

        events = list(storage_writer.GetEvents())

        expected_event_values = {
            'date_time':
            '2012-08-28 09:23:49.0020310',
            'data_type':
            'windows:registry:outlook_search_mru',
            'entries':
            ('C:\\Users\\username\\AppData\\Local\\Microsoft\\Outlook\\'
             '[email protected]: 0x00372bcf'),
            'key_path':
            key_path,
            # This should just be the plugin name, as we're invoking it directly,
            # and not through the parser.
            'parser':
            plugin.NAME
        }

        self.CheckEventValues(storage_writer, events[0], expected_event_values)
Beispiel #3
0
  def testProcess(self):
    """Tests the Process function."""
    key_path = (
        u'HKEY_CURRENT_USER\\Software\\Microsoft\\Office\\15.0\\Outlook\\'
        u'Search')
    time_string = u'2012-08-28 09:23:49.002031'
    registry_key = self._CreateTestKey(key_path, time_string)

    plugin_object = outlook.OutlookSearchMRUPlugin()
    storage_writer = self._ParseKeyWithPlugin(registry_key, plugin_object)

    self.assertEqual(len(storage_writer.events), 1)

    event_object = storage_writer.events[0]

    # This should just be the plugin name, as we're invoking it directly,
    # and not through the parser.
    self.assertEqual(event_object.parser, plugin_object.plugin_name)

    expected_timestamp = timelib.Timestamp.CopyFromString(time_string)
    self.assertEqual(event_object.timestamp, expected_timestamp)

    expected_message = (
        u'[{0:s}] '
        u'C:\\Users\\username\\AppData\\Local\\Microsoft\\Outlook\\'
        u'[email protected]: 0x00372bcf').format(key_path)
    expected_short_message = u'{0:s}...'.format(expected_message[:77])

    self._TestGetMessageStrings(
        event_object, expected_message, expected_short_message)
Beispiel #4
0
    def testFilters(self):
        """Tests the FILTERS class attribute."""
        plugin = outlook.OutlookSearchMRUPlugin()

        key_path = (
            'HKEY_CURRENT_USER\\Software\\Microsoft\\Office\\14.0\\Outlook\\'
            'Search')
        self._AssertFiltersOnKeyPath(plugin, key_path)

        key_path = (
            'HKEY_CURRENT_USER\\Software\\Microsoft\\Office\\15.0\\Outlook\\'
            'Search')
        self._AssertFiltersOnKeyPath(plugin, key_path)

        self._AssertNotFiltersOnKeyPath(plugin, 'HKEY_LOCAL_MACHINE\\Bogus')
Beispiel #5
0
 def setUp(self):
     """Sets up the needed objects used throughout the test."""
     self._plugin = outlook.OutlookSearchMRUPlugin()
Beispiel #6
0
 def setUp(self):
     """Makes preparations before running an individual test."""
     self._plugin = outlook.OutlookSearchMRUPlugin()