dissect.target.plugins.apps.vpn.wireguard#

Module Contents#

Classes#

WireGuardPlugin

WireGuard configuration parser.

MultiDict

dict() -> new empty dictionary

Attributes#

dissect.target.plugins.apps.vpn.wireguard.WireGuardInterfaceRecord#
dissect.target.plugins.apps.vpn.wireguard.WireGuardPeerRecord#
class dissect.target.plugins.apps.vpn.wireguard.WireGuardPlugin(target)#

Bases: dissect.target.plugin.Plugin

WireGuard configuration parser.

References

__namespace__ = 'wireguard'#
NetworkManager uses a different stanza format

“/etc/NetworkManager/system-connections/Wireguard*”,

TODO: systemd uses a different stanza format

“/etc/systemd/network/wg*.netdev”, “/etc/systemd/network/wg.netdev”,

TODO: other locations such as $HOME/.config/wireguard TODO: parse native network manager formats from MacOS, Ubuntu and Windows.

Type:

TODO

CONFIG_GLOBS = ['/etc/wireguard/*.conf', '/usr/local/etc/wireguard/*.conf',...#
TUNNEL_NAME_RE#
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 an UnsupportedPluginError.

Raises:

UnsupportedPluginError – If the plugin could not be loaded.

config() Iterator[WireGuardInterfaceRecord | WireGuardPeerRecord]#

Parses interface config files from wireguard installations.

class dissect.target.plugins.apps.vpn.wireguard.MultiDict(*args, **kwargs)#

Bases: collections.OrderedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

__setitem__(key, val)#

Set self[key] to value.