dissect.target.plugins.apps.vpn.openvpn
¶
Module Contents¶
Classes¶
Parse a configuration file specified by |
|
OpenVPN configuration parser. |
Attributes¶
- dissect.target.plugins.apps.vpn.openvpn.COMMON_ELEMENTS = [('string', 'name'), ('string', 'proto'), ('string', 'dev'), ('string', 'ca'), ('string',...¶
- dissect.target.plugins.apps.vpn.openvpn.OpenVPNServer¶
- dissect.target.plugins.apps.vpn.openvpn.OpenVPNClient¶
- class dissect.target.plugins.apps.vpn.openvpn.OpenVPNParser(*args, **kwargs)¶
Bases:
dissect.target.helpers.configutil.Default
Parse a configuration file specified by
separator
andcomment_prefixes
.This parser splits only on the first
separator
it finds:key<separator>value -> {“key”: “value”}
key<separator>value
- continuation
-> {“key”: “value continuation”}
# Unless we collapse values, we add them to a list to not overwrite any values. key<separator>value1 key<separator>value2
-> {key: [value1, value2]}
<empty_space><comment> -> skip
- parse_file(fh: io.TextIOBase) None ¶
Parse the contents of
fh
into key/value pairs.This function should set
parsed_data
as a side_effect.- Parameters:
fh – The text to parse.
- class dissect.target.plugins.apps.vpn.openvpn.OpenVPNPlugin(target)¶
Bases:
dissect.target.plugin.Plugin
OpenVPN configuration parser.
References
man (8) openvpn
- __namespace__ = 'openvpn'¶
- config_globs = ['/etc/openvpn/', 'sysvol/Program Files/OpenVPN/config/']¶
- user_config_paths¶
- check_compatible() None ¶
Perform a compatibility check with the target.
This function should return
None
if the plugin is compatible with the current target (self.target
). For example, check if a certain file exists. Otherwise it should raise anUnsupportedPluginError
.- Raises:
UnsupportedPluginError – If the plugin could not be loaded.
- config(export_key: bool = False) Iterator[OpenVPNServer | OpenVPNClient] ¶
Parses config files from openvpn interfaces.