Esempio n. 1
0
  def testProcess(self):
    """Tests the Process function."""
    key_path = '\\ControlSet001\\Control\\BootVerificationProgram'
    time_string = '2012-08-31 20:45:29'
    registry_key = self._CreateTestKey(key_path, time_string)

    plugin = lfu.BootVerificationPlugin()
    storage_writer = self._ParseKeyWithPlugin(registry_key, plugin)

    self.assertEqual(storage_writer.number_of_events, 2)
    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-31 20:45:29.0000000',
        'data_type': 'windows:registry:boot_verification',
        'image_path': 'C:\\WINDOWS\\system32\\googleupdater.exe',
        '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)
Esempio n. 2
0
    def testProcess(self):
        """Tests the Process function."""
        key_path = '\\ControlSet001\\Control\\BootVerificationProgram'
        time_string = '2012-08-31 20:45:29'
        registry_key = self._CreateTestKey(key_path, time_string)

        plugin = lfu.BootVerificationPlugin()
        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]

        self.CheckTimestamp(event.timestamp, '2012-08-31 20:45:29.000000')

        event_data = self._GetEventDataOfEvent(storage_writer, event)

        # This should just be the plugin name, as we're invoking it directly,
        # and not through the parser.
        self.assertEqual(event_data.parser, plugin.plugin_name)
        self.assertEqual(event_data.data_type,
                         'windows:registry:boot_verification')

        expected_message = (
            '[{0:s}] '
            'ImagePath: C:\\WINDOWS\\system32\\googleupdater.exe'
        ).format(key_path)
        expected_short_message = '{0:s}...'.format(expected_message[:77])

        self._TestGetMessageStrings(event_data, expected_message,
                                    expected_short_message)
Esempio n. 3
0
    def testProcess(self):
        """Tests the Process function."""
        key_path = u'\\ControlSet001\\Control\\BootVerificationProgram'
        time_string = u'2012-08-31 20:45:29'
        registry_key = self._CreateTestKey(key_path, time_string)

        plugin = lfu.BootVerificationPlugin()
        storage_writer = self._ParseKeyWithPlugin(registry_key, plugin)

        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)

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

        expected_message = (
            u'[{0:s}] '
            u'ImagePath: C:\\WINDOWS\\system32\\googleupdater.exe'
        ).format(key_path)
        expected_short_message = u'{0:s}...'.format(expected_message[:77])

        self._TestGetMessageStrings(event, expected_message,
                                    expected_short_message)
Esempio n. 4
0
 def setUp(self):
     """Sets up the needed objects used throughout the test."""
     pre_obj = event.PreprocessObject()
     registry_cache = cache.WinRegistryCache()
     registry_cache.attributes['current_control_set'] = 'ControlSet001'
     self._plugin = lfu.BootVerificationPlugin(pre_obj=pre_obj,
                                               reg_cache=registry_cache)
Esempio n. 5
0
    def testFilters(self):
        """Tests the FILTERS class attribute."""
        plugin = lfu.BootVerificationPlugin()

        key_path = ('HKEY_LOCAL_MACHINE\\System\\ControlSet001\\Control\\'
                    'BootVerificationProgram')
        self._AssertFiltersOnKeyPath(plugin, key_path)

        self._AssertNotFiltersOnKeyPath(plugin, 'HKEY_LOCAL_MACHINE\\Bogus')
Esempio n. 6
0
 def setUp(self):
     """Makes preparations before running an individual test."""
     self._plugin = lfu.BootVerificationPlugin()
Esempio n. 7
0
 def setUp(self):
   """Sets up the needed objects used throughout the test."""
   self._plugin = lfu.BootVerificationPlugin()