PathScope User Manual
This manual walks through the screens in order, from finding the weak spots of this machine with PathScope to working out where to start fixing them. The screen instructions avoid technical jargon where possible, and the commands are collected in the chapter “Using the command line”.
1. What PathScope is
PathScope finds the “paths” by which an ordinary user on this machine can reach root (administrator privileges) or sensitive data, and shows, with priorities, where fixing is most effective. It is meant for checking machines you manage yourself and test environments.
The analysis is read-only. It does not rewrite settings or files, and it does not fix anything automatically. It shows example fix commands, but whether to run them is up to the user.
pathscope). PathScope is a separate app under the Apache License 2.0. It is outside the scope of the RoamSwitch EULA.2. Installing and launching
PathScope is installed as a separate app with its own icon. Here is how to start it.
| Environment | How to start |
|---|---|
| Mac | Open PathScope.app from the distribution file (DMG) and click “Analyze”. |
| Linux | Open “PathScope” from the application list and click “Analyze”. From a terminal, run pathscope-gui. The window needs WebKitGTK 4.1, which is installed automatically with deb and rpm. On Arch, install webkit2gtk-4.1 as an optional dependency. |
| Command line | Run pathscope in a terminal. On Mac it is PathScope.app/Contents/MacOS/pathscope. |
When it starts, a window opens with the buttons “Analyze”, “History”, “LLM assist”, “Explain with LLM” and “Settings” along the top. “Explain with LLM” cannot be pressed until a result is shown. PathScope does not open a listening port, and its window does not load external sites.
3. Running an analysis and reading the result
When you click “Analyze”, PathScope gathers the state of this machine, starting from the current user, and analyzes it. It can take from a few seconds to several tens of seconds. When it finishes, the result is saved automatically as one entry in the history.
Steps
- Click “Analyze”.
- Use the “Path diagram” and the “Path list” to see which user reaches root or confidential data, and by which steps. Circles and squares represent users and destinations, and each line represents one step that raises privilege. The number on a line corresponds to “why that step works” in the table below the diagram.
- In “Fix points (in the order to fix them)”, check the places where fixing has the biggest effect. Each item shows its priority (critical, high, medium or low, with a score), the number of paths affected, a suggested fix, and the nearest MITRE ATT&CK technique.
- Click “If I fix this?” to re-analyze, as a trial, the paths you would have if that fix point were fixed as suggested. “If I fix them all?” does the same for all the fix points shown. Neither changes this machine.
- Read the list of areas that could not be checked, shown below the fix points.
What kinds of paths it finds
- Membership of the docker, lxd, incus, libvirt or disk group (Linux; allows the same operations as root), or of the shadow, adm or systemd-journal group (Linux; allows reading password hashes and authentication logs)
- Abusing an executable that runs with root privileges (SUID) to become root, to rewrite files, or to read files
- Abusing an executable that has a privileged capability (such as cap_setuid or cap_dac_override) to become root or to read protected files (Linux)
- The executable of a root service, of a program that root listens with, or of a file that root runs periodically can be rewritten (this includes the case where the user is in a group that is allowed to write to it)
- The environment file of a service that runs as root (Linux), or a dynamic library that it loads (Mac), can be rewritten
- Even if the executable itself cannot be rewritten, the directory it sits in is writable (without the sticky bit), so the whole file can be replaced
- Settings that allow sudo without a password (to run as root, or as another user)
- Rewriting or abusing a service or scheduled file that runs as another user, or a command that can be run with sudo, to become that user and then reach root from there (a multi-step path)
- Credential files in another user's home (such as SSH private keys or ~/.aws/credentials) can be read (only their existence and permissions are checked, never their contents)
- On Mac, an app that has been granted access to all files can be rewritten
- The installed software, kernel, or macOS version still has a known vulnerability that lets an ordinary user become root (those listed in CISA's KEV, those not in KEV but with a high FIRST EPSS, and those with a public exploit module. Having an exploit module does not mean exploitation has been confirmed)
Lines of sudoers, doas.conf, and cron in a fixed format are read without using an LLM. Only Linux reads doas.conf and cron. sudoers can normally be read only by root, so it is covered when run as root. Lines that could not be read in a fixed form, such as lines whose aliases cannot be resolved, negations, and wildcards, remain in the range that could not be checked. These can be read with “LLM assist”.
The check for known vulnerabilities uses the data bundled with the app. It covers macOS and the versions of Debian, Ubuntu, RHEL family, SUSE, Arch, and Alpine for which data exists. Others (Debian 11 and earlier, Fedora, and so on) are shown as “unchecked”. It is not a feature that searches for vulnerabilities exhaustively. For a vulnerability whose conditions for exploitation are known, if those conditions do not hold on this device, it is not made into a path. Examples of conditions are the presence of a specific SUID executable, being able to use user namespaces, and being in a state where a specific kernel module can be loaded.
4. History, export, recurring checks
Analysis results are saved automatically as history on this device. Press “History” to open the list, where you can open a result, give it a label (for example “before fix”), or delete it. Select two entries and press “Compare the two selected” to see the paths that disappeared and the paths that were added, and the change in countermeasure points. Use this when comparing before and after a fix.
Analysis results in JSON format saved on other devices can be brought into the history with “Import analysis result”. Select two or more entries in the history and press “Aggregate the selected history” to see the order of devices by high risk and the weaknesses common to several devices.
If it could not be saved to the history, “Could not save to the history: reason” appears under “Analysis premises” in the result.
The analysis result being shown can be saved as “Analysis result (JSON format)”, “Watch targets (JSON)”, “auditd rules (for Linux's audit feature)”, “Rules for RoamSwitch Server (Falco)”, and “Analysis result (SARIF format)”. You choose the save location in the dialog that opens. It only writes out files and does not apply any settings or change this device. Check the contents of the Falco rules and place them in /etc/falco/rules.d/.
This writes a configuration file that analyzes periodically and notifies you when paths have increased since last time.
- Show an analysis result and click “Save as the result to compare against”.
- Set the “Interval (minutes)” (from 5 to 10080).
- On Mac click “Save launchd settings…”, on Linux click “Save systemd settings…”, and choose where to save.
- Check the written content, then register it yourself (for example with launchctl load). PathScope does not register it.
Create the baseline file with the same privileges as the scheduled run (root or a regular user). If the baseline is created as root and the scheduled run works as a regular user, an increase in paths in the range that a regular user cannot see cannot be detected. When the privileges differ, a warning is written to standard error, and a notification is also sent if the baseline is root's.
5. Features that use an LLM (optional)
Getting it ready
- Check “Enable LLM”.
- Choose the “LLM to use”. The choices are the commands claude, opencode, codex and agy, and those whose “Status” is “Installed” can be used. If it says “Not found”, install that command first.
- Choose “What to send to the LLM when reading settings” (see the table below).
- Click “Save”.
In the list, the “Model” and “Timeout (seconds)” can be changed for each LLM. claude is started with command execution and file reading switched off. opencode, codex and agy are treated as ones that cannot be switched off, and cannot be used unless you check “I understand that this LLM cannot be stopped from running commands or reading files”. An LLM that cannot be restricted may read files on its own judgment along the way, and their contents may be sent to the LLM’s service.
Explain with LLM
When you show an analysis result and press “Explain with LLM”, the LLM is asked to write the overall assessment, the priority and reasons for fixes, the meaning of the range that could not be checked, and so on. What is passed is only a summary of the paths, countermeasure points, and the range that could not be checked. The raw collected information (such as lists of file owners and permissions) is not passed. However, the summary includes the user names and file paths that appear in the paths. The LLM's reply is for reference. A person judges the check and the response, and nothing changes automatically based on the reply.
The IP addresses, domains, CVE IDs and hashes the LLM writes are compared with what it was given (the summary of the analysis result). A value that appears nowhere in that material is listed below the explanation on screen under “Values not found in the collected material”, as a possible invention. Only the strings are compared; the LLM is not asked.
LLM assist (reading configuration files)
Configuration files such as sudoers, cron and scripts are written in all sorts of ways, and a program alone sometimes cannot read them. LLM assist has an LLM read such files and look for descriptions that involve root privileges.
- Click “LLM assist”. Candidate files to be read are listed with the reason for each (all are selected at first). Candidates include sudoers, cron, systemd and launchd settings, and executables loaded by services that run as root. Uncheck any you do not want to send.
- Click “Send the ○ selected to the LLM”. A confirmation of what will be sent appears; read it, then click “Send (confirmed)”.
- Check “Items found”, “Files read” and “Files not read (these stay unchecked)” in the result.
- Click “Apply and analyze again” to add the items found to the analysis. If you no longer want to use them, delete them from “Saved”.
Only the items the LLM listed that were confirmed to be actually present as a line in the original file are used. Items that could not be confirmed appear only under “For reference” and are not used in the analysis. The confirmation is repeated at every analysis, so an item whose original line has disappeared is no longer used.
| What is sent | Details |
|---|---|
| Standard | Values that look like passwords or keys are replaced with “[REDACTED]” before sending. Files such as private keys are not sent. For a large file, only the lines that contain paths or commands are sent. |
| Unrestricted | A setting for cases where the content does not leave your machine, such as a local LLM (at your own risk). Password hashes and the like are also sent. |
6. Using the command line
The same analysis as in the window can be run with the pathscope command. Run with no options, it analyzes the paths from the current user to root. Collection is read-only and does not change the state of the machine.
On Mac, if the app is in the Applications folder, the command is at /Applications/PathScope.app/Contents/MacOS/pathscope. To call it by its short name, run the following in Terminal. After that, pathscope alone works.
sudo mkdir -p /usr/local/bin
sudo ln -sf /Applications/PathScope.app/Contents/MacOS/pathscope /usr/local/bin/pathscope
pathscope
pathscope --json-out=report.json
pathscope --what-if-fix=all
pathscope --baseline=base.json --fail-on=new --notify
pathscope --print-schedule=systemd --interval-min=60
pathscope --export-watch=watch.json --export-auditd=pathscope.rules --export-roamswitch=94-pathscope-watch.yaml
pathscope --format=json
pathscope --sarif-out=report.sarif
sudo pathscope --check-agent-users
pathscope --plain
pathscope --version
pathscope --lang=en
| Option | Details |
|---|---|
--json-out=<file> | Saves the result as JSON. |
--what-if-fix=all | Re-analyzes, as a trial, the paths you would have if everything were fixed as suggested. With a number, only that fix point. |
--baseline=<file> --fail-on=new | Compares with a previous JSON and exits with code 1 if paths have increased. With --notify, a desktop notification (count only) is also shown. |
--fail-on=any|new|critical|high|medium | any exits with code 1 when there is at least one path; critical, high and medium do so when there is a fix point at or above that priority. |
--print-schedule=launchd|systemd | Prints an example of a periodic-run configuration. It does not register it. Use --interval-min to set the interval in minutes. |
--format=markdown|plain|json|sarif | Chooses the format of standard output. With json or sarif, only that data goes to standard output, and progress and notes go to standard error. Only one kind of data can go to standard output, and it cannot be combined with --what-if-*. --json-out=- and --sarif-out=- also write to standard output. |
--sarif-out=<file> | Saves the result in SARIF 2.1.0 format. The priority of each fix point maps to the level: critical and high become error, medium becomes warning, and low becomes note. |
--export-roamswitch=<file> | Writes a rule file for the eBPF Runtime Guard (Falco) of RoamSwitch Server. Every rule has the priority WARNING. Check the contents and put the file in /etc/falco/rules.d/ yourself. It does not apply the rules. |
--check-agent-users | Analyzes every account registered in agent_users in the RoamSwitch Server settings, each as a starting point, in one run. The settings file can normally be read only by root, so run it with sudo. It cannot be combined with --baseline or --what-if-*. |
--lang=<lang> | Chooses the language of the output: ja, en, ko, zh-Hans, zh-Hant, de, fr, es, it or pt. When it is not given, the language comes from the PATHSCOPE_LANG environment variable and then from the OS language, and English is used for a language that is not supported. |
--plain | Prints the older plain-text layout instead of Markdown. The assumptions of the analysis then go to standard error instead of into the result. |
--help / --version | --help (-h) shows a description of every option, the exit codes and examples. --version (-V) shows the version. |
The output is Markdown, in the order of summary table, paths, countermeasure points, collection range, and analysis assumptions, and can be pasted into notes or tickets as it is. When you change something with --what-if-*, the change is followed by the change from the previous run with --baseline. For the conventional prose form, add --plain.
The exit code is 0 for normal, 1 when a --fail-on condition was met, and 2 for a usage or input/output error. When run as root, it also collects the listeners that root is waiting on directly. Results of reading settings that were saved with LLM assist are also included in the command’s analysis.
If the baseline file cannot be read, or it cannot be compared because the OS, starting point or device differs, the exit code is 2. With --notify, it notifies “PathScope scheduled check is not running: reason”.
The MCP tool get_privilege_escalation_paths of RoamSwitch for Linux runs the installed pathscope with fixed arguments (--lang=en --start=user-name --format=json) and reads the result. It returns the number of paths and their steps, the fix points of critical or high priority, and the areas that could not be checked. It does not return fix commands and never runs them. Even when no path is found, that does not mean the machine is safe if it did not run as root or if some areas could not be checked.
7. Where data is stored, and updates
| Item | Location |
|---|---|
| Analysis history | On Mac, ~/Library/Application Support/net.lafine.pathscope/history.sqlite3; on Linux, ~/.local/share/net.lafine.pathscope/history.sqlite3 |
| LLM settings | ~/.config/pathscope/settings.json (saved so that only you can read and write it) |
| Content saved by LLM assist | ~/.local/share/pathscope/facts.json |
| The “result to compare against” for recurring checks | ~/.local/share/pathscope/baseline.json |
The history can be erased with “Delete all” on the history screen. Analysis results contain sensitive information about how this machine is configured (user names, file paths, permissions), so please limit where they are kept and shared. To use a command that is not in the LLM list, add it by hand to profiles in the settings file. It cannot be changed from the window.
Updating the app
PathScope on Mac is updated on its own, separately from RoamSwitch. It connects to lafine.net only when you press “Check for updates”, to get the latest version information (no information about this device or the analysis results is sent). If there is a new version, press “Install v○○”, and when it finishes, press “Restart to apply”. The downloaded update has its signature verified, and is swapped in only if it is confirmed not to have been tampered with.
PathScope on Linux is included in the RoamSwitch package, so it is updated when you update that package. The “Update” tab also says so.
The data used for analysis, such as known vulnerabilities, is bundled with the app. Anything found after that is not checked until you update PathScope. When the bundled data has become old, the analysis result says so.
8. What it does not do
- It does not change settings or files, and it does not run fixes automatically. It goes only as far as showing suggested fixes.
- “No paths found” is a result within the range that could be collected. It is not proof of safety.
- It does not examine vulnerabilities exhaustively. Among known vulnerabilities that let an ordinary user become root, it looks only at those that have been exploited in real attacks (CISA KEV), those that are likely to be exploited (a high FIRST EPSS), and those with a public exploit module.
- “If I fix this?” can be used only on a result from an analysis just made. It cannot be used on a result opened from the history.
9. Troubleshooting
| Symptom | What to do |
|---|---|
| On Mac, “Privacy settings data (TCC.db)” appears among the areas that could not be checked | In the “Permissions” tab of “Settings”, click “Open the Full Disk Access settings”, turn PathScope on in System Settings, then restart PathScope and analyze again. The other analyses work even if you do not allow it. |
| “The LLM cannot be used” appears, or the settings cannot be saved | Enable it under “LLM integration” in “Settings” and choose the LLM to use. If the list says “Not found”, install the command. When you choose opencode, codex or agy, the confirmation checkbox is also required. |
| An LLM stops with “Timed out” | In the list under “LLM integration” in “Settings”, make that LLM’s “Timeout (seconds)” longer (from 1 to 900), then save. |
| “If I fix this?” cannot be used | It cannot be used on a result opened from the history. Click “Analyze” again, then use it. |
| In-app updating cannot be used | If you installed it from a RoamSwitch package on Linux, update it by updating the package. If you did not install it from a package (.deb, .rpm or AppImage), in-app updating cannot be used, so please reinstall from the distributed package. |