
macOS IPC, launchd, Mach-O, and trust relationship explorer — zero-dependency terminal-native forensic tool
machscope is a terminal-native macOS explorer that turns processes, launchd jobs, Mach services, bundles, signatures, entitlements, and Mach-O linkage into one interrogable graph.
It exists to answer a simple question brutally well:
What is this process, service, binary, or bundle really connected to?
It correlates processes, executables, launchd jobs, Mach services, bundles, embedded XPC services, code signatures, entitlements, Mach-O linkage, and trust/anomaly findings into one view.
If Activity Monitor, ps, lsof, launchctl, codesign, and otool had a paranoid, operator-friendly child, this would be it.
macOS internals are elegant, but the truth is scattered.
To understand one suspicious process, you often end up bouncing between:
pslsoflaunchctlcodesignotoolInfo.plistmachscope collapses that workflow into a single terminal tool.
It is built for:
Given a PID, path, launchd label, or Mach service name, machscope can correlate:
pslsoflaunchctlMachServices.xpc servicescodesignotoolIt does not pretend to observe every live XPC relationship. Some relationships are declared, not observed. That honesty is intentional.
ps shows the process, not the ownership chainlaunchctl shows the job, not the full binary/bundle/trust contextcodesign shows identity, not runtime relationshipsotool shows linkage, not launchd or Mach service exposuremachscope correlates all of it in one pass--follow resolver pivots
graph.nodes and graph.edges are designed for future TUI, renderer, or diff workflows./machscope.py inspect <pid|path|launchd-label|mach-service>
./machscope.py inspect <target> --follow
./machscope.py inspect <target> --json
./machscope.py scan --limit 40 --min-score 1
./machscope.py services [filter]
./machscope.py inspect 1
./machscope.py inspect 57382
./machscope.py inspect /System/Applications/Calculator.app --follow
./machscope.py inspect /usr/libexec/remoted
./machscope.py inspect com.apple.WindowServer --follow
./machscope.py inspect ai.openclaw.gateway --follow
./machscope.py inspect com.apple.dnssd.service --follow
./machscope.py scan --limit 40 --min-score 1
./machscope.py scan --limit 10 --min-score 6
./machscope.py services
./machscope.py services mDNS
./machscope.py services com.apple
Target: com.apple.dnssd.service [mach-service follow]
Resolved via: mach-service-launchd
Executable: /usr/sbin/mDNSResponder
Launchd: com.apple.mDNSResponder.reloaded
Plist: /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
Signature: apple-platform team=not set id=com.apple.mDNSResponder
Mach services: com.apple.dnssd.service, com.apple.mDNSResponder.control, com.apple.mDNSResponder.log_utility
Entitlements: 0
Linked dylibs: 25 RPATHs: 0
Trust: score=1 verdict=ordinary
Findings:
- [LOW] T012 Odd launchd label suffix
inspect --json returns a structured object designed for scripting and future UI work.
Top-level shape:
targettarget_resolutionprocessbinarybundlelaunchdtrustgraph.nodesgraph.edgesThe graph is intentionally simple so it can feed:
--follow works--follow is where machscope starts feeling less like a metadata dumper and more like an explorer.
It adds resolver pivots such as:
launchctl print state → live PID when availableThat matters because the most interesting macOS artifacts are often not the literal thing you typed, but the thing behind it.
machscope includes a simple trust/anomaly layer.
Examples of things it can surface:
.reloadedThis is not a malware verdict engine. It is a way to surface leads, reduce blind spots, and make suspicious chains easier to interrogate.
The first version intentionally uses:
Wrapped tools include:
pslsoflaunchctlcodesignotoolfileThat keeps the tool easy to clone, inspect, and run on a stock-ish system.
Some relationships are declared, not observed.
For example:
machscope would rather be explicit than fake certainty.
ps, lsof, launchctl, codesign, otool, and fileRun it as a normal user first.
That is often enough for useful answers.
Some details may be partial without elevated privileges, especially around:
lsoflaunchctlIf you escalate, do it deliberately.
machscope is not trying to be:
It is a sharp local tool for making macOS internals legible.
Early, but already useful.
The current output and graph model are deliberately shaped so future versions can add:
--