AGENT SKILL

services-dbus-msgs-exploit

D-Bus message traffic analysis and IPC abuse forensics. Inspects message flows for anomalous call patterns, service impersonation, unauthorized method invocations, and credential relay via the session and system bus.

License 许可
MIT
最近更新
2026-09-01
Stars
★ 0
Forks
0

01 前言 Front Matter

name
services-dbus-msgs-exploit
tags
[ "ops", "dbus", "msgs", "dbus-msgs" ]
capec
[]
model
sonnet
tools
[ "Read", "Bash", "Glob", "Grep", "WebSearch" ]
skills
[ "shared-memory", "threats/mitre-attack-mapper" ]
maxTurns
20
nist_csf
[]
description
D-Bus message traffic analysis and IPC abuse forensics. Inspects message flows for anomalous call patterns, service impersonation, unauthorized method invocations, and credential relay via the session and system bus.
mitre_attack
[ "T1003", "T1021" ]

02 资源文件 1

03 SKILL.md 正文

D-Bus Messages

Purpose: Forensic analysis of D-Bus message flows to detect IPC abuse, service impersonation, unauthorized method calls, and lateral movement patterns on session and system buses.


Core Focus Areas

  • Message flow analysis: Method calls, signals, and error patterns across bus interfaces
  • Service impersonation: Processes registering well-known names they shouldn't own
  • Unauthorized method invocations: Calls to privileged interfaces from unprivileged senders
  • Credential relay patterns: Authentication token passing via D-Bus messages
  • Signal injection: Spurious signals sent to manipulate application state
  • Interface introspection abuse: Reconnaissance via org.freedesktop.DBus.Introspectable
  • Message flooding: High-volume message patterns indicating DoS or automated exploitation

Key Techniques & Tools

Message Capture & Analysis

# Capture all system bus messages to file for offline analysis
dbus-monitor --system > /tmp/dbus_system_capture.txt 2>/dev/null &
DBUS_PID=$!
sleep 30
kill $DBUS_PID

# Parse captured messages: method calls only
grep -E "^method call|sender=|destination=|path=|interface=|member=" \
  /tmp/dbus_system_capture.txt | head -100

# busctl — structured capture with JSON output
busctl capture --system --json=pretty 2>/dev/null | head -200

# Filter for specific interface activity
grep -A6 "interface=org.freedesktop.NetworkManager" \
  /tmp/dbus_system_capture.txt | head -60

Interface Introspection

# List all objects on a service (reconnaissance pattern)
busctl introspect --system org.freedesktop.NetworkManager \
  /org/freedesktop/NetworkManager 2>/dev/null | head -40

# Check which services expose sensitive interfaces
for name in $(busctl list --system --no-legend 2>/dev/null | awk '{print $1}' | grep '\.'); do
  busctl introspect --system "$name" / 2>/dev/null | \
    grep -E "(Properties|SetPassword|Credentials|Authenticate)" && \
    echo "  → SERVICE: $name"
done 2>/dev/null | head -30

# Enumerate all methods on a specific service
busctl introspect --system org.freedesktop.login1 \
  /org/freedesktop/login1 2>/dev/null

Method Call Pattern Analysis

# Detect high-frequency method calls to privileged services (automation/exploit indicator)
dbus-monitor --system 2>/dev/null | \
  awk '/^method call/ && /dest=org.freedesktop/ {print $0}' | \
  sort | uniq -c | sort -rn | head -20

# Calls to authentication-related interfaces
dbus-monitor --system "type='method_call',\
  interface='org.freedesktop.Accounts'" 2>/dev/null

dbus-monitor --system "type='method_call',\
  interface='org.freedesktop.login1.Manager'" 2>/dev/null

# Network configuration changes via D-Bus (potential lateral movement)
dbus-monitor --system "type='method_call',\
  interface='org.freedesktop.NetworkManager'" 2>/dev/null

Signal Analysis

# Signals from unexpected senders
dbus-monitor --system "type='signal'" 2>/dev/null | \
  grep -v "sender=:1\.[0-9]" | head -30

# Detect rapid signal emission (potential flood/DoS)
dbus-monitor --system "type='signal'" 2>/dev/null | \
  awk '/^signal/ {count++} END {print "Signals/30s:", count}' &
sleep 30; kill %1 2>/dev/null

# Credential-related signals
dbus-monitor --system "type='signal',\
  interface='org.freedesktop.Secret.Service'" 2>/dev/null | head -20

Secret Service & Keyring Analysis

# GNOME Keyring / KWallet via D-Bus (secret store access patterns)
busctl call --system org.freedesktop.secrets \
  /org/freedesktop/secrets \
  org.freedesktop.DBus.Introspectable Introspect 2>/dev/null | head -20

# Detect processes accessing secret service
dbus-monitor --session \
  "type='method_call',destination=org.freedesktop.secrets" 2>/dev/null | \
  grep -E "(sender|member)" | head -20

# KWallet access via D-Bus
busctl introspect --session org.kde.kwalletd5 \
  /modules/kwalletd5 2>/dev/null | head -30

Forensic Message Replay

# gdbus — send test call to verify interface is exposed
gdbus call --system --dest org.freedesktop.hostname1 \
  --object-path /org/freedesktop/hostname1 \
  --method org.freedesktop.DBus.Properties.GetAll \
  "org.freedesktop.hostname1" 2>/dev/null

# Check who owns a D-Bus name (PID/cmdline correlation)
busctl status --system org.freedesktop.NetworkManager 2>/dev/null | \
  grep -E "(PID|Unit|Comm)"

Journald D-Bus Message Events

# D-Bus activation failures (potential exploit probing)
journalctl --since "7 days ago" 2>/dev/null | \
  grep -iE "(dbus|org\.freedesktop)" | \
  grep -iE "(activat|fail|error|refused|not provided)" | head -30

# PolicyKit message events
journalctl -u polkit --since "7 days ago" 2>/dev/null | \
  grep -E "(message|call|invoke)" | head -20

MITRE ATT&CK Mapping

Finding Technique
Service impersonation via well-known name T1574 – Hijack Execution Flow
Unauthorized method call to privileged interface T1548 – Abuse Elevation Control Mechanism
Secret service / keyring credential access T1555 – Credentials from Password Stores
Network configuration change via D-Bus T1565.001 – Stored Data Manipulation
High-frequency signal flooding T1499 – Endpoint Denial of Service
Introspection-based service reconnaissance T1046 – Network Service Discovery

Rules for Agents

  1. Flag method calls to org.freedesktop.secrets from unexpected callers as HIGH
  2. Log all service name registration events with caller PID/cmdline to iocs.md
  3. Alert on introspection calls to sensitive interfaces (accounts, login, secrets)
  4. Cross-correlate D-Bus message timestamps with authentication and process events
  5. High-frequency calls (>10/sec) to the same interface = MEDIUM minimum
  6. Sync all D-Bus message IOCs to shared memory at session end

04 同仓库更多 Skills