RegRip.py standard classes¶
Before executing a plugin, the following objects are inserted into the global namespace. Please refer to Creating a plugin to learn how to develop a plugin yourself.
When using these objects from inside your plugin, do not specify the regrip. module, as these objects are directly injected, bypassing any import.
- class regrippy.BasePlugin(reg, logger, hive_name, hive_path)[source]¶
Base class for all plugins. Provides several methods that can be used by plugins to perform common actions, like opening registry keys.
- Variables
__REGHIVE__ (str_or_list) – The registry hive (or list thereof) you plugin works on
reg (Registry.Registry) – a handle to a Registry hive
logger (logging.Logger) – a preconfigured Logger. Use the
info()
,warning()
anderror()
methods instead.hive_name (str) – the name of the hive. It will always be one of the values in __REGHIVE__ (see Creating a plugin)
hive_path (str) – the full path to the hive file. Can be “-” if the hive was loaded from stdin.
- display_human(result)[source]¶
Displays a result to a human. By default, it display the path and value of the result.
- Parameters
result (regrip.PluginResult) – the result to display
- display_machine(result)[source]¶
Displays a result for further processing by a machine (piping into mactime for example).
- Parameters
result (regrip.PluginResult) – the result to display
- get_currentcontrolset_path()[source]¶
Fetches the path to CurrentControlSet
- Returns
the path to the CurrentControlSet key, or None if an error happened
- Return type
str
- guess_username(default='')[source]¶
Tries to guess the user the current NTUSER.DAT hive corresponds to
- Parameters
default (any type) – what to return in case we couldn’t determine the user name
- Returns
the user name, or default if it wasn’t found
- Return type
str
- class regrippy.PluginResult(*, key=None, value=None)[source]¶
A class which holds a single result of a plugin execution
- Variables
custom (dict) – a dict you can use to store custom data for your result
mtime (int) – the “last-modified” time. Automatically set if you pass the key parameter.
atime (int) – the “last-accessed” time.
ctime (int) – the “last-changed” time.
btime" (int) – the “created” time.
path (str) – complete path to the key. Automatically set if you pass the key parameter.
key_name (str) – last part of the key path. Automatically set if you pass the key parameter
value_type (str) – the value type
value_name (str) – the name of the Value
value_data – the actual value data. The variable type depends on the type of the value.