rename project to runaway

This commit is contained in:
2026-11-09 10:13:51 +08:00
parent 5857081832
commit c9feb8c05a
95 changed files with 1034 additions and 1034 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ jobs:
name: ShellCheck name: ShellCheck
command: | command: |
apk add bash apk add bash
for f in unleash lib/*.sh examples/*.sh; do for f in runaway lib/*.sh examples/*.sh; do
[ -f "$f" ] || continue [ -f "$f" ] || continue
echo "Checking: $f" echo "Checking: $f"
shellcheck -S warning "$f" || exit 1 shellcheck -S warning "$f" || exit 1
@@ -25,7 +25,7 @@ jobs:
name: Bash Syntax Check name: Bash Syntax Check
command: | command: |
apk add bash apk add bash
for f in unleash lib/*.sh examples/*.sh; do for f in runaway lib/*.sh examples/*.sh; do
[ -f "$f" ] || continue [ -f "$f" ] || continue
echo "Checking: $f" echo "Checking: $f"
bash -n "$f" || exit 1 bash -n "$f" || exit 1
+2 -2
View File
@@ -11,7 +11,7 @@ assignees: ''
A clear description of what is not working. A clear description of what is not working.
**To reproduce** **To reproduce**
1. Run `./unleash <command>` from Recovery / booted system 1. Run `./runaway <command>` from Recovery / booted system
2. See error: ... 2. See error: ...
**Expected behavior** **Expected behavior**
@@ -24,7 +24,7 @@ What should have happened instead.
- FileVault: (Enabled / Disabled) - FileVault: (Enabled / Disabled)
**Screenshots or logs** **Screenshots or logs**
If applicable, add output from `unleash status` or terminal logs. If applicable, add output from `runaway status` or terminal logs.
**Additional context** **Additional context**
Anything else relevant. Anything else relevant.
+1 -1
View File
@@ -1,6 +1,6 @@
--- ---
name: Feature request name: Feature request
about: Suggest an idea for unleash about: Suggest an idea for runaway
title: '' title: ''
labels: enhancement labels: enhancement
assignees: '' assignees: ''
+2 -2
View File
@@ -16,7 +16,7 @@ jobs:
run: sudo apt-get update -qq && sudo apt-get install -y -qq shellcheck run: sudo apt-get update -qq && sudo apt-get install -y -qq shellcheck
- name: Run ShellCheck - name: Run ShellCheck
run: | run: |
for f in unleash lib/*.sh examples/*.sh; do for f in runaway lib/*.sh examples/*.sh; do
[ -f "$f" ] || continue [ -f "$f" ] || continue
echo "Checking: $f" echo "Checking: $f"
shellcheck -S warning "$f" || exit 1 shellcheck -S warning "$f" || exit 1
@@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@v7 - uses: actions/checkout@v7
- name: Check syntax - name: Check syntax
run: | run: |
for f in unleash lib/*.sh examples/*.sh; do for f in runaway lib/*.sh examples/*.sh; do
[ -f "$f" ] || continue [ -f "$f" ] || continue
echo "Checking: $f" echo "Checking: $f"
bash -n "$f" || exit 1 bash -n "$f" || exit 1
+8 -8
View File
@@ -6,20 +6,20 @@ on:
jobs: jobs:
update-homebrew: update-homebrew:
name: Update homebrew-unleash formula name: Update homebrew-runaway formula
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v7
with: with:
repository: mateussiqueira/homebrew-unleash repository: mateussiqueira/homebrew-runaway
token: ${{ secrets.GH_PAT || github.token }} token: ${{ secrets.GH_PAT || github.token }}
- name: Download release artifact and compute SHA - name: Download release artifact and compute SHA
id: sha id: sha
run: | run: |
TAG="${{ github.event.release.tag_name }}" TAG="${{ github.event.release.tag_name }}"
curl -sL "https://github.com/mateussiqueira/unleash/releases/download/${TAG}/unleash-standalone.sh" -o /tmp/unleash-standalone.sh curl -sL "https://github.com/mateussiqueira/runaway/releases/download/${TAG}/runaway-standalone.sh" -o /tmp/runaway-standalone.sh
SHA=$(shasum -a 256 /tmp/unleash-standalone.sh | cut -d' ' -f1) SHA=$(shasum -a 256 /tmp/runaway-standalone.sh | cut -d' ' -f1)
echo "sha=${SHA}" >> $GITHUB_OUTPUT echo "sha=${SHA}" >> $GITHUB_OUTPUT
echo "tag=${TAG}" >> $GITHUB_OUTPUT echo "tag=${TAG}" >> $GITHUB_OUTPUT
@@ -30,14 +30,14 @@ jobs:
SHA="${{ steps.sha.outputs.sha }}" SHA="${{ steps.sha.outputs.sha }}"
TAG="${{ steps.sha.outputs.tag }}" TAG="${{ steps.sha.outputs.tag }}"
sed -i "s|url \".*\"|url \"https://raw.githubusercontent.com/mateussiqueira/unleash/${TAG}/unleash-standalone.sh\"|" Formula/unleash.rb sed -i "s|url \".*\"|url \"https://raw.githubusercontent.com/mateussiqueira/runaway/${TAG}/runaway-standalone.sh\"|" Formula/runaway.rb
sed -i "s|version \".*\"|version \"${VERSION}\"|" Formula/unleash.rb sed -i "s|version \".*\"|version \"${VERSION}\"|" Formula/runaway.rb
sed -i "s|sha256 \".*\"|sha256 \"${SHA}\"|" Formula/unleash.rb sed -i "s|sha256 \".*\"|sha256 \"${SHA}\"|" Formula/runaway.rb
- name: Commit and push - name: Commit and push
run: | run: |
git config user.name "github-actions[bot]" git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add Formula/unleash.rb git add Formula/runaway.rb
git diff --cached --quiet || git commit -m "chore: update formula to ${{ github.event.release.tag_name }}" git diff --cached --quiet || git commit -m "chore: update formula to ${{ github.event.release.tag_name }}"
git push git push
+1 -1
View File
@@ -1,4 +1,4 @@
.unleash-backup/ .runaway-backup/
*.swp *.swp
*.swo *.swo
.DS_Store .DS_Store
+5 -5
View File
@@ -25,7 +25,7 @@
## [1.6.1] — 2026-06-20 ## [1.6.1] — 2026-06-20
### Added ### Added
- Per-command `--help` / `-h` flag (`unleash bypass --help`, etc.) - Per-command `--help` / `-h` flag (`runaway bypass --help`, etc.)
- CI rewritten to use zero-cost actions only (no Docker-based actions) - CI rewritten to use zero-cost actions only (no Docker-based actions)
- LICENSE added to standalone binary header - LICENSE added to standalone binary header
@@ -37,8 +37,8 @@
## [1.6.0] — 2026-06-20 ## [1.6.0] — 2026-06-20
### Added ### Added
- **Homebrew tap**: `brew install mateussiqueira/unleash/unleash` - **Homebrew tap**: `brew install mateussiqueira/runaway/runaway`
- **GitHub Pages**: full command reference at https://mateussiqueira.github.io/unleash/ - **GitHub Pages**: full command reference at https://mateussiqueira.github.io/runaway/
- **README.pt-BR.md**: Brazilian Portuguese translation - **README.pt-BR.md**: Brazilian Portuguese translation
- **Bats tests**: doctor, whitelist, config, check, history, uninstall modules - **Bats tests**: doctor, whitelist, config, check, history, uninstall modules
- **docs/index.md**: landing page for GitHub Pages - **docs/index.md**: landing page for GitHub Pages
@@ -69,7 +69,7 @@
## [1.3.0] — 2026-06-20 ## [1.3.0] — 2026-06-20
### Added ### Added
- **config**: Persistent settings in ~/.unleash.conf - **config**: Persistent settings in ~/.runaway.conf
- **test** command / `--dry-run` global flag - **test** command / `--dry-run` global flag
- **history / history-clear**: Event log viewer - **history / history-clear**: Event log viewer
- Structured logging (levels, timestamps, color, file output) - Structured logging (levels, timestamps, color, file output)
@@ -102,7 +102,7 @@
## [1.0.0] — 2026-06-20 ## [1.0.0] — 2026-06-20
### Added ### Added
- Initial release of unleash — Unified MDM Bypass for macOS - Initial release of runaway — Unified MDM Bypass for macOS
- **bypass**: Full MDM bypass with admin user creation (Recovery mode) - **bypass**: Full MDM bypass with admin user creation (Recovery mode)
- **suppress**: Suppress MDM enrollment without creating a user - **suppress**: Suppress MDM enrollment without creating a user
- **heal**: Auto-heal — check and re-apply suppression after macOS updates - **heal**: Auto-heal — check and re-apply suppression after macOS updates
+4 -4
View File
@@ -1,6 +1,6 @@
# Contributing to unleash # Contributing to runaway
Thank you for considering contributing to unleash! This document outlines the guidelines for contributions. Thank you for considering contributing to runaway! This document outlines the guidelines for contributions.
## Code of Conduct ## Code of Conduct
@@ -20,8 +20,8 @@ This project follows a [Code of Conduct](CODE_OF_CONDUCT.md). By participating,
2. Create a feature branch from `main` 2. Create a feature branch from `main`
3. Follow the existing code style (ShellCheck compliant) 3. Follow the existing code style (ShellCheck compliant)
4. Test your changes: 4. Test your changes:
- Syntax check: `bash -n lib/*.sh unleash` - Syntax check: `bash -n lib/*.sh runaway`
- ShellCheck: `shellcheck lib/*.sh unleash` (install via `brew install shellcheck`) - ShellCheck: `shellcheck lib/*.sh runaway` (install via `brew install shellcheck`)
5. Update documentation (README.md) if adding features 5. Update documentation (README.md) if adding features
6. Open a PR against `main` 6. Open a PR against `main`
+6 -6
View File
@@ -1,14 +1,14 @@
FROM alpine:latest AS builder FROM alpine:latest AS builder
RUN apk add bash curl RUN apk add bash curl
WORKDIR /build WORKDIR /build
COPY unleash /build/ COPY runaway /build/
COPY lib/ /build/lib/ COPY lib/ /build/lib/
RUN bash -n unleash lib/*.sh RUN bash -n runaway lib/*.sh
FROM alpine:latest FROM alpine:latest
RUN apk add --no-cache bash curl RUN apk add --no-cache bash curl
COPY --from=builder /build/ /opt/unleash/ COPY --from=builder /build/ /opt/runaway/
RUN ln -s /opt/unleash/unleash /usr/local/bin/unleash RUN ln -s /opt/runaway/runaway /usr/local/bin/runaway
WORKDIR /opt/unleash WORKDIR /opt/runaway
ENTRYPOINT ["/opt/unleash/unleash"] ENTRYPOINT ["/opt/runaway/runaway"]
CMD ["--help"] CMD ["--help"]
+1 -1
View File
@@ -10,7 +10,7 @@ build:
./examples/build-standalone.sh ./examples/build-standalone.sh
clean: clean:
rm -f unleash-standalone.sh rm -f runaway-standalone.sh
ci: lint test ci: lint test
@echo "=== Markdown ===" @echo "=== Markdown ==="
+13 -13
View File
@@ -1,28 +1,28 @@
# unleash — Quick Reference # runaway — Quick Reference
Keep this on your SSD alongside the script. Keep this on your SSD alongside the script.
## First time ## First time
1. Boot to Recovery (Apple Silicon: hold Power, Intel: Cmd+R) 1. Boot to Recovery (Apple Silicon: hold Power, Intel: Cmd+R)
2. Open Terminal → `chmod +x "/Volumes/YourSSD/unleash/unleash"` 2. Open Terminal → `chmod +x "/Volumes/YourSSD/runaway/runaway"`
3. Run → `"/Volumes/YourSSD/unleash/unleash"` 3. Run → `"/Volumes/YourSSD/runaway/runaway"`
4. Pick "Full bypass" from the menu 4. Pick "Full bypass" from the menu
## Common scenarios ## Common scenarios
| Você quer... | Comando | | Você quer... | Comando |
|---|---| |---|---|
| Bypass completo (cria usuário admin) | `./unleash bypass` | | Bypass completo (cria usuário admin) | `./runaway bypass` |
| Só silenciar o MDM (sem criar usuário) | `./unleash suppress` | | Só silenciar o MDM (sem criar usuário) | `./runaway suppress` |
| Consertar depois de atualizar macOS | `sudo ./unleash heal` | | Consertar depois de atualizar macOS | `sudo ./runaway heal` |
| Nunca mais pensar nisso | `sudo ./unleash persist` + `sudo ./unleash whitelist` | | Nunca mais pensar nisso | `sudo ./runaway persist` + `sudo ./runaway whitelist` |
| Saber se vai travar após formatar | `sudo ./unleash check` | | Saber se vai travar após formatar | `sudo ./runaway check` |
| Vigiar MDM em tempo real | `sudo ./unleash monitor` | | Vigiar MDM em tempo real | `sudo ./runaway monitor` |
| Instalar monitor para sempre | `sudo ./unleash monitor-install` | | Instalar monitor para sempre | `sudo ./runaway monitor-install` |
| Limpeza pós-bypass (já logado) | `sudo ./unleash harden` | | Limpeza pós-bypass (já logado) | `sudo ./runaway harden` |
| Varredura completa | `sudo ./unleash audit` | | Varredura completa | `sudo ./runaway audit` |
| Voltar ao normal | `./unleash restore` | | Voltar ao normal | `./runaway restore` |
## Aliases ## Aliases
+62 -62
View File
@@ -1,8 +1,8 @@
<p align="center"> <p align="center">
<img src="docs/icon.svg" width="120" alt="unleash logo"> <img src="docs/icon.svg" width="120" alt="runaway logo">
</p> </p>
# unleash # runaway
Single-script MDM bypass for macOS. Works from Recovery mode on Apple Silicon and Intel. Single-script MDM bypass for macOS. Works from Recovery mode on Apple Silicon and Intel.
@@ -10,7 +10,7 @@ I started this because the original bypass-mdm project had five different script
## Quick start ## Quick start
1. Copy the `unleash` folder to an external SSD (FAT32, APFS, or exFAT) 1. Copy the `runaway` folder to an external SSD (FAT32, APFS, or exFAT)
2. Boot to Recovery: 2. Boot to Recovery:
- **Apple Silicon**: hold the power button until you see "Loading Startup Options", then click Options → Continue - **Apple Silicon**: hold the power button until you see "Loading Startup Options", then click Options → Continue
- **Intel**: Cmd+R at the startup chime - **Intel**: Cmd+R at the startup chime
@@ -18,14 +18,14 @@ I started this because the original bypass-mdm project had five different script
4. Run: 4. Run:
```bash ```bash
chmod +x "/Volumes/YourSSD/unleash/unleash" chmod +x "/Volumes/YourSSD/runaway/runaway"
"/Volumes/YourSSD/unleash/unleash" "/Volumes/YourSSD/runaway/runaway"
``` ```
Pick "Full bypass" from the menu. Or if you know what you want: Pick "Full bypass" from the menu. Or if you know what you want:
```bash ```bash
"/Volumes/YourSSD/unleash/unleash" bypass "/Volumes/YourSSD/runaway/runaway" bypass
``` ```
No internet needed. No SIP to disable. No typing long URLs. No internet needed. No SIP to disable. No typing long URLs.
@@ -33,8 +33,8 @@ No internet needed. No SIP to disable. No typing long URLs.
If you do have internet in Recovery: If you do have internet in Recovery:
```bash ```bash
curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash-standalone.sh -o /tmp/unleash curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/runaway-standalone.sh -o /tmp/runaway
chmod +x /tmp/unleash && /tmp/unleash bypass chmod +x /tmp/runaway && /tmp/runaway bypass
``` ```
--- ---
@@ -44,7 +44,7 @@ chmod +x /tmp/unleash && /tmp/unleash bypass
### bypass — Full MDM bypass (Recovery only) ### bypass — Full MDM bypass (Recovery only)
```bash ```bash
./unleash bypass ./runaway bypass
``` ```
Creates a temporary admin account and suppresses MDM. What it does: Creates a temporary admin account and suppresses MDM. What it does:
@@ -61,7 +61,7 @@ Creates a temporary admin account and suppresses MDM. What it does:
### suppress — Silence enrollment, no user ### suppress — Silence enrollment, no user
```bash ```bash
./unleash suppress ./runaway suppress
``` ```
Same as bypass minus the user creation. Useful after a clean bypass breaks from a macOS update. Same as bypass minus the user creation. Useful after a clean bypass breaks from a macOS update.
@@ -69,7 +69,7 @@ Same as bypass minus the user creation. Useful after a clean bypass breaks from
### admin — Create admin user only (Recovery only) ### admin — Create admin user only (Recovery only)
```bash ```bash
./unleash admin ./runaway admin
``` ```
Creates a hidden local administrator account on the system without performing an MDM bypass or suppression. What it does: Creates a hidden local administrator account on the system without performing an MDM bypass or suppression. What it does:
@@ -84,8 +84,8 @@ Creates a hidden local administrator account on the system without performing an
### heal — Check and re-apply ### heal — Check and re-apply
```bash ```bash
sudo ./unleash heal # from booted system sudo ./runaway heal # from booted system
./unleash heal # from Recovery ./runaway heal # from Recovery
``` ```
Checks if suppression is still intact. If any piece (DEP markers, hosts block, daemon disable) has been reset, it re-applies it. Safe to run repeatedly. Checks if suppression is still intact. If any piece (DEP markers, hosts block, daemon disable) has been reset, it re-applies it. Safe to run repeatedly.
@@ -93,17 +93,17 @@ Checks if suppression is still intact. If any piece (DEP markers, hosts block, d
### persist — Boot-time auto-heal ### persist — Boot-time auto-heal
```bash ```bash
sudo ./unleash persist sudo ./runaway persist
``` ```
Installs a LaunchDaemon at `/Library/LaunchDaemons/com.unleash.heal.plist` that runs `unleash heal` on every boot and every 24 hours after that. Logs go to `/var/log/unleash-heal.log`. Installs a LaunchDaemon at `/Library/LaunchDaemons/com.runaway.heal.plist` that runs `runaway heal` on every boot and every 24 hours after that. Logs go to `/var/log/runaway-heal.log`.
Use this before a macOS upgrade. When the update finishes and reboots, heal runs automatically and re-applies anything the update reset. Use this before a macOS upgrade. When the update finishes and reboots, heal runs automatically and re-applies anything the update reset.
### unpersist — Remove auto-heal ### unpersist — Remove auto-heal
```bash ```bash
sudo ./unleash unpersist sudo ./runaway unpersist
``` ```
Removes the LaunchDaemon and unloads it. Removes the LaunchDaemon and unloads it.
@@ -111,7 +111,7 @@ Removes the LaunchDaemon and unloads it.
### firewall — Kernel-level MDM block ### firewall — Kernel-level MDM block
```bash ```bash
sudo ./unleash firewall sudo ./runaway firewall
``` ```
Creates pf firewall rules that drop traffic to Apple's MDM IP ranges (17.0.0.0/8 and 17.128.0.0/10). pf works below DNS — DNS-over-HTTPS cannot bypass it. Creates pf firewall rules that drop traffic to Apple's MDM IP ranges (17.0.0.0/8 and 17.128.0.0/10). pf works below DNS — DNS-over-HTTPS cannot bypass it.
@@ -121,15 +121,15 @@ Creates pf firewall rules that drop traffic to Apple's MDM IP ranges (17.0.0.0/8
### firewall-off — Remove firewall ### firewall-off — Remove firewall
```bash ```bash
sudo ./unleash firewall-off sudo ./runaway firewall-off
``` ```
Flushes the Unleash pf anchor and restores pf.conf. Flushes the Runaway pf anchor and restores pf.conf.
### whitelist — Block only MDM, keep iCloud ### whitelist — Block only MDM, keep iCloud
```bash ```bash
sudo ./unleash whitelist sudo ./runaway whitelist
``` ```
Alternative to `firewall` that resolves only the essential MDM domains (mdmenrollment.apple.com, deviceenrollment.apple.com, iprofiles.apple.com) to IPs and blocks those, leaving everything else untouched. iCloud, App Store, and updates should work normally. Alternative to `firewall` that resolves only the essential MDM domains (mdmenrollment.apple.com, deviceenrollment.apple.com, iprofiles.apple.com) to IPs and blocks those, leaving everything else untouched. iCloud, App Store, and updates should work normally.
@@ -137,7 +137,7 @@ Alternative to `firewall` that resolves only the essential MDM domains (mdmenrol
### harden — Live cleanup from booted system ### harden — Live cleanup from booted system
```bash ```bash
sudo ./unleash harden sudo ./runaway harden
``` ```
Runs from the logged-in desktop after bypass. Does: Runs from the logged-in desktop after bypass. Does:
@@ -153,7 +153,7 @@ Runs from the logged-in desktop after bypass. Does:
### audit — Deep system scan ### audit — Deep system scan
```bash ```bash
sudo ./unleash audit sudo ./runaway audit
``` ```
Comprehensive scan that checks: installed profiles, enrollment state, keychain certificates, user LaunchAgents, system LaunchDaemons, running processes, MDM agent binaries, pf firewall status. Ends with a risk score (LOW / MEDIUM / HIGH / CRITICAL). Comprehensive scan that checks: installed profiles, enrollment state, keychain certificates, user LaunchAgents, system LaunchDaemons, running processes, MDM agent binaries, pf firewall status. Ends with a risk score (LOW / MEDIUM / HIGH / CRITICAL).
@@ -161,7 +161,7 @@ Comprehensive scan that checks: installed profiles, enrollment state, keychain c
### status — MDM health check (Recovery only) ### status — MDM health check (Recovery only)
```bash ```bash
./unleash status ./runaway status
``` ```
Shows DEP markers, hosts block, daemon overrides, profile enrollment, and backup status. Only works from Recovery because that's where the Data volume is cleanly accessible. Shows DEP markers, hosts block, daemon overrides, profile enrollment, and backup status. Only works from Recovery because that's where the Data volume is cleanly accessible.
@@ -169,7 +169,7 @@ Shows DEP markers, hosts block, daemon overrides, profile enrollment, and backup
### check — Pre-format / pre-upgrade assessment ### check — Pre-format / pre-upgrade assessment
```bash ```bash
sudo ./unleash check sudo ./runaway check
``` ```
Answers: **"If I wipe this Mac, will it lock?"** Checks DEP records, profiles, enrollment state, firewall, and persistence. Also does an upgrade safety check — tells you if `persist` and `firewall` are installed before you upgrade macOS. Answers: **"If I wipe this Mac, will it lock?"** Checks DEP records, profiles, enrollment state, firewall, and persistence. Also does an upgrade safety check — tells you if `persist` and `firewall` are installed before you upgrade macOS.
@@ -182,31 +182,31 @@ Returns one of two verdicts:
### monitor — Background MDM watcher ### monitor — Background MDM watcher
```bash ```bash
sudo ./unleash monitor sudo ./runaway monitor
``` ```
Starts a daemon that checks MDM state every 5 minutes. If it detects MDM trying to re-enroll (DEP record appears, hosts block missing, enrollment becomes active), it auto-heals and sends a macOS notification. Starts a daemon that checks MDM state every 5 minutes. If it detects MDM trying to re-enroll (DEP record appears, hosts block missing, enrollment becomes active), it auto-heals and sends a macOS notification.
```bash ```bash
sudo ./unleash monitor-stop # stop it sudo ./runaway monitor-stop # stop it
sudo ./unleash monitor-status # check if it's running sudo ./runaway monitor-status # check if it's running
``` ```
Logs everything to `/var/log/unleash-monitor.log`. The daemon does not survive a reboot on its own — combine with `persist` for persistence. Logs everything to `/var/log/runaway-monitor.log`. The daemon does not survive a reboot on its own — combine with `persist` for persistence.
### backup / restore — State save ### backup / restore — State save
```bash ```bash
./unleash backup ./runaway backup
./unleash restore ./runaway restore
``` ```
Backup saves hosts, config profiles, and launchd override to `.unleash-backup/`. Restore reverts them. Backup saves hosts, config profiles, and launchd override to `.runaway-backup/`. Restore reverts them.
### dualboot — External volume target ### dualboot — External volume target
```bash ```bash
sudo ./unleash dualboot sudo ./runaway dualboot
``` ```
Same as bypass but lets you pick which volume to target (for external macOS installs or dual-boot setups). Prompts for system and data volume names. Same as bypass but lets you pick which volume to target (for external macOS installs or dual-boot setups). Prompts for system and data volume names.
@@ -214,8 +214,8 @@ Same as bypass but lets you pick which volume to target (for external macOS inst
### version / help ### version / help
```bash ```bash
./unleash version ./runaway version
./unleash help ./runaway help
``` ```
--- ---
@@ -249,14 +249,14 @@ Global options that can go before any command:
Example: Example:
```bash ```bash
sudo ./unleash --verbose --log-file /tmp/unleash.log heal sudo ./runaway --verbose --log-file /tmp/runaway.log heal
``` ```
--- ---
## How it works ## How it works
MDM enrollment on macOS sits on four layers. Unleash addresses each one. MDM enrollment on macOS sits on four layers. Runaway addresses each one.
### Layer 1: DEP activation record ### Layer 1: DEP activation record
@@ -269,13 +269,13 @@ When an organization assigns a device in Apple Business Manager, macOS creates m
.cloudConfigTimerCheck ← "check again later" .cloudConfigTimerCheck ← "check again later"
``` ```
Unleash removes these and creates decoy files (`.cloudConfigRecordNotFound`, `.cloudConfigProfileInstalled`) that signal "no enrollment needed." Runaway removes these and creates decoy files (`.cloudConfigRecordNotFound`, `.cloudConfigProfileInstalled`) that signal "no enrollment needed."
### Layer 2: Network blocking ### Layer 2: Network blocking
The enrollment client contacts Apple servers to download the MDM profile. Without network access, it cannot complete enrollment. The enrollment client contacts Apple servers to download the MDM profile. Without network access, it cannot complete enrollment.
Unleash blocks via `/etc/hosts`: Runaway blocks via `/etc/hosts`:
- `iprofiles.apple.com` — profile delivery - `iprofiles.apple.com` — profile delivery
- `deviceenrollment.apple.com` — DEP service - `deviceenrollment.apple.com` — DEP service
@@ -308,7 +308,7 @@ macOS registers enrollment daemons that run at boot:
| `com.apple.mdmclient.daemon.runatboot` | MDM client | | `com.apple.mdmclient.daemon.runatboot` | MDM client |
| `com.apple.activationd` | Device activation | | `com.apple.activationd` | Device activation |
Unleash disables them via the launchd override at `/private/var/db/com.apple.xpc.launchd/disabled.plist`. Runaway disables them via the launchd override at `/private/var/db/com.apple.xpc.launchd/disabled.plist`.
### Layer 4: User-level cleanup ### Layer 4: User-level cleanup
@@ -321,11 +321,11 @@ Home directories carry MDM artifacts that trigger re-enrollment after login:
~/Library/LaunchAgents/com.apple.mdm.* ~/Library/LaunchAgents/com.apple.mdm.*
``` ```
Unleash removes these from every home directory on the Data volume. This is the step most scripts miss — and the reason MDM comes back after Migration Assistant. Runaway removes these from every home directory on the Data volume. This is the step most scripts miss — and the reason MDM comes back after Migration Assistant.
### Layer 5: pf firewall (optional) ### Layer 5: pf firewall (optional)
The hosts file can be bypassed by DNS-over-HTTPS or cached DNS. pf (packet filter) operates at the kernel level and is immune to both. Unleash installs pf rules that either: The hosts file can be bypassed by DNS-over-HTTPS or cached DNS. pf (packet filter) operates at the kernel level and is immune to both. Runaway installs pf rules that either:
- **firewall**: blocks Apple's entire IP range (17.0.0.0/8 + 17.128.0.0/10) — aggressive but 100% effective - **firewall**: blocks Apple's entire IP range (17.0.0.0/8 + 17.128.0.0/10) — aggressive but 100% effective
- **whitelist**: resolves only MDM domains to IPs and blocks those specifically — keeps iCloud working - **whitelist**: resolves only MDM domains to IPs and blocks those specifically — keeps iCloud working
@@ -365,11 +365,11 @@ The old bypass scripts only clean system-level artifacts (DEP markers, hosts, la
### Solution ### Solution
**From Recovery**: run `unleash bypass` (or `suppress`). This cleans both system-level and user-level artifacts. **From Recovery**: run `runaway bypass` (or `suppress`). This cleans both system-level and user-level artifacts.
**If MDM still comes back**: boot normally, run `sudo ./unleash harden` immediately after login. This kills active MDM processes and removes profiles before they can re-establish. **If MDM still comes back**: boot normally, run `sudo ./runaway harden` immediately after login. This kills active MDM processes and removes profiles before they can re-establish.
**For prevention**: run `sudo ./unleash persist` and `sudo ./unleash whitelist` before Migration Assistant. The LaunchDaemon + pf rules survive the migration and catch anything that slips through. **For prevention**: run `sudo ./runaway persist` and `sudo ./runaway whitelist` before Migration Assistant. The LaunchDaemon + pf rules survive the migration and catch anything that slips through.
## Hard lock: DFU / IPSW restore ## Hard lock: DFU / IPSW restore
@@ -386,7 +386,7 @@ If MDM is unbreakable — even from Recovery — the device may need a full firm
4. Right-click → Advanced → Restore (pick the IPSW file) 4. Right-click → Advanced → Restore (pick the IPSW file)
5. Wait 10-30 minutes for restore to finish 5. Wait 10-30 minutes for restore to finish
6. Mac reboots to Setup Assistant — **do not connect to Wi-Fi** 6. Mac reboots to Setup Assistant — **do not connect to Wi-Fi**
7. Immediately boot to Recovery (hold power) and run `unleash bypass` 7. Immediately boot to Recovery (hold power) and run `runaway bypass`
**This erases all data.** IPSW files are available at [ipsw.me](https://ipsw.me). **This erases all data.** IPSW files are available at [ipsw.me](https://ipsw.me).
@@ -398,7 +398,7 @@ All commands now log with timestamps and levels:
[INF] Data volume: /Volumes/Macintosh HD - Data [INF] Data volume: /Volumes/Macintosh HD - Data
[ OK] Admin 'apple' created (UID 501) [ OK] Admin 'apple' created (UID 501)
[WRN] DEP activation record present [WRN] DEP activation record present
[ERR] Firewall needs sudo: sudo ./unleash firewall [ERR] Firewall needs sudo: sudo ./runaway firewall
[STP] Locating Data volume by APFS role... [STP] Locating Data volume by APFS role...
[DBG] Checking pfctl availability [DBG] Checking pfctl availability
``` ```
@@ -408,8 +408,8 @@ Use `--verbose` to see debug messages and `--log-file <path>` to write everythin
## Files ## Files
``` ```
unleash/ runaway/
├── unleash # Main script (entry point) ├── runaway # Main script (entry point)
├── lib/ ├── lib/
│ ├── colors.sh # Logging, colors, prompts │ ├── colors.sh # Logging, colors, prompts
│ ├── detect.sh # Recovery detection, volume mounting │ ├── detect.sh # Recovery detection, volume mounting
@@ -432,7 +432,7 @@ unleash/
└── LICENSE (MIT) └── LICENSE (MIT)
``` ```
The standalone variant (`unleash-standalone.sh`) bundles everything into one file. Build it with `bash examples/build-standalone.sh`. The standalone variant (`runaway-standalone.sh`) bundles everything into one file. Build it with `bash examples/build-standalone.sh`.
## Limitations ## Limitations
@@ -444,7 +444,7 @@ The standalone variant (`unleash-standalone.sh`) bundles everything into one fil
## Safety ## Safety
Unleash is designed to be safe: Runaway is designed to be safe:
- **No SSV writes** — all changes target the Data volume - **No SSV writes** — all changes target the Data volume
- **Reversible** — `backup` saves state, `restore` reverts - **Reversible** — `backup` saves state, `restore` reverts
@@ -455,26 +455,26 @@ Unleash is designed to be safe:
## Troubleshooting ## Troubleshooting
### MDM comes back after reboot ### MDM comes back after reboot
Run `unleash suppress` from Recovery. If it still returns, you have Migration Assistant artifacts. Run `unleash harden` from the booted system. Run `runaway suppress` from Recovery. If it still returns, you have Migration Assistant artifacts. Run `runaway harden` from the booted system.
### profiles shows enrollment ### profiles shows enrollment
Cosmetic. The SSV stores profile state but the enrollment daemons are disabled. Run `unleash status` to check the actual state on the Data volume. Cosmetic. The SSV stores profile state but the enrollment daemons are disabled. Run `runaway status` to check the actual state on the Data volume.
### FileVault unlock fails ### FileVault unlock fails
You need a user password or the FileVault recovery key. If neither is available, the Data volume cannot be mounted from Recovery. You need a user password or the FileVault recovery key. If neither is available, the Data volume cannot be mounted from Recovery.
### "Not a macOS Data volume" ### "Not a macOS Data volume"
Unleash checks for `/private/var/db/dslocal/nodes/Default` on the mounted volume. If it's missing, you mounted the wrong disk. Run `diskutil list` to find the correct one. Runaway checks for `/private/var/db/dslocal/nodes/Default` on the mounted volume. If it's missing, you mounted the wrong disk. Run `diskutil list` to find the correct one.
### macOS 27 and later ### macOS 27 and later
[#22](https://github.com/mateussiqueira/unleash/issues/22) contains two positive [#22](https://github.com/mateussiqueira/runaway/issues/22) contains two positive
community reports for macOS 27.2: community reports for macOS 27.2:
- The [original reporter](https://github.com/mateussiqueira/unleash/issues/22#issuecomment-6522921874) - The [original reporter](https://github.com/mateussiqueira/runaway/issues/22#issuecomment-6522921874)
reports Unleash 2.0.0 working on an M1 Pro after upgrading an existing Sequoia reports Runaway 2.0.0 working on an M1 Pro after upgrading an existing Sequoia
setup. This was not a fresh installation. setup. This was not a fresh installation.
- [Another user](https://github.com/mateussiqueira/unleash/issues/22#issuecomment-6520816615) - [Another user](https://github.com/mateussiqueira/runaway/issues/22#issuecomment-6520816615)
reports basic commands working on a MacBook Neo (Apple A18 Pro). reports basic commands working on a MacBook Neo (Apple A18 Pro).
These reports answer the original question but do not establish support for every These reports answer the original question but do not establish support for every
@@ -483,11 +483,11 @@ matrix. Shell regression tests are separate from hardware validation.
### Wi-Fi on an external startup disk ### Wi-Fi on an external startup disk
[#24](https://github.com/mateussiqueira/unleash/issues/24) remains under [#24](https://github.com/mateussiqueira/runaway/issues/24) remains under
investigation. From the affected external installation, run: investigation. From the affected external installation, run:
```bash ```bash
./unleash doctor --network ./runaway doctor --network
``` ```
This read-only command reports the macOS build, Wi-Fi interface, power, link, and This read-only command reports the macOS build, Wi-Fi interface, power, link, and
@@ -501,7 +501,7 @@ A failed query is reported separately from a successful query with no Wi-Fi port
Include the script commit, Mac model, exact OS build, SSD/cable/hub connection, Include the script commit, Mac model, exact OS build, SSD/cable/hub connection,
and whether Wi-Fi worked on that same external installation before running and whether Wi-Fi worked on that same external installation before running
Unleash, if known. Working Wi-Fi on the internal installation alone does not Runaway, if known. Working Wi-Fi on the internal installation alone does not
isolate what changed on the external one. isolate what changed on the external one.
The `dualboot` code does not directly rewrite Wi-Fi preferences or toggle the The `dualboot` code does not directly rewrite Wi-Fi preferences or toggle the
@@ -515,7 +515,7 @@ disk cables or hubs, shut down before changing their connections; do not unplug
the active startup disk. the active startup disk.
### Monitor won't start ### Monitor won't start
Check if it's already running (`monitor-status`). Check permissions — it needs root. Check logs at `/var/log/unleash-monitor.log`. Check if it's already running (`monitor-status`). Check permissions — it needs root. Check logs at `/var/log/runaway-monitor.log`.
## FAQ ## FAQ
@@ -538,7 +538,7 @@ The serial stays in ABM. If the device connects to the internet with enrollment
Use `whitelist` instead of `firewall` or `suppress`. It blocks only MDM endpoints. Use `whitelist` instead of `firewall` or `suppress`. It blocks only MDM endpoints.
**Why does MDM come back after Migration Assistant?** **Why does MDM come back after Migration Assistant?**
MA copies user-level caches, preferences, and launch agents. Unleash handles this — run `bypass` or `suppress` from Recovery after migrating. MA copies user-level caches, preferences, and launch agents. Runaway handles this — run `bypass` or `suppress` from Recovery after migrating.
## Contributing ## Contributing
+15 -15
View File
@@ -1,4 +1,4 @@
# unleash # runaway
Ferramenta única para bypass/supressão de MDM no macOS. Funciona do Modo de Recuperação. Apple Silicon e Intel. Ferramenta única para bypass/supressão de MDM no macOS. Funciona do Modo de Recuperação. Apple Silicon e Intel.
@@ -8,30 +8,30 @@ Ferramenta única para bypass/supressão de MDM no macOS. Funciona do Modo de Re
```bash ```bash
# Homebrew (mais fácil) # Homebrew (mais fácil)
brew install mateussiqueira/unleash/unleash brew install mateussiqueira/runaway/runaway
# Download direto # Download direto
curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash-standalone.sh -o unleash curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/runaway-standalone.sh -o runaway
chmod +x unleash && sudo ./unleash chmod +x runaway && sudo ./runaway
``` ```
## Como usar ## Como usar
1. Copie a pasta `unleash` para um SSD externo (FAT32/APFS/exFAT) 1. Copie a pasta `runaway` para um SSD externo (FAT32/APFS/exFAT)
2. Inicialize no Modo de Recuperação: 2. Inicialize no Modo de Recuperação:
- **Apple Silicon**: segure o botão de energia → Opções → Continuar - **Apple Silicon**: segure o botão de energia → Opções → Continuar
- **Intel**: Cmd+R na inicialização - **Intel**: Cmd+R na inicialização
3. Abra o Terminal (Utilitários) e execute: 3. Abra o Terminal (Utilitários) e execute:
```bash ```bash
chmod +x "/Volumes/SeuSSD/unleash/unleash" chmod +x "/Volumes/SeuSSD/runaway/runaway"
"/Volumes/SeuSSD/unleash/unleash" "/Volumes/SeuSSD/runaway/runaway"
``` ```
Escolha "Full bypass" no menu. Ou use a linha de comando: Escolha "Full bypass" no menu. Ou use a linha de comando:
```bash ```bash
"/Volumes/SeuSSD/unleash/unleash" bypass "/Volumes/SeuSSD/runaway/runaway" bypass
``` ```
## Comandos principais ## Comandos principais
@@ -63,11 +63,11 @@ Escolha "Full bypass" no menu. Ou use a linha de comando:
## Por que não usar só o bypass-mdm? ## Por que não usar só o bypass-mdm?
O projeto original cresceu para 5 scripts (v2, v3, express, dualboot.sh, verify.sh), cada um com opções diferentes. O Unleash substitui todos em um único comando. O projeto original cresceu para 5 scripts (v2, v3, express, dualboot.sh, verify.sh), cada um com opções diferentes. O Runaway substitui todos em um único comando.
## Como funciona ## Como funciona
O MDM opera em 4 camadas. O Unleash ataca todas: O MDM opera em 4 camadas. O Runaway ataca todas:
1. **Marcadores DEP** — remove arquivos `.cloudConfig*`, cria iscas 1. **Marcadores DEP** — remove arquivos `.cloudConfig*`, cria iscas
2. **Rede** — `/etc/hosts` bloqueia 13+ domínios Apple + servidor MDM da org 2. **Rede** — `/etc/hosts` bloqueia 13+ domínios Apple + servidor MDM da org
@@ -87,19 +87,19 @@ Firewall pf (comandos `firewall`/`whitelist`) pega o que o `/etc/hosts` não con
## Migration Assistant ## Migration Assistant
Se você migrar de um Intel para Apple Silicon, o MDM vai voltar após o reboot. O Migration Assistant copia artefatos de usuário que os scripts antigos não limpam. O Unleash limpa `/Users/*/Library` explicitamente. Se você migrar de um Intel para Apple Silicon, o MDM vai voltar após o reboot. O Migration Assistant copia artefatos de usuário que os scripts antigos não limpam. O Runaway limpa `/Users/*/Library` explicitamente.
Se ainda assim voltar, execute `sudo ./unleash harden` do sistema já iniciado. Se ainda assim voltar, execute `sudo ./runaway harden` do sistema já iniciado.
## Troubleshooting ## Troubleshooting
**MDM volta após reboot** — execute `unleash suppress` da Recuperação. Se persistir, são artefatos do Migration Assistant. Execute `unleash harden` após o login. **MDM volta após reboot** — execute `runaway suppress` da Recuperação. Se persistir, são artefatos do Migration Assistant. Execute `runaway harden` após o login.
**profiles mostra matrícula** — cosmético. O SSV armazena estado de perfil em modo somente leitura. Verifique os marcadores DEP com `unleash status`. **profiles mostra matrícula** — cosmético. O SSV armazena estado de perfil em modo somente leitura. Verifique os marcadores DEP com `runaway status`.
**FileVault não desbloqueia** — você precisa da senha de um usuário ou da chave de recuperação. **FileVault não desbloqueia** — você precisa da senha de um usuário ou da chave de recuperação.
**Update do macOS** — execute `unleash heal`. Se usou `persist` antes do update, ele faz isso automaticamente. **Update do macOS** — execute `runaway heal`. Se usou `persist` antes do update, ele faz isso automaticamente.
## Limitações ## Limitações
+5 -5
View File
@@ -5,7 +5,7 @@
### July — v1.7.0 "Solidify" ### July — v1.7.0 "Solidify"
- [ ] **Resolve GitHub Actions billing** — re-enable CI/CD - [ ] **Resolve GitHub Actions billing** — re-enable CI/CD
- [ ] **Fix CI pipeline** — all checks passing on every PR - [ ] **Fix CI pipeline** — all checks passing on every PR
- [ ] **Homebrew audit** — `brew audit --strict` passes on `mateussiqueira/unleash/unleash` - [ ] **Homebrew audit** — `brew audit --strict` passes on `mateussiqueira/runaway/runaway`
- [ ] **Improve bats test coverage** — mock-based tests for firewall, monitor, vpn modules - [ ] **Improve bats test coverage** — mock-based tests for firewall, monitor, vpn modules
- [ ] **Add `--help` flag** per command (currently only global `-h`) - [ ] **Add `--help` flag** per command (currently only global `-h`)
@@ -19,7 +19,7 @@
### September — v2.0.0 "Foundation" ### September — v2.0.0 "Foundation"
- [ ] **Homebrew core** — submit PR to official Homebrew/homebrew-core - [ ] **Homebrew core** — submit PR to official Homebrew/homebrew-core
- [ ] **`docs/` site with Jekyll** — proper multi-page site, not just a single markdown file - [ ] **`docs/` site with Jekyll** — proper multi-page site, not just a single markdown file
- [ ] **`unleash init` wizard** — interactive setup: asks questions, runs doctor, suggests commands - [ ] **`runaway init` wizard** — interactive setup: asks questions, runs doctor, suggests commands
- [ ] **Release signing** — GPG-signed releases + checksums file - [ ] **Release signing** — GPG-signed releases + checksums file
- [ ] **Self-update with GPG verification** - [ ] **Self-update with GPG verification**
@@ -35,7 +35,7 @@
### November — v2.2.0 "Intelligence" ### November — v2.2.0 "Intelligence"
- [ ] **Predictive check** — given a serial number, predict which org the Mac is enrolled in - [ ] **Predictive check** — given a serial number, predict which org the Mac is enrolled in
- [ ] **Risk-based suggestions** — `unleash suggest` reads system state and recommends commands - [ ] **Risk-based suggestions** — `runaway suggest` reads system state and recommends commands
- [ ] **Remediation scripts** — per-org MDM quirks (some orgs use custom domains or certs) - [ ] **Remediation scripts** — per-org MDM quirks (some orgs use custom domains or certs)
- [ ] **Discord bot** — monitor MDM status via Discord DM - [ ] **Discord bot** — monitor MDM status via Discord DM
@@ -50,7 +50,7 @@
## Stretch goals (if time/budget allows) ## Stretch goals (if time/budget allows)
- **Windows dual-boot MDM detection** — detect if a Windows partition carries MDM payloads - **Windows dual-boot MDM detection** — detect if a Windows partition carries MDM payloads
- **Linux live USB** — standalone Linux environment with unleash pre-loaded for Recovery - **Linux live USB** — standalone Linux environment with runaway pre-loaded for Recovery
- **GUI wrapper** — simple SwiftUI app that calls the CLI - **GUI wrapper** — simple SwiftUI app that calls the CLI
- **Localization** — Spanish, French, German command output - **Localization** — Spanish, French, German command output
- **CI/CD with `act`** — documented local CI workflow for offline development - **CI/CD with `act`** — documented local CI workflow for offline development
@@ -59,4 +59,4 @@
## How to contribute ## How to contribute
Pick any unchecked item, open an issue or discussion, and submit a PR. See [CONTRIBUTING.md](https://github.com/mateussiqueira/unleash/blob/main/CONTRIBUTING.md) for guidelines. Pick any unchecked item, open an issue or discussion, and submit a PR. See [CONTRIBUTING.md](https://github.com/mateussiqueira/runaway/blob/main/CONTRIBUTING.md) for guidelines.
+3 -3
View File
@@ -13,18 +13,18 @@ This tool modifies system configuration to suppress MDM enrollment. While design
To report a vulnerability: To report a vulnerability:
1. **Do NOT** open a public issue 1. **Do NOT** open a public issue
2. Open a [security advisory](https://github.com/mateussiqueira/unleash/security/advisories) privately 2. Open a [security advisory](https://github.com/mateussiqueira/runaway/security/advisories) privately
3. Or email the maintainer directly 3. Or email the maintainer directly
## Safety Guarantees ## Safety Guarantees
- **No system volume writes**: All operations target the Data volume only - **No system volume writes**: All operations target the Data volume only
- **Reversible**: `unleash backup`/`restore` saves and reverts all changes - **Reversible**: `runaway backup`/`restore` saves and reverts all changes
- **No data loss**: Never runs `profiles renew` or erase commands - **No data loss**: Never runs `profiles renew` or erase commands
- **No ABM modification**: Does not touch Apple Business Manager records - **No ABM modification**: Does not touch Apple Business Manager records
## Known Limitations ## Known Limitations
- Serial numbers remain in ABM after bypass - Serial numbers remain in ABM after bypass
- macOS updates may reset suppression (use `unleash heal`) - macOS updates may reset suppression (use `runaway heal`)
- Profile enrollment status may still show as active (cosmetic, from SSV) - Profile enrollment status may still show as active (cosmetic, from SSV)
+5 -5
View File
@@ -1,22 +1,22 @@
{ pkgs ? import <nixpkgs> {} }: { pkgs ? import <nixpkgs> {} }:
pkgs.stdenv.mkDerivation rec { pkgs.stdenv.mkDerivation rec {
pname = "unleash"; pname = "runaway";
version = "1.6.1"; version = "1.6.1";
src = ./.; src = ./.;
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
cp unleash $out/bin/ cp runaway $out/bin/
chmod +x $out/bin/unleash chmod +x $out/bin/runaway
cp -r lib $out/lib/ cp -r lib $out/lib/
cp -r examples $out/share/unleash/ cp -r examples $out/share/runaway/
''; '';
meta = with pkgs.lib; { meta = with pkgs.lib; {
description = "Single-script MDM bypass for macOS"; description = "Single-script MDM bypass for macOS";
homepage = "https://github.com/mateussiqueira/unleash"; homepage = "https://github.com/mateussiqueira/runaway";
license = licenses.mit; license = licenses.mit;
platforms = platforms.darwin; platforms = platforms.darwin;
maintainers = [ maintainers.mateussiqueira ]; maintainers = [ maintainers.mateussiqueira ];
+2 -2
View File
@@ -1,6 +1,6 @@
title: unleash title: runaway
description: Single-script MDM bypass for macOS — covers all 5 layers of Apple MDM enrollment description: Single-script MDM bypass for macOS — covers all 5 layers of Apple MDM enrollment
url: "https://unleash-nine.vercel.app" url: "https://runaway-nine.vercel.app"
baseurl: "" baseurl: ""
theme: jekyll-theme-cayman theme: jekyll-theme-cayman
markdown: kramdown markdown: kramdown
+3 -3
View File
@@ -19,7 +19,7 @@
<a id="skip-to-content" href="#content">Skip to the content.</a> <a id="skip-to-content" href="#content">Skip to the content.</a>
<nav class="nav" role="navigation" aria-label="Documentation navigation"> <nav class="nav" role="navigation" aria-label="Documentation navigation">
<a href="/" class="logo" data-pt="/pt/">unleash</a> <a href="/" class="logo" data-pt="/pt/">runaway</a>
<div id="search-wrap"> <div id="search-wrap">
<input type="text" id="search-input" placeholder="Search docs..." autocomplete="off"> <input type="text" id="search-input" placeholder="Search docs..." autocomplete="off">
@@ -41,8 +41,8 @@
<a href="/security" data-pt="/pt/security">Security</a> <a href="/security" data-pt="/pt/security">Security</a>
<h3>External</h3> <h3>External</h3>
<a href="https://github.com/mateussiqueira/unleash" target="_blank">GitHub</a> <a href="https://github.com/mateussiqueira/runaway" target="_blank">GitHub</a>
<a href="https://github.com/mateussiqueira/unleash/blob/main/CHANGELOG.md" target="_blank">Changelog</a> <a href="https://github.com/mateussiqueira/runaway/blob/main/CHANGELOG.md" target="_blank">Changelog</a>
</nav> </nav>
<header class="page-header" role="banner"> <header class="page-header" role="banner">
+48 -48
View File
@@ -1,6 +1,6 @@
--- ---
layout: default layout: default
title: Commands Reference — unleash title: Commands Reference — runaway
--- ---
# Commands Reference # Commands Reference
@@ -19,34 +19,34 @@ title: Commands Reference — unleash
Creates a temporary admin account and suppresses all 5 layers of MDM. Creates a temporary admin account and suppresses all 5 layers of MDM.
**Must run from Recovery.** **Must run from Recovery.**
```bash ```bash
./unleash bypass ./runaway bypass
``` ```
### `suppress` ### `suppress`
Silences MDM enrollment without creating a new user. Silences MDM enrollment without creating a new user.
Works from both Recovery and booted systems. Works from both Recovery and booted systems.
```bash ```bash
sudo ./unleash suppress sudo ./runaway suppress
``` ```
### `heal` ### `heal`
Re-applies suppression after macOS updates re-enable enrollment daemons. Re-applies suppression after macOS updates re-enable enrollment daemons.
On booted systems, needs sudo. With `persist`, runs automatically on each boot. On booted systems, needs sudo. With `persist`, runs automatically on each boot.
```bash ```bash
sudo ./unleash heal sudo ./runaway heal
``` ```
### `persist` ### `persist`
Installs a LaunchDaemon that runs `heal` automatically on every boot. Installs a LaunchDaemon that runs `heal` automatically on every boot.
Survives macOS updates. Survives macOS updates.
```bash ```bash
sudo ./unleash persist sudo ./runaway persist
``` ```
### `unpersist` ### `unpersist`
Removes the persistence LaunchDaemon. Removes the persistence LaunchDaemon.
```bash ```bash
sudo ./unleash unpersist sudo ./runaway unpersist
``` ```
--- ---
@@ -64,20 +64,20 @@ Kernel-level packet filtering. Blocks Apple's entire IP range (`17.0.0.0/8`).
DoH-proof — cannot be bypassed by DNS-over-HTTPS. DoH-proof — cannot be bypassed by DNS-over-HTTPS.
**Warning:** Breaks iCloud, App Store, and system updates. **Warning:** Breaks iCloud, App Store, and system updates.
```bash ```bash
sudo ./unleash firewall sudo ./runaway firewall
``` ```
### `firewall-off` ### `firewall-off`
Removes pf firewall rules added by `firewall`. Removes pf firewall rules added by `firewall`.
```bash ```bash
sudo ./unleash firewall-off sudo ./runaway firewall-off
``` ```
### `whitelist` ### `whitelist`
Resolves only MDM domains to IPs and blocks those specifically. Resolves only MDM domains to IPs and blocks those specifically.
Keeps iCloud and App Store working while blocking MDM enrollment. Keeps iCloud and App Store working while blocking MDM enrollment.
```bash ```bash
sudo ./unleash whitelist sudo ./runaway whitelist
``` ```
--- ---
@@ -93,7 +93,7 @@ sudo ./unleash whitelist
Kills running MDM processes, removes configuration profiles, and flushes DNS cache. Kills running MDM processes, removes configuration profiles, and flushes DNS cache.
Useful when MDM is actively enrolling on a booted system. Useful when MDM is actively enrolling on a booted system.
```bash ```bash
sudo ./unleash harden sudo ./runaway harden
``` ```
### `audit` ### `audit`
@@ -104,7 +104,7 @@ Performs a deep MDM scan:
- Searches for MDM certificates - Searches for MDM certificates
- Generates a risk score (0–100) - Generates a risk score (0–100)
```bash ```bash
sudo ./unleash audit sudo ./runaway audit
``` ```
--- ---
@@ -126,7 +126,7 @@ sudo ./unleash audit
Returns **SAFE TO FORMAT** (no MDM) or **MDM DETECTED** (will lock after wipe). Returns **SAFE TO FORMAT** (no MDM) or **MDM DETECTED** (will lock after wipe).
Also checks upgrade safety for macOS updates. Also checks upgrade safety for macOS updates.
```bash ```bash
sudo ./unleash check sudo ./runaway check
``` ```
### `monitor` ### `monitor`
@@ -134,14 +134,14 @@ Background daemon that checks MDM state every 5 minutes.
Sends a macOS notification if MDM tries to re-enroll. Sends a macOS notification if MDM tries to re-enroll.
Supports optional `--webhook` for Discord alerts. Supports optional `--webhook` for Discord alerts.
```bash ```bash
sudo ./unleash monitor sudo ./runaway monitor
sudo ./unleash monitor --webhook https://discord.com/api/webhooks/... sudo ./runaway monitor --webhook https://discord.com/api/webhooks/...
``` ```
### `history` ### `history`
Shows the event log from previous monitor and heal runs. Shows the event log from previous monitor and heal runs.
```bash ```bash
sudo ./unleash history sudo ./runaway history
``` ```
--- ---
@@ -155,21 +155,21 @@ sudo ./unleash history
| `dualboot` | Target an external macOS install | | `dualboot` | Target an external macOS install |
### `backup` ### `backup`
Saves `/etc/hosts`, MDM profile state, launchd disabled overrides, and Unleash config. Saves `/etc/hosts`, MDM profile state, launchd disabled overrides, and Runaway config.
```bash ```bash
sudo ./unleash backup sudo ./runaway backup
``` ```
### `restore` ### `restore`
Reverts the system to a previously saved state. Reverts the system to a previously saved state.
```bash ```bash
sudo ./unleash restore sudo ./runaway restore
``` ```
### `dualboot` ### `dualboot`
Creates an admin account and applies suppression to an external/bootcamp volume. Creates an admin account and applies suppression to an external/bootcamp volume.
```bash ```bash
sudo ./unleash dualboot sudo ./runaway dualboot
``` ```
--- ---
@@ -188,35 +188,35 @@ sudo ./unleash dualboot
Interactive wizard that runs the full setup: Interactive wizard that runs the full setup:
firewall → monitor → persist → backup → audit. firewall → monitor → persist → backup → audit.
```bash ```bash
sudo ./unleash init sudo ./runaway init
``` ```
### `suggest` ### `suggest`
Analyzes your system and provides risk-based recommendations. Analyzes your system and provides risk-based recommendations.
```bash ```bash
sudo ./unleash suggest sudo ./runaway suggest
``` ```
### `remediate` ### `remediate`
Per-org MDM cleanup. Supports: JAMF, Mosyle, Addigy, Kandji, VMware. Per-org MDM cleanup. Supports: JAMF, Mosyle, Addigy, Kandji, VMware.
Auto-detects the org from your DEP record. Auto-detects the org from your DEP record.
```bash ```bash
sudo ./unleash remediate sudo ./runaway remediate
``` ```
### `predict` ### `predict`
Reads the serial number prefix and checks against known MDM org prefixes. Reads the serial number prefix and checks against known MDM org prefixes.
Useful before buying a used Mac. Useful before buying a used Mac.
```bash ```bash
./unleash predict ABC12345678 ./runaway predict ABC12345678
``` ```
### `telemetry` ### `telemetry`
Manages anonymous usage stats (opt-in, OFF by default). Manages anonymous usage stats (opt-in, OFF by default).
```bash ```bash
./unleash telemetry on ./runaway telemetry on
./unleash telemetry off ./runaway telemetry off
./unleash telemetry status ./runaway telemetry status
``` ```
--- ---
@@ -232,9 +232,9 @@ Manages anonymous usage stats (opt-in, OFF by default).
Designed for org-provided Macs that must enroll but should only communicate while on VPN. Designed for org-provided Macs that must enroll but should only communicate while on VPN.
Blocks MDM IPs when the device is NOT connected to your VPN tunnel. Blocks MDM IPs when the device is NOT connected to your VPN tunnel.
```bash ```bash
sudo ./unleash vpn-kill sudo ./runaway vpn-kill
sudo ./unleash vpn-kill-status sudo ./runaway vpn-kill-status
sudo ./unleash vpn-kill-remove sudo ./runaway vpn-kill-remove
``` ```
--- ---
@@ -254,40 +254,40 @@ sudo ./unleash vpn-kill-remove
### `update` ### `update`
Downloads the latest release from GitHub. GPG-verifies the signature. Downloads the latest release from GitHub. GPG-verifies the signature.
```bash ```bash
sudo ./unleash update sudo ./runaway update
``` ```
### `uninstall` ### `uninstall`
Removes all Unleash traces. Prompts for confirmation. Removes all Runaway traces. Prompts for confirmation.
```bash ```bash
sudo ./unleash uninstall sudo ./runaway uninstall
``` ```
### `reinstall` ### `reinstall`
Uninstalls then re-applies persist + whitelist + monitor. Uninstalls then re-applies persist + whitelist + monitor.
```bash ```bash
sudo ./unleash reinstall sudo ./runaway reinstall
``` ```
### `config` ### `config`
View or edit persistent settings in `~/.unleash.conf`. View or edit persistent settings in `~/.runaway.conf`.
```bash ```bash
./unleash config ./runaway config
./unleash config show ./runaway config show
./unleash config set key value ./runaway config set key value
``` ```
### `report` ### `report`
Generates a full status report. Supports `--json` for machine-readable output. Generates a full status report. Supports `--json` for machine-readable output.
```bash ```bash
sudo ./unleash report sudo ./runaway report
sudo ./unleash report --json sudo ./runaway report --json
``` ```
### `demo` ### `demo`
Runs a simulated bypass flow. No real changes are made. Runs a simulated bypass flow. No real changes are made.
```bash ```bash
./unleash demo ./runaway demo
``` ```
--- ---
@@ -302,9 +302,9 @@ Runs a simulated bypass flow. No real changes are made.
Sends Discord DMs when MDM activity is detected. Sends Discord DMs when MDM activity is detected.
```bash ```bash
sudo ./unleash discord-bot <token> <userId> sudo ./runaway discord-bot <token> <userId>
sudo ./unleash discord-bot-status sudo ./runaway discord-bot-status
sudo ./unleash discord-bot-stop sudo ./runaway discord-bot-stop
``` ```
--- ---
@@ -321,22 +321,22 @@ sudo ./unleash discord-bot-stop
Checks: root privileges, Recovery mode detection, bash version, Checks: root privileges, Recovery mode detection, bash version,
disk/volume availability required libraries, and internet connectivity. disk/volume availability required libraries, and internet connectivity.
```bash ```bash
./unleash doctor ./runaway doctor
``` ```
### `status` ### `status`
Shows DEP marker state, hosts file, daemon overrides. Shows DEP marker state, hosts file, daemon overrides.
Only works from Recovery. Use `check` or `audit` on booted systems. Only works from Recovery. Use `check` or `audit` on booted systems.
```bash ```bash
./unleash status ./runaway status
./unleash status -d ./runaway status -d
``` ```
### `test` ### `test`
Dry-run mode. Simulates a command without making real changes. Dry-run mode. Simulates a command without making real changes.
```bash ```bash
./unleash test bypass ./runaway test bypass
./unleash test all ./runaway test all
``` ```
--- ---
+7 -7
View File
@@ -1,10 +1,10 @@
## unleash v2.0.0 — Terminal Demo ## runaway v2.0.0 — Terminal Demo
``` ```
$ sudo ./unleash --version $ sudo ./runaway --version
unleash v1.6.0 runaway v1.6.0
$ sudo ./unleash check $ sudo ./runaway check
[DRY-RUN] System Assessment [DRY-RUN] System Assessment
✓ Recovery mode: yes ✓ Recovery mode: yes
✓ Data volume: /Volumes/Data (123.4 GB free) ✓ Data volume: /Volumes/Data (123.4 GB free)
@@ -13,7 +13,7 @@ $ sudo ./unleash check
⚠ Previous bypass: detected ⚠ Previous bypass: detected
VP>: SAFE TO FORMAT (no active MDM record) VP>: SAFE TO FORMAT (no active MDM record)
$ sudo ./unleash audit $ sudo ./runaway audit
[AUDIT] Deep MDM Scan [AUDIT] Deep MDM Scan
Active profiles: 0 Active profiles: 0
DEP enrollment: clean DEP enrollment: clean
@@ -21,14 +21,14 @@ $ sudo ./unleash audit
Daemon overrides: 4/4 active Daemon overrides: 4/4 active
Risk score: 0 (LOW) Risk score: 0 (LOW)
$ sudo ./unleash status -d $ sudo ./runaway status -d
[ OK] System: clean [ OK] System: clean
[ OK] Profiles: 0 [ OK] Profiles: 0
[INF] MDM: no enrollment found [INF] MDM: no enrollment found
[INF] User artifacts: none [INF] User artifacts: none
[ OK] Last check: 30s ago [ OK] Last check: 30s ago
$ sudo ./unleash report --json $ sudo ./runaway report --json
{ {
"version": "1.6.0", "version": "1.6.0",
"platform": "darwin", "platform": "darwin",
+7 -7
View File
@@ -4,13 +4,13 @@
<circle cx="18" cy="16" r="6" fill="#f38ba8"/> <circle cx="18" cy="16" r="6" fill="#f38ba8"/>
<circle cx="36" cy="16" r="6" fill="#fab387"/> <circle cx="36" cy="16" r="6" fill="#fab387"/>
<circle cx="54" cy="16" r="6" fill="#a6e3a1"/> <circle cx="54" cy="16" r="6" fill="#a6e3a1"/>
<text x="360" y="22" fill="#6c7086" text-anchor="middle" font-size="12">unleash — terminal demo</text> <text x="360" y="22" fill="#6c7086" text-anchor="middle" font-size="12">runaway — terminal demo</text>
<text x="16" y="60" fill="#89b4fa" xml:space="preserve">$ sudo ./unleash --version</text> <text x="16" y="60" fill="#89b4fa" xml:space="preserve">$ sudo ./runaway --version</text>
<text x="16" y="80" fill="#cdd6f4" xml:space="preserve">unleash v1.6.0</text> <text x="16" y="80" fill="#cdd6f4" xml:space="preserve">runaway v1.6.0</text>
<text x="16" y="100" fill="#89b4fa" xml:space="preserve">$ sudo ./unleash doctor</text> <text x="16" y="100" fill="#89b4fa" xml:space="preserve">$ sudo ./runaway doctor</text>
<text x="16" y="118" fill="#a6e3a1">✓</text> <text x="16" y="118" fill="#a6e3a1">✓</text>
<text x="32" y="118" fill="#cdd6f4">Script location: /Users/user/unleash</text> <text x="32" y="118" fill="#cdd6f4">Script location: /Users/user/runaway</text>
<text x="16" y="134" fill="#a6e3a1">✓</text> <text x="16" y="134" fill="#a6e3a1">✓</text>
<text x="32" y="134" fill="#cdd6f4">Library files: 22/22 modules loaded</text> <text x="32" y="134" fill="#cdd6f4">Library files: 22/22 modules loaded</text>
<text x="16" y="150" fill="#a6e3a1">✓</text> <text x="16" y="150" fill="#a6e3a1">✓</text>
@@ -19,7 +19,7 @@
<text x="32" y="166" fill="#cdd6f4">Recovery mode: no (limited to booted commands)</text> <text x="32" y="166" fill="#cdd6f4">Recovery mode: no (limited to booted commands)</text>
<text x="16" y="182" fill="#a6e3a1">✓</text> <text x="16" y="182" fill="#a6e3a1">✓</text>
<text x="32" y="182" fill="#cdd6f4">pfctl available</text> <text x="32" y="182" fill="#cdd6f4">pfctl available</text>
<text x="16" y="202" fill="#89b4fa" xml:space="preserve">$ sudo ./unleash check</text> <text x="16" y="202" fill="#89b4fa" xml:space="preserve">$ sudo ./runaway check</text>
<text x="16" y="220" fill="#a6e3a1">✓</text> <text x="16" y="220" fill="#a6e3a1">✓</text>
<text x="32" y="220" fill="#cdd6f4">Recovery mode: yes</text> <text x="32" y="220" fill="#cdd6f4">Recovery mode: yes</text>
<text x="16" y="236" fill="#a6e3a1">✓</text> <text x="16" y="236" fill="#a6e3a1">✓</text>
@@ -29,7 +29,7 @@
<text x="16" y="268" fill="#a6e3a1">✓</text> <text x="16" y="268" fill="#a6e3a1">✓</text>
<text x="32" y="268" fill="#cdd6f4">MDM domains blocked: 13/13</text> <text x="32" y="268" fill="#cdd6f4">MDM domains blocked: 13/13</text>
<text x="16" y="288" fill="#cba6f7" font-weight="bold" xml:space="preserve">VP>: SAFE TO FORMAT — no active MDM record</text> <text x="16" y="288" fill="#cba6f7" font-weight="bold" xml:space="preserve">VP>: SAFE TO FORMAT — no active MDM record</text>
<text x="16" y="312" fill="#89b4fa" xml:space="preserve">$ sudo ./unleash report --json</text> <text x="16" y="312" fill="#89b4fa" xml:space="preserve">$ sudo ./runaway report --json</text>
<text x="16" y="330" fill="#cdd6f4">{</text> <text x="16" y="330" fill="#cdd6f4">{</text>
<text x="16" y="346" fill="#cdd6f4"> "version": "1.6.0", "arch": "arm64",</text> <text x="16" y="346" fill="#cdd6f4"> "version": "1.6.0", "arch": "arm64",</text>
<text x="16" y="362" fill="#cdd6f4"> "mdm_enrolled": false, "risk_score": 0</text> <text x="16" y="362" fill="#cdd6f4"> "mdm_enrolled": false, "risk_score": 0</text>

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

+15 -15
View File
@@ -1,6 +1,6 @@
--- ---
layout: default layout: default
title: FAQ — unleash title: FAQ — runaway
--- ---
# FAQ # FAQ
@@ -13,7 +13,7 @@ title: FAQ — unleash
### Is this the same as bypass-mdm? ### Is this the same as bypass-mdm?
No. The original bypass-mdm scripts (v2, v3, express) only handle DEP markers and `/etc/hosts`. Unleash covers all five layers: No. The original bypass-mdm scripts (v2, v3, express) only handle DEP markers and `/etc/hosts`. Runaway covers all five layers:
- DEP markers (same as original) - DEP markers (same as original)
- Network blocking via `/etc/hosts` (same) - Network blocking via `/etc/hosts` (same)
@@ -38,7 +38,7 @@ No. Clean install wipes the Data volume. Re-run `bypass` from Recovery after rei
### Will this survive a macOS update? ### Will this survive a macOS update?
Usually yes, with `persist`. The LaunchDaemon runs `heal` automatically on the next boot after an update. Without `persist`, run `sudo ./unleash heal` manually. Usually yes, with `persist`. The LaunchDaemon runs `heal` automatically on the next boot after an update. Without `persist`, run `sudo ./runaway heal` manually.
### Can the organization track this? ### Can the organization track this?
@@ -50,13 +50,13 @@ Yes. Use `whitelist` instead of `firewall` or the basic `suppress`. It resolves
### Why does MDM come back after Migration Assistant? ### Why does MDM come back after Migration Assistant?
Migration Assistant copies user-level caches, preferences, and launch agents from the old Mac. These contain MDM enrollment artifacts that re-trigger the enrollment process. Most tools only clean system-level DEP markers — Unleash also cleans every user's Library directory. Migration Assistant copies user-level caches, preferences, and launch agents from the old Mac. These contain MDM enrollment artifacts that re-trigger the enrollment process. Most tools only clean system-level DEP markers — Runaway also cleans every user's Library directory.
### Is there a GUI? ### Is there a GUI?
Not yet. The CLI is the primary interface. A SwiftUI wrapper is on the [roadmap](https://github.com/mateussiqueira/unleash/blob/main/ROADMAP.md). Not yet. The CLI is the primary interface. A SwiftUI wrapper is on the [roadmap](https://github.com/mateussiqueira/runaway/blob/main/ROADMAP.md).
### How is unleash licensed? ### How is runaway licensed?
MIT. Free to use, modify, and distribute. MIT. Free to use, modify, and distribute.
@@ -65,7 +65,7 @@ MIT. Free to use, modify, and distribute.
### How do I know if my Mac is enrolled in MDM? ### How do I know if my Mac is enrolled in MDM?
```bash ```bash
sudo ./unleash check sudo ./runaway check
``` ```
Returns SAFE TO FORMAT (no MDM) or MDM DETECTED (will lock after wipe). Returns SAFE TO FORMAT (no MDM) or MDM DETECTED (will lock after wipe).
@@ -73,14 +73,14 @@ Returns SAFE TO FORMAT (no MDM) or MDM DETECTED (will lock after wipe).
### How do I check if the bypass is still working? ### How do I check if the bypass is still working?
```bash ```bash
sudo ./unleash status -d sudo ./runaway status -d
``` ```
Checks DEP markers, hosts file, daemon overrides, and profile enrollment state. Checks DEP markers, hosts file, daemon overrides, and profile enrollment state.
### `profiles status -v` still shows an MDM profile — why? ### `profiles status -v` still shows an MDM profile — why?
Cosmetic. macOS stores the profile enrollment state on the read-only System Sealed Volume. The actual enrollment daemons are disabled and the DEP markers are gone. Trust `unleash status` over `profiles status`. Cosmetic. macOS stores the profile enrollment state on the read-only System Sealed Volume. The actual enrollment daemons are disabled and the DEP markers are gone. Trust `runaway status` over `profiles status`.
### What's the difference between `monitor` and `persist`? ### What's the difference between `monitor` and `persist`?
@@ -104,12 +104,12 @@ It reads the serial number prefix and checks it against known MDM org prefixes (
Run from Recovery: Run from Recovery:
```bash ```bash
sudo ./unleash suppress sudo ./runaway suppress
``` ```
Or from a booted system: Or from a booted system:
```bash ```bash
sudo ./unleash harden sudo ./runaway harden
``` ```
### "Not a known DirStatus" error ### "Not a known DirStatus" error
@@ -118,7 +118,7 @@ Volume auto-detection failed. Find your Data volume:
```bash ```bash
diskutil list diskutil list
diskutil mount /dev/diskXsY diskutil mount /dev/diskXsY
./unleash bypass ./runaway bypass
``` ```
### FileVault unlock fails in Recovery ### FileVault unlock fails in Recovery
@@ -127,13 +127,13 @@ You need a user password or the FileVault recovery key. If neither is available,
### "Not a macOS Data volume" ### "Not a macOS Data volume"
Unleash checks for `/private/var/db/dslocal/nodes/Default` on the mounted volume. If it's missing, you mounted the wrong disk. Run `diskutil list` to find the correct Data volume. Runaway checks for `/private/var/db/dslocal/nodes/Default` on the mounted volume. If it's missing, you mounted the wrong disk. Run `diskutil list` to find the correct Data volume.
### Monitor won't start ### Monitor won't start
1. Check if it's already running: `sudo ./unleash monitor-status` 1. Check if it's already running: `sudo ./runaway monitor-status`
2. Check permissions: needs root 2. Check permissions: needs root
3. Check logs: `/var/log/unleash-monitor.log` 3. Check logs: `/var/log/runaway-monitor.log`
--- ---
+11 -11
View File
@@ -1,20 +1,20 @@
--- ---
layout: default layout: default
title: Architecture Guide — unleash title: Architecture Guide — runaway
--- ---
# Architecture Guide # Architecture Guide
## The Five Layers of MDM ## The Five Layers of MDM
Apple's MDM enrollment works through five independent mechanisms. Blocking just one or two is why bypass tools fail over time. Unleash addresses all five. Apple's MDM enrollment works through five independent mechanisms. Blocking just one or two is why bypass tools fail over time. Runaway addresses all five.
``` ```
Layer 1: DEP markers ─── /var/db/ConfigurationProfiles/Settings/.cloudConfig* Layer 1: DEP markers ─── /var/db/ConfigurationProfiles/Settings/.cloudConfig*
Layer 2: Hosts block ─── /etc/hosts → 0.0.0.0 deviceenrollment.apple.com Layer 2: Hosts block ─── /etc/hosts → 0.0.0.0 deviceenrollment.apple.com
Layer 3: Daemons ─── launchd disabled → ManagedClient.enroll, activationd Layer 3: Daemons ─── launchd disabled → ManagedClient.enroll, activationd
Layer 4: User data ─── ~/Library/Preferences/com.apple.mdm.* Layer 4: User data ─── ~/Library/Preferences/com.apple.mdm.*
Layer 5: pf firewall ─── pf anchor com.unleash/mdm → kernel-level drop Layer 5: pf firewall ─── pf anchor com.runaway/mdm → kernel-level drop
``` ```
### Layer 1: DEP Enrollment Markers ### Layer 1: DEP Enrollment Markers
@@ -100,8 +100,8 @@ pf (packet filter) operates at the kernel networking layer, below DNS resolution
## Script Architecture ## Script Architecture
``` ```
unleash/ runaway/
├── unleash # Main entry point — loads libs, dispatches commands ├── runaway # Main entry point — loads libs, dispatches commands
├── lib/ ├── lib/
│ ├── colors.sh # Logging, colors, prompts, show_cmd_help() │ ├── colors.sh # Logging, colors, prompts, show_cmd_help()
│ ├── detect.sh # Recovery detection, volume mounting │ ├── detect.sh # Recovery detection, volume mounting
@@ -138,28 +138,28 @@ unleash/
### Dispatch Flow ### Dispatch Flow
1. `unleash` loads all `lib/*.sh` modules 1. `runaway` loads all `lib/*.sh` modules
2. `load_config()` reads `~/.unleash.conf` (if exists) 2. `load_config()` reads `~/.runaway.conf` (if exists)
3. Command argument is matched against the `case` dispatch in main 3. Command argument is matched against the `case` dispatch in main
4. Handler function is called (e.g., `cmd_bypass`, `cmd_firewall`) 4. Handler function is called (e.g., `cmd_bypass`, `cmd_firewall`)
5. Each handler calls lib functions that do the actual work 5. Each handler calls lib functions that do the actual work
### Standalone Build ### Standalone Build
`examples/build-standalone.sh` concatenates all lib modules + main script body into a single file (`unleash-standalone.sh`, ~3200 lines). No external dependencies — runs on any macOS system with bash. `examples/build-standalone.sh` concatenates all lib modules + main script body into a single file (`runaway-standalone.sh`, ~3200 lines). No external dependencies — runs on any macOS system with bash.
## Build Process ## Build Process
1. **Source**: Individual `lib/*.sh` modules + `unleash` entry point 1. **Source**: Individual `lib/*.sh` modules + `runaway` entry point
2. **Test**: 78 Bats tests covering all modules 2. **Test**: 78 Bats tests covering all modules
3. **Build**: `bash examples/build-standalone.sh` → `unleash-standalone.sh` 3. **Build**: `bash examples/build-standalone.sh` → `runaway-standalone.sh`
4. **Sign**: `scripts/sign-release.sh` → GPG detached signature 4. **Sign**: `scripts/sign-release.sh` → GPG detached signature
5. **Release**: GitHub release with standalone + signature + checksums 5. **Release**: GitHub release with standalone + signature + checksums
## Security Design ## Security Design
### No root persistence ### No root persistence
Unleash does not install a backdoor, create hidden users, or modify the system volume. All changes are reversible. Runaway does not install a backdoor, create hidden users, or modify the system volume. All changes are reversible.
### GPG-signed releases ### GPG-signed releases
Releases are signed with a GPG key. `selfupdate` verifies the signature before applying updates. Signature verification must pass or the update is rejected. Releases are signed with a GPG key. `selfupdate` verifies the signature before applying updates. Signature verification must pass or the update is rejected.
+1 -1
View File
@@ -28,5 +28,5 @@
fill="none" stroke="#a6e3a1" stroke-width="20" stroke-linecap="round" stroke-linejoin="round"/> fill="none" stroke="#a6e3a1" stroke-width="20" stroke-linecap="round" stroke-linejoin="round"/>
<!-- Text --> <!-- Text -->
<text x="256" y="492" fill="#6c7086" font-family="SFMono-Regular,Consolas,monospace" font-size="28" text-anchor="middle" font-weight="bold" letter-spacing="4">UNLEASH</text> <text x="256" y="492" fill="#6c7086" font-family="SFMono-Regular,Consolas,monospace" font-size="28" text-anchor="middle" font-weight="bold" letter-spacing="4">RUNAWAY</text>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

+49 -49
View File
@@ -1,13 +1,13 @@
--- ---
layout: default layout: default
title: unleash title: runaway
description: Single-script MDM bypass for macOS — covers all 5 layers of Apple MDM enrollment description: Single-script MDM bypass for macOS — covers all 5 layers of Apple MDM enrollment
--- ---
<p align="center"> <p align="center">
<img src="icon.svg" width="100" alt="unleash logo"> <img src="icon.svg" width="100" alt="runaway logo">
<br> <br>
<strong>unleash</strong> <strong>runaway</strong>
<br> <br>
<em>Single-script MDM bypass for macOS</em> <em>Single-script MDM bypass for macOS</em>
</p> </p>
@@ -23,12 +23,12 @@ description: Single-script MDM bypass for macOS — covers all 5 layers of Apple
--- ---
unleash replaces the original five bypass-mdm scripts with a single file that handles every layer of Apple's MDM enrollment: DEP markers, network blocking, daemon overrides, user-level artifacts, and kernel-level firewall. Works from Recovery mode on Apple Silicon and Intel. runaway replaces the original five bypass-mdm scripts with a single file that handles every layer of Apple's MDM enrollment: DEP markers, network blocking, daemon overrides, user-level artifacts, and kernel-level firewall. Works from Recovery mode on Apple Silicon and Intel.
**What makes unleash different from other bypass tools:** **What makes runaway different from other bypass tools:**
- **Covers all 5 layers** — not just DEP markers or hosts file. Kills every path MDM uses to re-enroll. - **Covers all 5 layers** — not just DEP markers or hosts file. Kills every path MDM uses to re-enroll.
- **User-level artifact cleanup** — Migration Assistant copies MDM caches per user. Unleash cleans every home directory. - **User-level artifact cleanup** — Migration Assistant copies MDM caches per user. Runaway cleans every home directory.
- **Kernel-level pf firewall** — `/etc/hosts` is bypassed by DNS-over-HTTPS. pf is not. - **Kernel-level pf firewall** — `/etc/hosts` is bypassed by DNS-over-HTTPS. pf is not.
- **Auto-heal daemon** — survives macOS updates. `persist` + `heal` catches whatever the update resets. - **Auto-heal daemon** — survives macOS updates. `persist` + `heal` catches whatever the update resets.
- **39 commands** — bypass, suppress, monitor, harden, audit, backup, predict, remediate, and more. - **39 commands** — bypass, suppress, monitor, harden, audit, backup, predict, remediate, and more.
@@ -40,19 +40,19 @@ unleash replaces the original five bypass-mdm scripts with a single file that ha
**Homebrew (easiest)** **Homebrew (easiest)**
```bash ```bash
brew install mateussiqueira/unleash/unleash brew install mateussiqueira/runaway/runaway
``` ```
**Direct download** **Direct download**
```bash ```bash
curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash-standalone.sh -o unleash curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/runaway-standalone.sh -o runaway
chmod +x unleash chmod +x runaway
``` ```
**From a USB drive (for Recovery mode)** **From a USB drive (for Recovery mode)**
1. Format a USB/SSD as FAT32, APFS, or exFAT 1. Format a USB/SSD as FAT32, APFS, or exFAT
2. Copy the `unleash` folder (or just `unleash-standalone.sh`) to the drive 2. Copy the `runaway` folder (or just `runaway-standalone.sh`) to the drive
3. Boot to Recovery and run from `/Volumes/YourDrive/unleash` 3. Boot to Recovery and run from `/Volumes/YourDrive/runaway`
--- ---
@@ -68,7 +68,7 @@ chmod +x unleash
3. Run: 3. Run:
```bash ```bash
"/Volumes/YourDrive/unleash" bypass "/Volumes/YourDrive/runaway" bypass
``` ```
4. Follow the prompts to create a temporary admin user 4. Follow the prompts to create a temporary admin user
@@ -80,19 +80,19 @@ chmod +x unleash
If you already have a Mac that was previously bypassed and MDM came back after an update: If you already have a Mac that was previously bypassed and MDM came back after an update:
```bash ```bash
sudo ./unleash heal sudo ./runaway heal
``` ```
Or to check your current status: Or to check your current status:
```bash ```bash
sudo ./unleash status -d sudo ./runaway status -d
``` ```
### One-command setup (new Mac) ### One-command setup (new Mac)
```bash ```bash
sudo ./unleash init sudo ./runaway init
``` ```
Interactive wizard that runs the full setup: firewall, monitor, persist, backup, and audit. Interactive wizard that runs the full setup: firewall, monitor, persist, backup, and audit.
@@ -156,7 +156,7 @@ Interactive wizard that runs the full setup: firewall, monitor, persist, backup,
| `update` | Self-update from the latest GitHub release (GPG-verified) | | `update` | Self-update from the latest GitHub release (GPG-verified) |
| `uninstall` | Complete removal with safety prompts | | `uninstall` | Complete removal with safety prompts |
| `reinstall` | Uninstall + install (atomic update) | | `reinstall` | Uninstall + install (atomic update) |
| `config` | View or edit persistent settings in `~/.unleash.conf` | | `config` | View or edit persistent settings in `~/.runaway.conf` |
| `backup` | Save current state for later restore | | `backup` | Save current state for later restore |
| `restore` | Restore from a previous backup | | `restore` | Restore from a previous backup |
| `demo` | Simulated bypass flow — no real changes | | `demo` | Simulated bypass flow — no real changes |
@@ -205,8 +205,8 @@ dbs = discord-bot-stop dbs2 = discord-bot-status
### Before buying a used Mac ### Before buying a used Mac
```bash ```bash
./unleash predict ABC12345678 # check serial against known org prefixes ./runaway predict ABC12345678 # check serial against known org prefixes
./unleash check # is this Mac safe to wipe? ./runaway check # is this Mac safe to wipe?
``` ```
`predict` looks up the device serial against known MDM org prefixes. If it matches JAMF, Mosyle, or another org, you know what you're dealing with before you buy. `predict` looks up the device serial against known MDM org prefixes. If it matches JAMF, Mosyle, or another org, you know what you're dealing with before you buy.
@@ -217,14 +217,14 @@ dbs = discord-bot-stop dbs2 = discord-bot-status
2. Migration Assistant copies your old data 2. Migration Assistant copies your old data
3. MDM appears within minutes of login 3. MDM appears within minutes of login
**Fix**: Boot to Recovery and run `unleash suppress` (or `bypass` if you need a new admin user). This removes the DEP markers, user-level artifacts, and MDM preferences that MA transferred over. **Fix**: Boot to Recovery and run `runaway suppress` (or `bypass` if you need a new admin user). This removes the DEP markers, user-level artifacts, and MDM preferences that MA transferred over.
### macOS update brought MDM back ### macOS update brought MDM back
1. System update restores enrollment daemons automatically 1. System update restores enrollment daemons automatically
2. MDM block in `/etc/hosts` is often preserved 2. MDM block in `/etc/hosts` is often preserved
**Fix**: `sudo ./unleash heal` — re-disables daemons and re-checks all layers. If you ran `persist` before the update, this happens automatically on the next boot. **Fix**: `sudo ./runaway heal` — re-disables daemons and re-checks all layers. If you ran `persist` before the update, this happens automatically on the next boot.
### Buying a former office Mac ### Buying a former office Mac
@@ -233,23 +233,23 @@ dbs = discord-bot-stop dbs2 = discord-bot-status
**Strategy**: **Strategy**:
- Boot to Recovery without connecting to Wi-Fi - Boot to Recovery without connecting to Wi-Fi
- Run `unleash bypass` before the device ever phones home - Run `runaway bypass` before the device ever phones home
- Run `unleash persist` and `unleash whitelist` so it stays clean - Run `runaway persist` and `runaway whitelist` so it stays clean
- The serial stays in ABM forever — but as long as the device never connects with full protections removed, it will not re-enroll - The serial stays in ABM forever — but as long as the device never connects with full protections removed, it will not re-enroll
### Used Mac that already has a user logged in ### Used Mac that already has a user logged in
```bash ```bash
sudo ./unleash audit # check current state sudo ./runaway audit # check current state
sudo ./unleash harden # kill MDM processes immediately sudo ./runaway harden # kill MDM processes immediately
sudo ./unleash whitelist # block MDM while keeping iCloud sudo ./runaway whitelist # block MDM while keeping iCloud
sudo ./unleash persist # survive future updates sudo ./runaway persist # survive future updates
``` ```
### Setting up a new Mac before first boot ### Setting up a new Mac before first boot
1. Boot to Recovery without Wi-Fi 1. Boot to Recovery without Wi-Fi
2. Run `unleash init` — interactive wizard 2. Run `runaway init` — interactive wizard
3. It will: suppress MDM, install persist, install whitelist, run audit 3. It will: suppress MDM, install persist, install whitelist, run audit
4. Reboot, set up normally, MDM never bothers you 4. Reboot, set up normally, MDM never bothers you
@@ -257,7 +257,7 @@ sudo ./unleash persist # survive future updates
## How It Works ## How It Works
MDM (Mobile Device Management) operates in five layers on macOS. Unleash blocks every layer: MDM (Mobile Device Management) operates in five layers on macOS. Runaway blocks every layer:
**Layer 1: DEP enrollment markers** → `/etc/hosts` block → **Layer 2: Network blocking** **Layer 1: DEP enrollment markers** → `/etc/hosts` block → **Layer 2: Network blocking**
@@ -269,13 +269,13 @@ MDM (Mobile Device Management) operates in five layers on macOS. Unleash blocks
In `/var/db/ConfigurationProfiles/Settings/`, Apple stores `.cloudConfig*` files that flag the Mac as DEP-enrolled. Removing these is the standard bypass approach, but macOS can recreate them from cached data. In `/var/db/ConfigurationProfiles/Settings/`, Apple stores `.cloudConfig*` files that flag the Mac as DEP-enrolled. Removing these is the standard bypass approach, but macOS can recreate them from cached data.
**What unleash does**: Removes all `.cloudConfig*` markers, creates decoy files that tell macOS the device was never enrolled, and prevents re-creation by also blocking the network layer. **What runaway does**: Removes all `.cloudConfig*` markers, creates decoy files that tell macOS the device was never enrolled, and prevents re-creation by also blocking the network layer.
### Layer 2: Network blocking ### Layer 2: Network blocking
The MDM enrollment process phones home to Apple's servers. Blocking these domains prevents the device from checking in. The MDM enrollment process phones home to Apple's servers. Blocking these domains prevents the device from checking in.
**What unleash does**: **What runaway does**:
- **`/etc/hosts`** (basic): Blocks 13+ Apple MDM domains including `deviceenrollment.apple.com`, `mdmenrollment.apple.com`, `iprofiles.apple.com`. Both IPv4 (0.0.0.0) and IPv6 (::) entries. - **`/etc/hosts`** (basic): Blocks 13+ Apple MDM domains including `deviceenrollment.apple.com`, `mdmenrollment.apple.com`, `iprofiles.apple.com`. Both IPv4 (0.0.0.0) and IPv6 (::) entries.
- **pf firewall** (advanced): Kernel-level packet filtering that blocks MDM IP ranges even when DoH is used. - **pf firewall** (advanced): Kernel-level packet filtering that blocks MDM IP ranges even when DoH is used.
@@ -309,7 +309,7 @@ macOS ships with enrollment daemons that trigger enrollment on boot:
| `com.apple.mdmclient.daemon.runatboot` | MDM client | | `com.apple.mdmclient.daemon.runatboot` | MDM client |
| `com.apple.activationd` | Device activation | | `com.apple.activationd` | Device activation |
**What unleash does**: Creates launchd disabled overrides for all four, preventing them from starting. Also disables Spotlight shortcut for Remote Management. **What runaway does**: Creates launchd disabled overrides for all four, preventing them from starting. Also disables Spotlight shortcut for Remote Management.
### Layer 4: User-level artifacts ### Layer 4: User-level artifacts
@@ -322,7 +322,7 @@ Migration Assistant and login caches leave MDM enrollment data in home directori
~/Library/LaunchAgents/com.apple.mdm.* ~/Library/LaunchAgents/com.apple.mdm.*
``` ```
**What unleash does**: Scans every user's Library directory and removes all MDM-related preferences, caches, and launch agents. This is the step most other tools miss. **What runaway does**: Scans every user's Library directory and removes all MDM-related preferences, caches, and launch agents. This is the step most other tools miss.
### Layer 5: pf firewall (optional, advanced) ### Layer 5: pf firewall (optional, advanced)
@@ -370,11 +370,11 @@ Should work on any version that uses the same MDM enrollment mechanism — which
The most likely cause is user-level artifacts. Run from Recovery: The most likely cause is user-level artifacts. Run from Recovery:
```bash ```bash
sudo ./unleash suppress sudo ./runaway suppress
``` ```
Or from a booted system: Or from a booted system:
```bash ```bash
sudo ./unleash harden sudo ./runaway harden
``` ```
### "Not a known DirStatus" error ### "Not a known DirStatus" error
@@ -382,22 +382,22 @@ sudo ./unleash harden
The script auto-detects volume names, but if you have a non-standard setup: The script auto-detects volume names, but if you have a non-standard setup:
1. Run `diskutil list` to find your Data volume 1. Run `diskutil list` to find your Data volume
2. Mount it: `diskutil mount /dev/diskXsY` 2. Mount it: `diskutil mount /dev/diskXsY`
3. Re-run unleash 3. Re-run runaway
### Profiles still shows enrollment ### Profiles still shows enrollment
This is cosmetic. macOS stores profile state on the read-only SSV (System Sealed Volume). Check the actual DEP markers instead: This is cosmetic. macOS stores profile state on the read-only SSV (System Sealed Volume). Check the actual DEP markers instead:
```bash ```bash
sudo ./unleash status -d sudo ./runaway status -d
``` ```
### FileVault is enabled ### FileVault is enabled
Unleash will detect FileVault and prompt for the recovery key or volume password. If automatic unlock fails, unlock the volume manually in Disk Utility first. Runaway will detect FileVault and prompt for the recovery key or volume password. If automatic unlock fails, unlock the volume manually in Disk Utility first.
### macOS update re-enabled MDM ### macOS update re-enabled MDM
Run `sudo ./unleash heal` after any macOS update. If you used `persist` before the update, it does this automatically on next boot. Run `sudo ./runaway heal` after any macOS update. If you used `persist` before the update, it does this automatically on next boot.
### Can I use iCloud after bypass? ### Can I use iCloud after bypass?
@@ -416,7 +416,7 @@ You need a second Mac with Apple Configurator 2 (free), a USB-C cable, and the I
2. Connect the locked Mac via USB-C while holding power 2. Connect the locked Mac via USB-C while holding power
3. In Configurator: right-click the DFU device → Advanced → Restore 3. In Configurator: right-click the DFU device → Advanced → Restore
4. Pick the IPSW file, wait 10–30 minutes 4. Pick the IPSW file, wait 10–30 minutes
5. After restore, boot to Recovery without Wi-Fi and run `unleash bypass` 5. After restore, boot to Recovery without Wi-Fi and run `runaway bypass`
**This erases all data.** IPSW files at [ipsw.me](https://ipsw.me). **This erases all data.** IPSW files at [ipsw.me](https://ipsw.me).
@@ -430,7 +430,7 @@ All commands log with timestamps and levels:
[INF] Data volume: /Volumes/Macintosh HD - Data [INF] Data volume: /Volumes/Macintosh HD - Data
[ OK] Admin 'apple' created (UID 501) [ OK] Admin 'apple' created (UID 501)
[WRN] DEP activation record present [WRN] DEP activation record present
[ERR] Firewall needs sudo: sudo ./unleash firewall [ERR] Firewall needs sudo: sudo ./runaway firewall
[STP] Locating Data volume by APFS role... [STP] Locating Data volume by APFS role...
[DBG] Checking pfctl availability [DBG] Checking pfctl availability
``` ```
@@ -451,14 +451,14 @@ Use `--verbose` for debug messages and `--log-file <path>` to write everything t
## Links ## Links
- [GitHub Repository](https://github.com/mateussiqueira/unleash) - [GitHub Repository](https://github.com/mateussiqueira/runaway)
- [Full README](https://github.com/mateussiqueira/unleash/blob/main/README.md) - [Full README](https://github.com/mateussiqueira/runaway/blob/main/README.md)
- [Architecture Guide](guide) - [Architecture Guide](guide)
- [FAQ](faq) - [FAQ](faq)
- [Quick Reference (QUICKSTART.md)](https://github.com/mateussiqueira/unleash/blob/main/QUICKSTART.md) - [Quick Reference (QUICKSTART.md)](https://github.com/mateussiqueira/runaway/blob/main/QUICKSTART.md)
- [Changelog](https://github.com/mateussiqueira/unleash/blob/main/CHANGELOG.md) - [Changelog](https://github.com/mateussiqueira/runaway/blob/main/CHANGELOG.md)
- [Contributing](https://github.com/mateussiqueira/unleash/blob/main/CONTRIBUTING.md) - [Contributing](https://github.com/mateussiqueira/runaway/blob/main/CONTRIBUTING.md)
- [Code of Conduct](https://github.com/mateussiqueira/unleash/blob/main/CODE_OF_CONDUCT.md) - [Code of Conduct](https://github.com/mateussiqueira/runaway/blob/main/CODE_OF_CONDUCT.md)
- [Security Policy](https://github.com/mateussiqueira/unleash/blob/main/SECURITY.md) - [Security Policy](https://github.com/mateussiqueira/runaway/blob/main/SECURITY.md)
- [Discussions](https://github.com/mateussiqueira/unleash/discussions) - [Discussions](https://github.com/mateussiqueira/runaway/discussions)
- [Report a Bug](https://github.com/mateussiqueira/unleash/issues/new?template=bug_report.md) - [Report a Bug](https://github.com/mateussiqueira/runaway/issues/new?template=bug_report.md)
+17 -17
View File
@@ -1,6 +1,6 @@
--- ---
layout: default layout: default
title: Installation — unleash title: Installation — runaway
--- ---
# Installation # Installation
@@ -8,51 +8,51 @@ title: Installation — unleash
## Homebrew (easiest) ## Homebrew (easiest)
```bash ```bash
brew tap mateussiqueira/unleash brew tap mateussiqueira/runaway
brew install unleash brew install runaway
``` ```
Or in one step: Or in one step:
```bash ```bash
brew install mateussiqueira/unleash/unleash brew install mateussiqueira/runaway/runaway
``` ```
## Direct download ## Direct download
```bash ```bash
curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash-standalone.sh -o unleash curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/runaway-standalone.sh -o runaway
chmod +x unleash chmod +x runaway
sudo ./unleash init sudo ./runaway init
``` ```
## From a USB drive (for Recovery mode) ## From a USB drive (for Recovery mode)
1. Format a USB/SSD as **FAT32**, **APFS**, or **exFAT** 1. Format a USB/SSD as **FAT32**, **APFS**, or **exFAT**
2. Copy the `unleash` folder (or just `unleash-standalone.sh`) to the drive 2. Copy the `runaway` folder (or just `runaway-standalone.sh`) to the drive
3. Boot to Recovery and run from `/Volumes/YourDrive/unleash` 3. Boot to Recovery and run from `/Volumes/YourDrive/runaway`
## Via curl in Recovery (needs internet) ## Via curl in Recovery (needs internet)
```bash ```bash
curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash -o /tmp/unleash curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/runaway -o /tmp/runaway
chmod +x /tmp/unleash && /tmp/unleash bypass chmod +x /tmp/runaway && /tmp/runaway bypass
``` ```
## Building from source ## Building from source
```bash ```bash
git clone https://github.com/mateussiqueira/unleash.git git clone https://github.com/mateussiqueira/runaway.git
cd unleash cd runaway
bash examples/build-standalone.sh bash examples/build-standalone.sh
# Output: unleash-standalone.sh (~3200 lines) # Output: runaway-standalone.sh (~3200 lines)
``` ```
## Verifying the installation ## Verifying the installation
```bash ```bash
./unleash version ./runaway version
# → unleash v2.0.0 # → runaway v2.0.0
./unleash doctor ./runaway doctor
# Runs pre-flight diagnostics # Runs pre-flight diagnostics
``` ```
+2 -2
View File
@@ -18,10 +18,10 @@
<circle cx="78" cy="80" r="6" fill="#f38ba8"/> <circle cx="78" cy="80" r="6" fill="#f38ba8"/>
<circle cx="96" cy="80" r="6" fill="#fab387"/> <circle cx="96" cy="80" r="6" fill="#fab387"/>
<circle cx="114" cy="80" r="6" fill="#a6e3a1"/> <circle cx="114" cy="80" r="6" fill="#a6e3a1"/>
<text x="200" y="86" fill="#6c7086" text-anchor="middle" font-family="SFMono-Regular,Consolas,monospace" font-size="13">unleash</text> <text x="200" y="86" fill="#6c7086" text-anchor="middle" font-family="SFMono-Regular,Consolas,monospace" font-size="13">runaway</text>
<!-- Terminal lines --> <!-- Terminal lines -->
<text x="76" y="136" fill="#89b4fa" font-family="SFMono-Regular,Consolas,monospace" font-size="14">$ ./unleash bypass</text> <text x="76" y="136" fill="#89b4fa" font-family="SFMono-Regular,Consolas,monospace" font-size="14">$ ./runaway bypass</text>
<!-- Progress bar animation --> <!-- Progress bar animation -->
<rect x="76" y="156" width="248" height="8" fill="#313244" rx="4"/> <rect x="76" y="156" width="248" height="8" fill="#313244" rx="4"/>

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

+48 -48
View File
@@ -1,6 +1,6 @@
--- ---
layout: default layout: default
title: Referência de Comandos — unleash title: Referência de Comandos — runaway
--- ---
# Referência de Comandos # Referência de Comandos
@@ -19,34 +19,34 @@ title: Referência de Comandos — unleash
Cria uma conta admin temporária e suprime todas as 5 camadas do MDM. Cria uma conta admin temporária e suprime todas as 5 camadas do MDM.
**Deve executar do Recovery.** **Deve executar do Recovery.**
```bash ```bash
./unleash bypass ./runaway bypass
``` ```
### `suppress` ### `suppress`
Silencia o registro MDM sem criar um novo usuário. Silencia o registro MDM sem criar um novo usuário.
Funciona tanto do Recovery quanto do sistema já iniciado. Funciona tanto do Recovery quanto do sistema já iniciado.
```bash ```bash
sudo ./unleash suppress sudo ./runaway suppress
``` ```
### `heal` ### `heal`
Reaplica a supressão após atualizações do macOS reativarem os daemons de registro. Reaplica a supressão após atualizações do macOS reativarem os daemons de registro.
Em sistemas já iniciados, precisa de sudo. Com `persist`, executa automaticamente em cada inicialização. Em sistemas já iniciados, precisa de sudo. Com `persist`, executa automaticamente em cada inicialização.
```bash ```bash
sudo ./unleash heal sudo ./runaway heal
``` ```
### `persist` ### `persist`
Instala um LaunchDaemon que executa `heal` automaticamente em cada inicialização. Instala um LaunchDaemon que executa `heal` automaticamente em cada inicialização.
Sobrevive a atualizações do macOS. Sobrevive a atualizações do macOS.
```bash ```bash
sudo ./unleash persist sudo ./runaway persist
``` ```
### `unpersist` ### `unpersist`
Remove o LaunchDaemon de persistência. Remove o LaunchDaemon de persistência.
```bash ```bash
sudo ./unleash unpersist sudo ./runaway unpersist
``` ```
--- ---
@@ -64,20 +64,20 @@ Filtragem de pacotes a nível de kernel. Bloqueia toda a faixa de IP da Apple (`
À prova de DoH — não pode ser contornado por DNS-over-HTTPS. À prova de DoH — não pode ser contornado por DNS-over-HTTPS.
**Aviso:** Quebra iCloud, App Store e atualizações do sistema. **Aviso:** Quebra iCloud, App Store e atualizações do sistema.
```bash ```bash
sudo ./unleash firewall sudo ./runaway firewall
``` ```
### `firewall-off` ### `firewall-off`
Remove as regras pf adicionadas por `firewall`. Remove as regras pf adicionadas por `firewall`.
```bash ```bash
sudo ./unleash firewall-off sudo ./runaway firewall-off
``` ```
### `whitelist` ### `whitelist`
Resolve apenas domínios MDM para IPs e bloqueia especificamente aqueles. Resolve apenas domínios MDM para IPs e bloqueia especificamente aqueles.
Mantém iCloud e App Store funcionando enquanto bloqueia o registro MDM. Mantém iCloud e App Store funcionando enquanto bloqueia o registro MDM.
```bash ```bash
sudo ./unleash whitelist sudo ./runaway whitelist
``` ```
--- ---
@@ -93,7 +93,7 @@ sudo ./unleash whitelist
Mata processos MDM em execução, remove perfis de configuração e limpa o cache DNS. Mata processos MDM em execução, remove perfis de configuração e limpa o cache DNS.
Útil quando o MDM está registrando ativamente em um sistema já iniciado. Útil quando o MDM está registrando ativamente em um sistema já iniciado.
```bash ```bash
sudo ./unleash harden sudo ./runaway harden
``` ```
### `audit` ### `audit`
@@ -104,7 +104,7 @@ Executa uma varredura MDM profunda:
- Procura certificados MDM - Procura certificados MDM
- Gera um score de risco (0–100) - Gera um score de risco (0–100)
```bash ```bash
sudo ./unleash audit sudo ./runaway audit
``` ```
--- ---
@@ -126,7 +126,7 @@ sudo ./unleash audit
Retorna **SAFE TO FORMAT** (sem MDM) ou **MDM DETECTED** (vai travar após limpar). Retorna **SAFE TO FORMAT** (sem MDM) ou **MDM DETECTED** (vai travar após limpar).
Também verifica segurança para atualizações do macOS. Também verifica segurança para atualizações do macOS.
```bash ```bash
sudo ./unleash check sudo ./runaway check
``` ```
### `monitor` ### `monitor`
@@ -134,14 +134,14 @@ Daemon em segundo plano que verifica o estado do MDM a cada 5 minutos.
Envia uma notificação do macOS se o MDM tentar re-registrar. Envia uma notificação do macOS se o MDM tentar re-registrar.
Suporta `--webhook` opcional para alertas no Discord. Suporta `--webhook` opcional para alertas no Discord.
```bash ```bash
sudo ./unleash monitor sudo ./runaway monitor
sudo ./unleash monitor --webhook https://discord.com/api/webhooks/... sudo ./runaway monitor --webhook https://discord.com/api/webhooks/...
``` ```
### `history` ### `history`
Mostra o log de eventos de execuções anteriores do monitor e heal. Mostra o log de eventos de execuções anteriores do monitor e heal.
```bash ```bash
sudo ./unleash history sudo ./runaway history
``` ```
--- ---
@@ -155,21 +155,21 @@ sudo ./unleash history
| `dualboot` | Mira uma instalação macOS externa | | `dualboot` | Mira uma instalação macOS externa |
### `backup` ### `backup`
Salva `/etc/hosts`, estado dos perfis MDM, overrides launchd desabilitados e config do Unleash. Salva `/etc/hosts`, estado dos perfis MDM, overrides launchd desabilitados e config do Runaway.
```bash ```bash
sudo ./unleash backup sudo ./runaway backup
``` ```
### `restore` ### `restore`
Reverte o sistema para um estado salvo anteriormente. Reverte o sistema para um estado salvo anteriormente.
```bash ```bash
sudo ./unleash restore sudo ./runaway restore
``` ```
### `dualboot` ### `dualboot`
Cria uma conta admin e aplica supressão em um volume externo/bootcamp. Cria uma conta admin e aplica supressão em um volume externo/bootcamp.
```bash ```bash
sudo ./unleash dualboot sudo ./runaway dualboot
``` ```
--- ---
@@ -188,35 +188,35 @@ sudo ./unleash dualboot
Assistente interativo que executa a configuração completa: Assistente interativo que executa a configuração completa:
firewall → monitor → persist → backup → audit. firewall → monitor → persist → backup → audit.
```bash ```bash
sudo ./unleash init sudo ./runaway init
``` ```
### `suggest` ### `suggest`
Analisa seu sistema e fornece recomendações baseadas em risco. Analisa seu sistema e fornece recomendações baseadas em risco.
```bash ```bash
sudo ./unleash suggest sudo ./runaway suggest
``` ```
### `remediate` ### `remediate`
Limpeza MDM por organização. Suporta: JAMF, Mosyle, Addigy, Kandji, VMware. Limpeza MDM por organização. Suporta: JAMF, Mosyle, Addigy, Kandji, VMware.
Detecta automaticamente a organização a partir do registro DEP. Detecta automaticamente a organização a partir do registro DEP.
```bash ```bash
sudo ./unleash remediate sudo ./runaway remediate
``` ```
### `predict` ### `predict`
Lê o prefixo do número serial e verifica contra prefixos conhecidos de organizações MDM. Lê o prefixo do número serial e verifica contra prefixos conhecidos de organizações MDM.
Útil antes de comprar um Mac usado. Útil antes de comprar um Mac usado.
```bash ```bash
./unleash predict ABC12345678 ./runaway predict ABC12345678
``` ```
### `telemetry` ### `telemetry`
Gerencia estatísticas anônimas de uso (opt-in, DESLIGADO por padrão). Gerencia estatísticas anônimas de uso (opt-in, DESLIGADO por padrão).
```bash ```bash
./unleash telemetry on ./runaway telemetry on
./unleash telemetry off ./runaway telemetry off
./unleash telemetry status ./runaway telemetry status
``` ```
--- ---
@@ -232,9 +232,9 @@ Gerencia estatísticas anônimas de uso (opt-in, DESLIGADO por padrão).
Projetado para Macs fornecidos por organizações que precisam registrar mas só devem se comunicar enquanto na VPN. Projetado para Macs fornecidos por organizações que precisam registrar mas só devem se comunicar enquanto na VPN.
Bloqueia IPs MDM quando o dispositivo NÃO está conectado ao túnel VPN. Bloqueia IPs MDM quando o dispositivo NÃO está conectado ao túnel VPN.
```bash ```bash
sudo ./unleash vpn-kill sudo ./runaway vpn-kill
sudo ./unleash vpn-kill-status sudo ./runaway vpn-kill-status
sudo ./unleash vpn-kill-remove sudo ./runaway vpn-kill-remove
``` ```
--- ---
@@ -254,40 +254,40 @@ sudo ./unleash vpn-kill-remove
### `update` ### `update`
Baixa o último release do GitHub. Verifica a assinatura GPG. Baixa o último release do GitHub. Verifica a assinatura GPG.
```bash ```bash
sudo ./unleash update sudo ./runaway update
``` ```
### `uninstall` ### `uninstall`
Remove todos os vestígios do Unleash. Pede confirmação. Remove todos os vestígios do Runaway. Pede confirmação.
```bash ```bash
sudo ./unleash uninstall sudo ./runaway uninstall
``` ```
### `reinstall` ### `reinstall`
Desinstala e então reaplica persist + whitelist + monitor. Desinstala e então reaplica persist + whitelist + monitor.
```bash ```bash
sudo ./unleash reinstall sudo ./runaway reinstall
``` ```
### `config` ### `config`
Ver ou editar configurações persistentes em `~/.unleash.conf`. Ver ou editar configurações persistentes em `~/.runaway.conf`.
```bash ```bash
./unleash config ./runaway config
./unleash config show ./runaway config show
./unleash config set key value ./runaway config set key value
``` ```
### `report` ### `report`
Gera um relatório completo de status. Suporta `--json` para saída legível por máquina. Gera um relatório completo de status. Suporta `--json` para saída legível por máquina.
```bash ```bash
sudo ./unleash report sudo ./runaway report
sudo ./unleash report --json sudo ./runaway report --json
``` ```
### `demo` ### `demo`
Executa um fluxo de bypass simulado. Nenhuma alteração real é feita. Executa um fluxo de bypass simulado. Nenhuma alteração real é feita.
```bash ```bash
./unleash demo ./runaway demo
``` ```
--- ---
@@ -302,9 +302,9 @@ Executa um fluxo de bypass simulado. Nenhuma alteração real é feita.
Envia DMs no Discord quando atividade MDM é detectada. Envia DMs no Discord quando atividade MDM é detectada.
```bash ```bash
sudo ./unleash discord-bot <token> <userId> sudo ./runaway discord-bot <token> <userId>
sudo ./unleash discord-bot-status sudo ./runaway discord-bot-status
sudo ./unleash discord-bot-stop sudo ./runaway discord-bot-stop
``` ```
--- ---
@@ -321,22 +321,22 @@ sudo ./unleash discord-bot-stop
Verifica: privilégios root, detecção do modo Recovery, versão do bash, Verifica: privilégios root, detecção do modo Recovery, versão do bash,
disco/volume, bibliotecas necessárias e conectividade com a internet. disco/volume, bibliotecas necessárias e conectividade com a internet.
```bash ```bash
./unleash doctor ./runaway doctor
``` ```
### `status` ### `status`
Mostra estado dos marcadores DEP, arquivo hosts, overrides de daemon. Mostra estado dos marcadores DEP, arquivo hosts, overrides de daemon.
Só funciona do Recovery. Use `check` ou `audit` em sistemas já iniciados. Só funciona do Recovery. Use `check` ou `audit` em sistemas já iniciados.
```bash ```bash
./unleash status ./runaway status
./unleash status -d ./runaway status -d
``` ```
### `test` ### `test`
Modo dry-run. Simula um comando sem fazer alterações reais. Modo dry-run. Simula um comando sem fazer alterações reais.
```bash ```bash
./unleash test bypass ./runaway test bypass
./unleash test all ./runaway test all
``` ```
--- ---
+14 -14
View File
@@ -1,6 +1,6 @@
--- ---
layout: default layout: default
title: FAQ — unleash title: FAQ — runaway
--- ---
# FAQ # FAQ
@@ -13,7 +13,7 @@ title: FAQ — unleash
### É a mesma coisa que bypass-mdm? ### É a mesma coisa que bypass-mdm?
Não. Os scripts originais do bypass-mdm (v2, v3, express) só lidam com marcadores DEP e `/etc/hosts`. O Unleash cobre todas as cinco camadas: Não. Os scripts originais do bypass-mdm (v2, v3, express) só lidam com marcadores DEP e `/etc/hosts`. O Runaway cobre todas as cinco camadas:
- Marcadores DEP (igual ao original) - Marcadores DEP (igual ao original)
- Bloqueio de rede via `/etc/hosts` (igual) - Bloqueio de rede via `/etc/hosts` (igual)
@@ -38,7 +38,7 @@ Não. A instalação limpa apaga o volume de Dados. Execute `bypass` do Recovery
### Sobrevive a uma atualização do macOS? ### Sobrevive a uma atualização do macOS?
Geralmente sim, com `persist`. O LaunchDaemon executa `heal` automaticamente na próxima inicialização após uma atualização. Sem `persist`, execute `sudo ./unleash heal` manualmente. Geralmente sim, com `persist`. O LaunchDaemon executa `heal` automaticamente na próxima inicialização após uma atualização. Sem `persist`, execute `sudo ./runaway heal` manualmente.
### A organização pode rastrear isso? ### A organização pode rastrear isso?
@@ -50,11 +50,11 @@ Sim. Use `whitelist` em vez de `firewall` ou `suppress` básico. Ele resolve ape
### Por que o MDM volta depois do Migration Assistant? ### Por que o MDM volta depois do Migration Assistant?
O Migration Assistant copia caches, preferências e launch agents do Mac antigo. Estes contêm artefatos de registro MDM que reativam o processo de registro. A maioria das ferramentas só limpa marcadores DEP de nível de sistema — o Unleash também limpa o diretório Library de cada usuário. O Migration Assistant copia caches, preferências e launch agents do Mac antigo. Estes contêm artefatos de registro MDM que reativam o processo de registro. A maioria das ferramentas só limpa marcadores DEP de nível de sistema — o Runaway também limpa o diretório Library de cada usuário.
### Tem interface gráfica? ### Tem interface gráfica?
Ainda não. A CLI é a interface principal. Um wrapper SwiftUI está no [roadmap](https://github.com/mateussiqueira/unleash/blob/main/ROADMAP.md). Ainda não. A CLI é a interface principal. Um wrapper SwiftUI está no [roadmap](https://github.com/mateussiqueira/runaway/blob/main/ROADMAP.md).
### Qual é a licença? ### Qual é a licença?
@@ -65,7 +65,7 @@ MIT. Gratuito para usar, modificar e distribuir.
### Como saber se meu Mac está registrado no MDM? ### Como saber se meu Mac está registrado no MDM?
```bash ```bash
sudo ./unleash check sudo ./runaway check
``` ```
Retorna SAFE TO FORMAT (sem MDM) ou MDM DETECTED (vai travar após limpar). Retorna SAFE TO FORMAT (sem MDM) ou MDM DETECTED (vai travar após limpar).
@@ -73,14 +73,14 @@ Retorna SAFE TO FORMAT (sem MDM) ou MDM DETECTED (vai travar após limpar).
### Como verificar se o bypass ainda está funcionando? ### Como verificar se o bypass ainda está funcionando?
```bash ```bash
sudo ./unleash status -d sudo ./runaway status -d
``` ```
Verifica marcadores DEP, arquivo hosts, overrides de daemon e estado dos perfis. Verifica marcadores DEP, arquivo hosts, overrides de daemon e estado dos perfis.
### `profiles status -v` ainda mostra um perfil MDM — por quê? ### `profiles status -v` ainda mostra um perfil MDM — por quê?
Cosmético. O macOS armazena o estado dos perfis no SSV (Volume Selado do Sistema) somente leitura. Os daemons de registro reais estão desabilitados e os marcadores DEP foram removidos. Confie em `unleash status` em vez de `profiles status`. Cosmético. O macOS armazena o estado dos perfis no SSV (Volume Selado do Sistema) somente leitura. Os daemons de registro reais estão desabilitados e os marcadores DEP foram removidos. Confie em `runaway status` em vez de `profiles status`.
### Qual a diferença entre `monitor` e `persist`? ### Qual a diferença entre `monitor` e `persist`?
@@ -104,12 +104,12 @@ Ele lê o prefixo do número serial e verifica contra prefixos conhecidos de org
Execute do Recovery: Execute do Recovery:
```bash ```bash
sudo ./unleash suppress sudo ./runaway suppress
``` ```
Ou de um sistema já iniciado: Ou de um sistema já iniciado:
```bash ```bash
sudo ./unleash harden sudo ./runaway harden
``` ```
### Erro "Not a known DirStatus" ### Erro "Not a known DirStatus"
@@ -118,7 +118,7 @@ A detecção automática de volume falhou. Encontre seu volume de Dados:
```bash ```bash
diskutil list diskutil list
diskutil mount /dev/diskXsY diskutil mount /dev/diskXsY
./unleash bypass ./runaway bypass
``` ```
### Desbloqueio do FileVault falha no Recovery ### Desbloqueio do FileVault falha no Recovery
@@ -127,13 +127,13 @@ Você precisa de uma senha de usuário ou da chave de recuperação do FileVault
### "Not a macOS Data volume" ### "Not a macOS Data volume"
O Unleash verifica `/private/var/db/dslocal/nodes/Default` no volume montado. Se estiver faltando, você montou o disco errado. Execute `diskutil list` para encontrar o volume de Dados correto. O Runaway verifica `/private/var/db/dslocal/nodes/Default` no volume montado. Se estiver faltando, você montou o disco errado. Execute `diskutil list` para encontrar o volume de Dados correto.
### Monitor não inicia ### Monitor não inicia
1. Verifique se já está rodando: `sudo ./unleash monitor-status` 1. Verifique se já está rodando: `sudo ./runaway monitor-status`
2. Verifique permissões: precisa de root 2. Verifique permissões: precisa de root
3. Verifique logs: `/var/log/unleash-monitor.log` 3. Verifique logs: `/var/log/runaway-monitor.log`
--- ---
+11 -11
View File
@@ -1,20 +1,20 @@
--- ---
layout: default layout: default
title: Guia de Arquitetura — unleash title: Guia de Arquitetura — runaway
--- ---
# Guia de Arquitetura # Guia de Arquitetura
## As Cinco Camadas do MDM ## As Cinco Camadas do MDM
O registro MDM da Apple funciona através de cinco mecanismos independentes. Bloquear apenas um ou dois é o motivo pelo qual ferramentas de bypass falham com o tempo. O Unleash aborda todos os cinco. O registro MDM da Apple funciona através de cinco mecanismos independentes. Bloquear apenas um ou dois é o motivo pelo qual ferramentas de bypass falham com o tempo. O Runaway aborda todos os cinco.
``` ```
Camada 1: Marcadores DEP ─── /var/db/ConfigurationProfiles/Settings/.cloudConfig* Camada 1: Marcadores DEP ─── /var/db/ConfigurationProfiles/Settings/.cloudConfig*
Camada 2: Bloqueio hosts ─── /etc/hosts → 0.0.0.0 deviceenrollment.apple.com Camada 2: Bloqueio hosts ─── /etc/hosts → 0.0.0.0 deviceenrollment.apple.com
Camada 3: Daemons ─── launchd desabilitado → ManagedClient.enroll, activationd Camada 3: Daemons ─── launchd desabilitado → ManagedClient.enroll, activationd
Camada 4: Dados usuário ─── ~/Library/Preferences/com.apple.mdm.* Camada 4: Dados usuário ─── ~/Library/Preferences/com.apple.mdm.*
Camada 5: Firewall pf ─── pf anchor com.unleash/mdm → bloqueio kernel Camada 5: Firewall pf ─── pf anchor com.runaway/mdm → bloqueio kernel
``` ```
### Camada 1: Marcadores de Registro DEP ### Camada 1: Marcadores de Registro DEP
@@ -100,8 +100,8 @@ pf (packet filter) opera na camada de rede do kernel, abaixo da resolução DNS.
## Arquitetura do Script ## Arquitetura do Script
``` ```
unleash/ runaway/
├── unleash # Ponto de entrada principal ├── runaway # Ponto de entrada principal
├── lib/ ├── lib/
│ ├── colors.sh # Logging, cores, prompts, show_cmd_help() │ ├── colors.sh # Logging, cores, prompts, show_cmd_help()
│ ├── detect.sh # Detecção de Recovery, montagem de volume │ ├── detect.sh # Detecção de Recovery, montagem de volume
@@ -138,28 +138,28 @@ unleash/
### Fluxo de Dispatch ### Fluxo de Dispatch
1. `unleash` carrega todos os módulos `lib/*.sh` 1. `runaway` carrega todos os módulos `lib/*.sh`
2. `load_config()` lê `~/.unleash.conf` (se existir) 2. `load_config()` lê `~/.runaway.conf` (se existir)
3. O argumento do comando é casado com o `case` dispatch no main 3. O argumento do comando é casado com o `case` dispatch no main
4. A função handler é chamada (ex.: `cmd_bypass`, `cmd_firewall`) 4. A função handler é chamada (ex.: `cmd_bypass`, `cmd_firewall`)
5. Cada handler chama funções lib que fazem o trabalho real 5. Cada handler chama funções lib que fazem o trabalho real
### Build Autocontido ### Build Autocontido
`examples/build-standalone.sh` concatena todos os módulos lib + corpo do script principal em um único arquivo (`unleash-standalone.sh`, ~3200 linhas). Sem dependências externas — funciona em qualquer macOS com bash. `examples/build-standalone.sh` concatena todos os módulos lib + corpo do script principal em um único arquivo (`runaway-standalone.sh`, ~3200 linhas). Sem dependências externas — funciona em qualquer macOS com bash.
## Processo de Build ## Processo de Build
1. **Fonte**: Módulos `lib/*.sh` individuais + ponto de entrada `unleash` 1. **Fonte**: Módulos `lib/*.sh` individuais + ponto de entrada `runaway`
2. **Teste**: 78 testes Bats cobrindo todos os módulos 2. **Teste**: 78 testes Bats cobrindo todos os módulos
3. **Build**: `bash examples/build-standalone.sh` → `unleash-standalone.sh` 3. **Build**: `bash examples/build-standalone.sh` → `runaway-standalone.sh`
4. **Assinar**: `scripts/sign-release.sh` → Assinatura GPG destacada 4. **Assinar**: `scripts/sign-release.sh` → Assinatura GPG destacada
5. **Release**: Release GitHub com standalone + assinatura + checksums 5. **Release**: Release GitHub com standalone + assinatura + checksums
## Design de Segurança ## Design de Segurança
### Sem persistência root ### Sem persistência root
O Unleash não instala backdoor, cria usuários ocultos ou modifica o volume do sistema. Todas as alterações são reversíveis. O Runaway não instala backdoor, cria usuários ocultos ou modifica o volume do sistema. Todas as alterações são reversíveis.
### Releases assinados com GPG ### Releases assinados com GPG
Releases são assinados com chave GPG. O `selfupdate` verifica a assinatura antes de aplicar atualizações. Releases são assinados com chave GPG. O `selfupdate` verifica a assinatura antes de aplicar atualizações.
+43 -43
View File
@@ -1,15 +1,15 @@
--- ---
layout: default layout: default
title: unleash title: runaway
description: Bypass MDM em um único script para macOS — cobre todas as 5 camadas do MDM da Apple description: Bypass MDM em um único script para macOS — cobre todas as 5 camadas do MDM da Apple
--- ---
<p align="center"> <p align="center">
<img src="../icon.svg" width="100" alt="unleash logo"> <img src="../icon.svg" width="100" alt="runaway logo">
<br> <br>
<strong>unleash</strong> <strong>runaway</strong>
<br> <br>
<em>unleash</em> <em>runaway</em>
</p> </p>
<p align="center"> <p align="center">
@@ -23,12 +23,12 @@ description: Bypass MDM em um único script para macOS — cobre todas as 5 cama
--- ---
unleash substitui os cinco scripts originais do bypass-mdm em um único arquivo que lida com todas as camadas do registro MDM da Apple: marcadores DEP, bloqueio de rede, substituição de daemons, artefatos de nível de usuário e firewall a nível de kernel. Funciona no modo Recovery em Apple Silicon e Intel. runaway substitui os cinco scripts originais do bypass-mdm em um único arquivo que lida com todas as camadas do registro MDM da Apple: marcadores DEP, bloqueio de rede, substituição de daemons, artefatos de nível de usuário e firewall a nível de kernel. Funciona no modo Recovery em Apple Silicon e Intel.
**O que torna o unleash diferente de outras ferramentas de bypass:** **O que torna o runaway diferente de outras ferramentas de bypass:**
- **Cobre todas as 5 camadas** — não apenas marcadores DEP ou arquivo hosts. Bloqueia todos os caminhos que o MDM usa para re-registrar. - **Cobre todas as 5 camadas** — não apenas marcadores DEP ou arquivo hosts. Bloqueia todos os caminhos que o MDM usa para re-registrar.
- **Limpeza de artefatos de usuário** — o Migration Assistant copia caches MDM por usuário. O Unleash limpa todos os diretórios home. - **Limpeza de artefatos de usuário** — o Migration Assistant copia caches MDM por usuário. O Runaway limpa todos os diretórios home.
- **Firewall pf a nível de kernel** — `/etc/hosts` é contornado por DNS-over-HTTPS. pf não. - **Firewall pf a nível de kernel** — `/etc/hosts` é contornado por DNS-over-HTTPS. pf não.
- **Daemon de auto-recuperação** — sobrevive a atualizações do macOS. `persist` + `heal` pegam tudo que a atualização resetar. - **Daemon de auto-recuperação** — sobrevive a atualizações do macOS. `persist` + `heal` pegam tudo que a atualização resetar.
- **39 comandos** — bypass, suppress, monitor, harden, audit, backup, predict, remediate e mais. - **39 comandos** — bypass, suppress, monitor, harden, audit, backup, predict, remediate e mais.
@@ -40,19 +40,19 @@ unleash substitui os cinco scripts originais do bypass-mdm em um único arquivo
**Homebrew (mais fácil)** **Homebrew (mais fácil)**
```bash ```bash
brew install mateussiqueira/unleash/unleash brew install mateussiqueira/runaway/runaway
``` ```
**Download direto** **Download direto**
```bash ```bash
curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash-standalone.sh -o unleash curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/runaway-standalone.sh -o runaway
chmod +x unleash chmod +x runaway
``` ```
**De um pendrive USB (para o modo Recovery)** **De um pendrive USB (para o modo Recovery)**
1. Formate um USB/SSD como FAT32, APFS ou exFAT 1. Formate um USB/SSD como FAT32, APFS ou exFAT
2. Copie a pasta `unleash` (ou apenas `unleash-standalone.sh`) para o drive 2. Copie a pasta `runaway` (ou apenas `runaway-standalone.sh`) para o drive
3. Inicialize no Recovery e execute de `/Volumes/SeuDrive/unleash` 3. Inicialize no Recovery e execute de `/Volumes/SeuDrive/runaway`
--- ---
@@ -68,7 +68,7 @@ chmod +x unleash
3. Execute: 3. Execute:
```bash ```bash
"/Volumes/SeuDrive/unleash" bypass "/Volumes/SeuDrive/runaway" bypass
``` ```
4. Siga as instruções para criar um usuário admin temporário 4. Siga as instruções para criar um usuário admin temporário
@@ -80,19 +80,19 @@ chmod +x unleash
Se você já tem um Mac que foi bypassado anteriormente e o MDM voltou após uma atualização: Se você já tem um Mac que foi bypassado anteriormente e o MDM voltou após uma atualização:
```bash ```bash
sudo ./unleash heal sudo ./runaway heal
``` ```
Ou para verificar o status atual: Ou para verificar o status atual:
```bash ```bash
sudo ./unleash status -d sudo ./runaway status -d
``` ```
### Configuração com um comando (Mac novo) ### Configuração com um comando (Mac novo)
```bash ```bash
sudo ./unleash init sudo ./runaway init
``` ```
Assistente interativo que executa a configuração completa: firewall, monitor, persist, backup e audit. Assistente interativo que executa a configuração completa: firewall, monitor, persist, backup e audit.
@@ -156,7 +156,7 @@ Assistente interativo que executa a configuração completa: firewall, monitor,
| `update` | Autoatualização a partir do GitHub Releases (verificada com GPG) | | `update` | Autoatualização a partir do GitHub Releases (verificada com GPG) |
| `uninstall` | Remoção completa com confirmações de segurança | | `uninstall` | Remoção completa com confirmações de segurança |
| `reinstall` | Desinstalar + instalar (atualização atômica) | | `reinstall` | Desinstalar + instalar (atualização atômica) |
| `config` | Ver/editar configurações persistentes em `~/.unleash.conf` | | `config` | Ver/editar configurações persistentes em `~/.runaway.conf` |
| `backup` | Salva o estado atual para restaurar depois | | `backup` | Salva o estado atual para restaurar depois |
| `restore` | Restaura a partir de um backup anterior | | `restore` | Restaura a partir de um backup anterior |
| `demo` | Fluxo de bypass simulado — sem alterações reais | | `demo` | Fluxo de bypass simulado — sem alterações reais |
@@ -205,8 +205,8 @@ dbs = discord-bot-stop dbs2 = discord-bot-status
### Antes de comprar um Mac usado ### Antes de comprar um Mac usado
```bash ```bash
./unleash predict ABC12345678 # verifica serial contra organizações conhecidas ./runaway predict ABC12345678 # verifica serial contra organizações conhecidas
./unleash check # este Mac é seguro para formatar? ./runaway check # este Mac é seguro para formatar?
``` ```
`predict` consulta o serial contra prefixos conhecidos de organizações MDM. Se corresponder a JAMF, Mosyle ou outra, você sabe o que esperar antes de comprar. `predict` consulta o serial contra prefixos conhecidos de organizações MDM. Se corresponder a JAMF, Mosyle ou outra, você sabe o que esperar antes de comprar.
@@ -217,19 +217,19 @@ dbs = discord-bot-stop dbs2 = discord-bot-status
2. O Migration Assistant copia seus dados antigos 2. O Migration Assistant copia seus dados antigos
3. O MDM aparece em minutos após o login 3. O MDM aparece em minutos após o login
**Solução**: Inicialize no Recovery e execute `unleash suppress` (ou `bypass` se precisar de um novo admin). Remove os marcadores DEP, artefatos de usuário e preferências MDM que o MA transferiu. **Solução**: Inicialize no Recovery e execute `runaway suppress` (ou `bypass` se precisar de um novo admin). Remove os marcadores DEP, artefatos de usuário e preferências MDM que o MA transferiu.
### Atualização do macOS trouxe o MDM de volta ### Atualização do macOS trouxe o MDM de volta
1. A atualização do sistema restaura os daemons de registro automaticamente 1. A atualização do sistema restaura os daemons de registro automaticamente
2. O bloqueio MDM em `/etc/hosts` geralmente é preservado 2. O bloqueio MDM em `/etc/hosts` geralmente é preservado
**Solução**: `sudo ./unleash heal` — re-desabilita daemons e verifica todas as camadas. Se você executou `persist` antes da atualização, isso acontece automaticamente na próxima inicialização. **Solução**: `sudo ./runaway heal` — re-desabilita daemons e verifica todas as camadas. Se você executou `persist` antes da atualização, isso acontece automaticamente na próxima inicialização.
### Configurando um Mac novo antes do primeiro boot ### Configurando um Mac novo antes do primeiro boot
1. Inicialize no Recovery sem Wi-Fi 1. Inicialize no Recovery sem Wi-Fi
2. Execute `unleash init` — assistente interativo 2. Execute `runaway init` — assistente interativo
3. Ele irá: suprimir MDM, instalar persist, instalar whitelist, executar audit 3. Ele irá: suprimir MDM, instalar persist, instalar whitelist, executar audit
4. Reinicie, configure normalmente, o MDM nunca incomoda 4. Reinicie, configure normalmente, o MDM nunca incomoda
@@ -237,7 +237,7 @@ dbs = discord-bot-stop dbs2 = discord-bot-status
## Como Funciona ## Como Funciona
O MDM (Mobile Device Management) opera em cinco camadas no macOS. O Unleash bloqueia todas elas: O MDM (Mobile Device Management) opera em cinco camadas no macOS. O Runaway bloqueia todas elas:
**Camada 1: Marcadores DEP** → `/etc/hosts` → **Camada 2: Bloqueio de rede** **Camada 1: Marcadores DEP** → `/etc/hosts` → **Camada 2: Bloqueio de rede**
@@ -249,13 +249,13 @@ O MDM (Mobile Device Management) opera em cinco camadas no macOS. O Unleash bloq
Em `/var/db/ConfigurationProfiles/Settings/`, a Apple armazena arquivos `.cloudConfig*` que marcam o Mac como registrado no DEP. Removê-los é a abordagem padrão de bypass. Em `/var/db/ConfigurationProfiles/Settings/`, a Apple armazena arquivos `.cloudConfig*` que marcam o Mac como registrado no DEP. Removê-los é a abordagem padrão de bypass.
**O que o unleash faz**: Remove todos os marcadores `.cloudConfig*`, cria arquivos falsos que dizem ao macOS que o dispositivo nunca foi registrado e impede a recriação bloqueando também a camada de rede. **O que o runaway faz**: Remove todos os marcadores `.cloudConfig*`, cria arquivos falsos que dizem ao macOS que o dispositivo nunca foi registrado e impede a recriação bloqueando também a camada de rede.
### Camada 2: Bloqueio de rede ### Camada 2: Bloqueio de rede
O cliente de registro contata os servidores da Apple para baixar o perfil MDM. Sem acesso à rede, ele não pode completar o registro. O cliente de registro contata os servidores da Apple para baixar o perfil MDM. Sem acesso à rede, ele não pode completar o registro.
**O que o unleash faz**: **O que o runaway faz**:
- **`/etc/hosts`** (básico): Bloqueia 13+ domínios Apple MDM incluindo `deviceenrollment.apple.com`, `mdmenrollment.apple.com`, `iprofiles.apple.com`. Entradas IPv4 (0.0.0.0) e IPv6 (::). - **`/etc/hosts`** (básico): Bloqueia 13+ domínios Apple MDM incluindo `deviceenrollment.apple.com`, `mdmenrollment.apple.com`, `iprofiles.apple.com`. Entradas IPv4 (0.0.0.0) e IPv6 (::).
- **Firewall pf** (avançado): Filtragem de pacotes a nível de kernel que bloqueia faixas de IP Apple mesmo quando DoH é usado. - **Firewall pf** (avançado): Filtragem de pacotes a nível de kernel que bloqueia faixas de IP Apple mesmo quando DoH é usado.
@@ -289,7 +289,7 @@ O macOS registra quatro daemons de registro que executam na inicialização:
| `com.apple.mdmclient.daemon.runatboot` | Cliente MDM | | `com.apple.mdmclient.daemon.runatboot` | Cliente MDM |
| `com.apple.activationd` | Ativação do dispositivo | | `com.apple.activationd` | Ativação do dispositivo |
**O que o unleash faz**: Cria overrides launchd desabilitados para todos os quatro, impedindo que iniciem. **O que o runaway faz**: Cria overrides launchd desabilitados para todos os quatro, impedindo que iniciem.
### Camada 4: Limpeza de artefatos de usuário ### Camada 4: Limpeza de artefatos de usuário
@@ -303,7 +303,7 @@ O Migration Assistant e caches de login deixam dados de registro MDM nos diretó
~/Library/LaunchAgents/com.apple.mdm.* ~/Library/LaunchAgents/com.apple.mdm.*
``` ```
**O que o unleash faz**: Varre todos os diretórios home no volume de Dados e remove todos os preferences, caches e launch agents relacionados ao MDM. **O que o runaway faz**: Varre todos os diretórios home no volume de Dados e remove todos os preferences, caches e launch agents relacionados ao MDM.
### Camada 5: Firewall pf (opcional, avançado) ### Camada 5: Firewall pf (opcional, avançado)
@@ -350,11 +350,11 @@ Deve funcionar em qualquer versão que use o mesmo mecanismo de registro MDM —
A causa mais provável são artefatos de nível de usuário. Execute do Recovery: A causa mais provável são artefatos de nível de usuário. Execute do Recovery:
```bash ```bash
sudo ./unleash suppress sudo ./runaway suppress
``` ```
Ou de um sistema já iniciado: Ou de um sistema já iniciado:
```bash ```bash
sudo ./unleash harden sudo ./runaway harden
``` ```
### Erro "Not a known DirStatus" ### Erro "Not a known DirStatus"
@@ -362,22 +362,22 @@ sudo ./unleash harden
O script detecta volumes automaticamente, mas se você tiver uma configuração não padrão: O script detecta volumes automaticamente, mas se você tiver uma configuração não padrão:
1. Execute `diskutil list` para encontrar seu volume de Dados 1. Execute `diskutil list` para encontrar seu volume de Dados
2. Monte: `diskutil mount /dev/diskXsY` 2. Monte: `diskutil mount /dev/diskXsY`
3. Execute unleash novamente 3. Execute runaway novamente
### Perfis ainda mostram registro ### Perfis ainda mostram registro
Isso é cosmético. O macOS armazena estado de perfis no SSV (Volume Selado do Sistema). Verifique os marcadores DEP reais: Isso é cosmético. O macOS armazena estado de perfis no SSV (Volume Selado do Sistema). Verifique os marcadores DEP reais:
```bash ```bash
sudo ./unleash status -d sudo ./runaway status -d
``` ```
### FileVault está ativado ### FileVault está ativado
O Unleash detecta FileVault e pede a chave de recuperação ou senha do volume. Se o desbloqueio automático falhar, desbloqueie o volume manualmente no Utilitário de Disco primeiro. O Runaway detecta FileVault e pede a chave de recuperação ou senha do volume. Se o desbloqueio automático falhar, desbloqueie o volume manualmente no Utilitário de Disco primeiro.
### Atualização do macOS reativou o MDM ### Atualização do macOS reativou o MDM
Execute `sudo ./unleash heal` após qualquer atualização do macOS. Se você usou `persist` antes da atualização, isso acontece automaticamente na próxima inicialização. Execute `sudo ./runaway heal` após qualquer atualização do macOS. Se você usou `persist` antes da atualização, isso acontece automaticamente na próxima inicialização.
### Posso usar iCloud após o bypass? ### Posso usar iCloud após o bypass?
@@ -396,7 +396,7 @@ Você precisa de um segundo Mac com Apple Configurator 2 (grátis), um cabo USB-
2. Conecte o Mac travado via USB-C enquanto segura o power 2. Conecte o Mac travado via USB-C enquanto segura o power
3. No Configurator: clique com direito no dispositivo DFU → Advanced → Restore 3. No Configurator: clique com direito no dispositivo DFU → Advanced → Restore
4. Escolha o arquivo IPSW, aguarde 10–30 minutos 4. Escolha o arquivo IPSW, aguarde 10–30 minutos
5. Após restaurar, inicialize no Recovery sem Wi-Fi e execute `unleash bypass` 5. Após restaurar, inicialize no Recovery sem Wi-Fi e execute `runaway bypass`
**Isso apaga todos os dados.** Arquivos IPSW em [ipsw.me](https://ipsw.me). **Isso apaga todos os dados.** Arquivos IPSW em [ipsw.me](https://ipsw.me).
@@ -410,7 +410,7 @@ Todos os comandos registram com timestamps e níveis:
[INF] Data volume: /Volumes/Macintosh HD - Data [INF] Data volume: /Volumes/Macintosh HD - Data
[ OK] Admin 'apple' created (UID 501) [ OK] Admin 'apple' created (UID 501)
[WRN] DEP activation record present [WRN] DEP activation record present
[ERR] Firewall needs sudo: sudo ./unleash firewall [ERR] Firewall needs sudo: sudo ./runaway firewall
[STP] Locating Data volume by APFS role... [STP] Locating Data volume by APFS role...
[DBG] Checking pfctl availability [DBG] Checking pfctl availability
``` ```
@@ -431,13 +431,13 @@ Use `--verbose` para mensagens de debug e `--log-file <caminho>` para escrever t
## Links ## Links
- [Repositório GitHub](https://github.com/mateussiqueira/unleash) - [Repositório GitHub](https://github.com/mateussiqueira/runaway)
- [README completo](https://github.com/mateussiqueira/unleash/blob/main/README.md) - [README completo](https://github.com/mateussiqueira/runaway/blob/main/README.md)
- [Guia de Arquitetura](guide) - [Guia de Arquitetura](guide)
- [FAQ](faq) - [FAQ](faq)
- [Changelog](https://github.com/mateussiqueira/unleash/blob/main/CHANGELOG.md) - [Changelog](https://github.com/mateussiqueira/runaway/blob/main/CHANGELOG.md)
- [Contribuindo](https://github.com/mateussiqueira/unleash/blob/main/CONTRIBUTING.md) - [Contribuindo](https://github.com/mateussiqueira/runaway/blob/main/CONTRIBUTING.md)
- [Código de Conduta](https://github.com/mateussiqueira/unleash/blob/main/CODE_OF_CONDUCT.md) - [Código de Conduta](https://github.com/mateussiqueira/runaway/blob/main/CODE_OF_CONDUCT.md)
- [Política de Segurança](https://github.com/mateussiqueira/unleash/blob/main/SECURITY.md) - [Política de Segurança](https://github.com/mateussiqueira/runaway/blob/main/SECURITY.md)
- [Discussões](https://github.com/mateussiqueira/unleash/discussions) - [Discussões](https://github.com/mateussiqueira/runaway/discussions)
- [Reportar Bug](https://github.com/mateussiqueira/unleash/issues/new?template=bug_report.md) - [Reportar Bug](https://github.com/mateussiqueira/runaway/issues/new?template=bug_report.md)
+17 -17
View File
@@ -1,6 +1,6 @@
--- ---
layout: default layout: default
title: Instalação — unleash title: Instalação — runaway
--- ---
# Instalação # Instalação
@@ -8,51 +8,51 @@ title: Instalação — unleash
## Homebrew (mais fácil) ## Homebrew (mais fácil)
```bash ```bash
brew tap mateussiqueira/unleash brew tap mateussiqueira/runaway
brew install unleash brew install runaway
``` ```
Ou em um passo: Ou em um passo:
```bash ```bash
brew install mateussiqueira/unleash/unleash brew install mateussiqueira/runaway/runaway
``` ```
## Download direto ## Download direto
```bash ```bash
curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash-standalone.sh -o unleash curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/runaway-standalone.sh -o runaway
chmod +x unleash chmod +x runaway
sudo ./unleash init sudo ./runaway init
``` ```
## De um pendrive USB (para o modo Recovery) ## De um pendrive USB (para o modo Recovery)
1. Formate um USB/SSD como **FAT32**, **APFS** ou **exFAT** 1. Formate um USB/SSD como **FAT32**, **APFS** ou **exFAT**
2. Copie a pasta `unleash` (ou apenas `unleash-standalone.sh`) para o drive 2. Copie a pasta `runaway` (ou apenas `runaway-standalone.sh`) para o drive
3. Inicialize no Recovery e execute de `/Volumes/SeuDrive/unleash` 3. Inicialize no Recovery e execute de `/Volumes/SeuDrive/runaway`
## Via curl no Recovery (precisa de internet) ## Via curl no Recovery (precisa de internet)
```bash ```bash
curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash -o /tmp/unleash curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/runaway -o /tmp/runaway
chmod +x /tmp/unleash && /tmp/unleash bypass chmod +x /tmp/runaway && /tmp/runaway bypass
``` ```
## Compilando a partir do código-fonte ## Compilando a partir do código-fonte
```bash ```bash
git clone https://github.com/mateussiqueira/unleash.git git clone https://github.com/mateussiqueira/runaway.git
cd unleash cd runaway
bash examples/build-standalone.sh bash examples/build-standalone.sh
# Saída: unleash-standalone.sh (~3200 linhas) # Saída: runaway-standalone.sh (~3200 linhas)
``` ```
## Verificando a instalação ## Verificando a instalação
```bash ```bash
./unleash version ./runaway version
# → unleash v2.0.0 # → runaway v2.0.0
./unleash doctor ./runaway doctor
# Executa diagnósticos pré-voo # Executa diagnósticos pré-voo
``` ```
+21 -21
View File
@@ -1,6 +1,6 @@
--- ---
layout: default layout: default
title: Cenários — unleash title: Cenários — runaway
--- ---
# Cenários # Cenários
@@ -10,8 +10,8 @@ title: Cenários — unleash
Verifique o número serial antes de comprar: Verifique o número serial antes de comprar:
```bash ```bash
./unleash predict ABC12345678 # verifica serial contra prefixos conhecidos ./runaway predict ABC12345678 # verifica serial contra prefixos conhecidos
./unleash check # este Mac é seguro para limpar? ./runaway check # este Mac é seguro para limpar?
``` ```
`predict` consulta o serial contra prefixos conhecidos de organizações MDM. `predict` consulta o serial contra prefixos conhecidos de organizações MDM.
@@ -27,12 +27,12 @@ Se corresponder a JAMF, Mosyle ou outra organização, você sabe o que esperar
**Solução:** Inicialize no Recovery e execute: **Solução:** Inicialize no Recovery e execute:
```bash ```bash
./unleash suppress ./runaway suppress
``` ```
Ou `bypass` se precisar de um novo usuário admin. Remove os marcadores DEP, Ou `bypass` se precisar de um novo usuário admin. Remove os marcadores DEP,
artefatos de nível de usuário e preferências MDM que o MA transferiu. artefatos de nível de usuário e preferências MDM que o MA transferiu.
*Este é o caso #1 que a maioria das outras ferramentas não trata — o Unleash lida com ele.* *Este é o caso #1 que a maioria das outras ferramentas não trata — o Runaway lida com ele.*
--- ---
@@ -43,7 +43,7 @@ artefatos de nível de usuário e preferências MDM que o MA transferiu.
**Solução:** **Solução:**
```bash ```bash
sudo ./unleash heal sudo ./runaway heal
``` ```
Re-desabilita daemons e verifica todas as camadas. Se você executou `persist` Re-desabilita daemons e verifica todas as camadas. Se você executou `persist`
@@ -58,8 +58,8 @@ antes da atualização, isso acontece automaticamente na próxima inicializaçã
**Estratégia:** **Estratégia:**
1. Inicialize no Recovery **sem conectar ao Wi-Fi** 1. Inicialize no Recovery **sem conectar ao Wi-Fi**
2. Execute `unleash bypass` antes do dispositivo contatar a Apple 2. Execute `runaway bypass` antes do dispositivo contatar a Apple
3. Execute `unleash persist` e `unleash whitelist` para mantê-lo limpo 3. Execute `runaway persist` e `runaway whitelist` para mantê-lo limpo
4. Só então conecte-se à internet 4. Só então conecte-se à internet
O serial fica no ABM para sempre — mas enquanto o dispositivo nunca conectar O serial fica no ABM para sempre — mas enquanto o dispositivo nunca conectar
@@ -70,10 +70,10 @@ com todas as proteções removidas, ele não vai re-registrar.
## Mac usado que já tem um usuário logado ## Mac usado que já tem um usuário logado
```bash ```bash
sudo ./unleash audit # verifica o estado atual sudo ./runaway audit # verifica o estado atual
sudo ./unleash harden # mata processos MDM imediatamente sudo ./runaway harden # mata processos MDM imediatamente
sudo ./unleash whitelist # bloqueia MDM mantendo iCloud sudo ./runaway whitelist # bloqueia MDM mantendo iCloud
sudo ./unleash persist # sobrevive a atualizações futuras sudo ./runaway persist # sobrevive a atualizações futuras
``` ```
--- ---
@@ -81,7 +81,7 @@ sudo ./unleash persist # sobrevive a atualizações futuras
## Configurando um Mac novo antes do primeiro boot ## Configurando um Mac novo antes do primeiro boot
1. Inicialize no Recovery sem Wi-Fi 1. Inicialize no Recovery sem Wi-Fi
2. Execute `unleash init` — assistente interativo 2. Execute `runaway init` — assistente interativo
3. Ele irá: suprimir MDM, instalar persist, instalar whitelist, executar audit 3. Ele irá: suprimir MDM, instalar persist, instalar whitelist, executar audit
4. Reinicie, configure normalmente, o MDM nunca incomoda 4. Reinicie, configure normalmente, o MDM nunca incomoda
@@ -92,7 +92,7 @@ sudo ./unleash persist # sobrevive a atualizações futuras
Algumas organizações exigem que o Mac registre, mas somente quando conectado à VPN corporativa. Algumas organizações exigem que o Mac registre, mas somente quando conectado à VPN corporativa.
```bash ```bash
sudo ./unleash vpn-kill sudo ./runaway vpn-kill
``` ```
Isso instala um pf kill-switch que bloqueia tráfego MDM quando o dispositivo Isso instala um pf kill-switch que bloqueia tráfego MDM quando o dispositivo
@@ -108,8 +108,8 @@ Uma restauração DFU apaga tudo mas não remove a atribuição ABM.
1. Restaure via Apple Configurator 2 1. Restaure via Apple Configurator 2
2. **Não conecte ao Wi-Fi** 2. **Não conecte ao Wi-Fi**
3. Inicialize no Recovery 3. Inicialize no Recovery
4. Execute `unleash bypass` 4. Execute `runaway bypass`
5. Execute `unleash persist && unleash whitelist` 5. Execute `runaway persist && runaway whitelist`
6. Reinicie e conecte-se à internet com segurança 6. Reinicie e conecte-se à internet com segurança
--- ---
@@ -120,15 +120,15 @@ Para implantar em múltiplas máquinas:
```bash ```bash
# Bypass via script # Bypass via script
./unleash suppress --log-file /var/log/unleash-deploy.log ./runaway suppress --log-file /var/log/runaway-deploy.log
# Com persist + monitor # Com persist + monitor
sudo ./unleash persist sudo ./runaway persist
sudo ./unleash monitor sudo ./runaway monitor
# Relatório de auditoria em JSON # Relatório de auditoria em JSON
sudo ./unleash report --json sudo ./runaway report --json
# Alertas no Discord # Alertas no Discord
sudo ./unleash discord-bot <token> <userId> sudo ./runaway discord-bot <token> <userId>
``` ```
+3 -3
View File
@@ -1,6 +1,6 @@
--- ---
layout: default layout: default
title: Segurança — unleash title: Segurança — runaway
--- ---
# Segurança & Proteção # Segurança & Proteção
@@ -8,7 +8,7 @@ title: Segurança — unleash
## Princípios de Design ## Princípios de Design
### Sem persistência root ### Sem persistência root
O Unleash não instala backdoor, cria usuários ocultos ou modifica o O Runaway não instala backdoor, cria usuários ocultos ou modifica o
volume do sistema. Todas as alterações miram o **volume de Dados** volume do sistema. Todas as alterações miram o **volume de Dados**
apenas e são totalmente reversíveis. apenas e são totalmente reversíveis.
@@ -58,4 +58,4 @@ precisam de acesso à rede.
## Divulgação Responsável ## Divulgação Responsável
Encontrou um problema de segurança? Encontrou um problema de segurança?
Veja a [Política de Segurança](https://github.com/mateussiqueira/unleash/blob/main/SECURITY.md). Veja a [Política de Segurança](https://github.com/mateussiqueira/runaway/blob/main/SECURITY.md).
+41 -41
View File
@@ -1,6 +1,6 @@
--- ---
layout: default layout: default
title: Solução de Problemas — unleash title: Solução de Problemas — runaway
--- ---
# Solução de Problemas # Solução de Problemas
@@ -16,7 +16,7 @@ A detecção automática de volume falhou.
**Solução:** **Solução:**
1. Execute `diskutil list` para encontrar seu volume de Dados 1. Execute `diskutil list` para encontrar seu volume de Dados
2. Monte: `diskutil mount /dev/diskXsY` 2. Monte: `diskutil mount /dev/diskXsY`
3. Execute o unleash novamente 3. Execute o runaway novamente
--- ---
@@ -34,11 +34,11 @@ A detecção automática de volume falhou.
Vários comandos precisam de root: Vários comandos precisam de root:
``` ```
[ERR] Firewall needs sudo: sudo ./unleash firewall [ERR] Firewall needs sudo: sudo ./runaway firewall
[ERR] Heal needs sudo: sudo ./unleash heal [ERR] Heal needs sudo: sudo ./runaway heal
[ERR] Hardening needs sudo: sudo ./unleash harden [ERR] Hardening needs sudo: sudo ./runaway harden
[ERR] Audit needs sudo: sudo ./unleash audit [ERR] Audit needs sudo: sudo ./runaway audit
[ERR] Check needs sudo: sudo ./unleash check [ERR] Check needs sudo: sudo ./runaway check
``` ```
**Solução:** Anteceda `sudo` ao comando. **Solução:** Anteceda `sudo` ao comando.
@@ -51,18 +51,18 @@ A causa mais comum são **artefatos de nível de usuário** trazidos pelo Migrat
**Solução do Recovery:** **Solução do Recovery:**
```bash ```bash
sudo ./unleash suppress sudo ./runaway suppress
``` ```
**Solução do sistema já iniciado:** **Solução do sistema já iniciado:**
```bash ```bash
sudo ./unleash harden sudo ./runaway harden
``` ```
Se continuar voltando: Se continuar voltando:
```bash ```bash
sudo ./unleash persist # auto-recuperação em cada inicialização sudo ./runaway persist # auto-recuperação em cada inicialização
sudo ./unleash monitor # vigia re-registro sudo ./runaway monitor # vigia re-registro
``` ```
--- ---
@@ -73,7 +73,7 @@ Atualizações do sistema restauram os daemons de registro automaticamente.
**Solução:** **Solução:**
```bash ```bash
sudo ./unleash heal sudo ./runaway heal
``` ```
Se você executou `persist` antes da atualização, isso acontece automaticamente na próxima inicialização. Se você executou `persist` antes da atualização, isso acontece automaticamente na próxima inicialização.
@@ -85,19 +85,19 @@ Se você executou `persist` antes da atualização, isso acontece automaticament
Isso é **cosmético**. O macOS armazena o estado dos perfis no SSV (Volume Selado do Sistema) somente leitura. Isso é **cosmético**. O macOS armazena o estado dos perfis no SSV (Volume Selado do Sistema) somente leitura.
**Não confie** em `profiles status -v`. **Não confie** em `profiles status -v`.
**Confie** em `unleash status -d`. **Confie** em `runaway status -d`.
--- ---
### FileVault está ativado ### FileVault está ativado
O Unleash detecta FileVault e pede a chave de recuperação ou senha do volume. O Runaway detecta FileVault e pede a chave de recuperação ou senha do volume.
**Solução:** Se o desbloqueio automático falhar, desbloqueie o volume manualmente no Utilitário de Disco primeiro: **Solução:** Se o desbloqueio automático falhar, desbloqueie o volume manualmente no Utilitário de Disco primeiro:
1. Vá para o Utilitário de Disco no Recovery 1. Vá para o Utilitário de Disco no Recovery
2. Selecione o volume de Dados 2. Selecione o volume de Dados
3. Arquivo → Desbloquear → Digite a senha 3. Arquivo → Desbloquear → Digite a senha
4. Execute o unleash novamente 4. Execute o runaway novamente
--- ---
@@ -107,7 +107,7 @@ O bloqueio básico de `/etc/hosts` inclui `albert.apple.com` (ativação do iClo
**Solução:** Use `whitelist` em vez do bloqueio básico: **Solução:** Use `whitelist` em vez do bloqueio básico:
```bash ```bash
sudo ./unleash whitelist sudo ./runaway whitelist
``` ```
Ou remova manualmente estas duas linhas de `/etc/hosts`: Ou remova manualmente estas duas linhas de `/etc/hosts`:
@@ -133,14 +133,14 @@ Ou remova manualmente estas duas linhas de `/etc/hosts`:
### Monitor não inicia ### Monitor não inicia
**Verifique:** **Verifique:**
1. Já está rodando? `sudo ./unleash monitor-status` 1. Já está rodando? `sudo ./runaway monitor-status`
2. Permissões: precisa de root 2. Permissões: precisa de root
3. Logs: `/var/log/unleash-monitor.log` 3. Logs: `/var/log/runaway-monitor.log`
**Solução:** **Solução:**
```bash ```bash
sudo ./unleash monitor-stop sudo ./runaway monitor-stop
sudo ./unleash monitor sudo ./runaway monitor
``` ```
--- ---
@@ -150,7 +150,7 @@ sudo ./unleash monitor
O modo Recovery não tem internet por padrão. O modo Recovery não tem internet por padrão.
**Solução:** **Solução:**
1. Use um pendrive USB com o unleash copiado 1. Use um pendrive USB com o runaway copiado
2. Ou conecte-se ao Wi-Fi no Recovery (menu superior direito → ícone Wi-Fi) 2. Ou conecte-se ao Wi-Fi no Recovery (menu superior direito → ícone Wi-Fi)
--- ---
@@ -161,10 +161,10 @@ O modo Recovery não tem internet por padrão.
ERROR: Library not found: /path/to/lib/colors.sh ERROR: Library not found: /path/to/lib/colors.sh
``` ```
**Causa:** Executando o script `unleash` fonte de fora do diretório do repositório. **Causa:** Executando o script `runaway` fonte de fora do diretório do repositório.
**Solução:** **Solução:**
- Use a versão standalone (`unleash-standalone.sh`) - Use a versão standalone (`runaway-standalone.sh`)
- Ou execute da raiz do repositório onde o diretório `lib/` existe - Ou execute da raiz do repositório onde o diretório `lib/` existe
- Ou instale via Homebrew - Ou instale via Homebrew
@@ -176,8 +176,8 @@ pf pode ter regras existentes que conflitam.
**Solução:** **Solução:**
```bash ```bash
sudo ./unleash firewall-off # limpa regras existentes sudo ./runaway firewall-off # limpa regras existentes
sudo ./unleash firewall # reaplica sudo ./runaway firewall # reaplica
``` ```
--- ---
@@ -189,8 +189,8 @@ Uma restauração DFU/IPSW completa não remove a atribuição ABM — o serial
**Estratégia:** **Estratégia:**
1. Após restaurar, **não conecte ao Wi-Fi** 1. Após restaurar, **não conecte ao Wi-Fi**
2. Inicialize no Recovery 2. Inicialize no Recovery
3. Execute `unleash bypass` antes do dispositivo contatar a Apple 3. Execute `runaway bypass` antes do dispositivo contatar a Apple
4. Execute `unleash persist` e `unleash whitelist` 4. Execute `runaway persist` e `runaway whitelist`
5. Só então conecte-se à internet 5. Só então conecte-se à internet
O serial fica no ABM para sempre — mas se o dispositivo nunca conectar sem proteções, ele não vai re-registrar. O serial fica no ABM para sempre — mas se o dispositivo nunca conectar sem proteções, ele não vai re-registrar.
@@ -206,8 +206,8 @@ O serial fica no ABM para sempre — mas se o dispositivo nunca conectar sem pro
**Solução:** **Solução:**
1. Certifique-se de ter `gpg` instalado 1. Certifique-se de ter `gpg` instalado
2. Importe a chave de assinatura: `gpg --keyserver keys.openpgp.org --recv-key <KEY_ID>` 2. Importe a chave de assinatura: `gpg --keyserver keys.openpgp.org --recv-key <KEY_ID>`
3. Tente `sudo ./unleash update` novamente 3. Tente `sudo ./runaway update` novamente
4. Ou baixe manualmente de [GitHub Releases](https://github.com/mateussiqueira/unleash/releases) 4. Ou baixe manualmente de [GitHub Releases](https://github.com/mateussiqueira/runaway/releases)
--- ---
@@ -219,9 +219,9 @@ Error: ... homebrew-core ...
**Solução:** Certifique-se de que o tap está atualizado: **Solução:** Certifique-se de que o tap está atualizado:
```bash ```bash
brew untap mateussiqueira/unleash brew untap mateussiqueira/runaway
brew tap mateussiqueira/unleash brew tap mateussiqueira/runaway
brew install unleash brew install runaway
``` ```
--- ---
@@ -234,7 +234,7 @@ Todos os comandos produzem logs estruturados:
[INF] Data volume: /Volumes/Macintosh HD - Data [INF] Data volume: /Volumes/Macintosh HD - Data
[ OK] Admin 'apple' created (UID 501) [ OK] Admin 'apple' created (UID 501)
[WRN] DEP activation record present [WRN] DEP activation record present
[ERR] Firewall needs sudo: sudo ./unleash firewall [ERR] Firewall needs sudo: sudo ./runaway firewall
[STP] Locating Data volume by APFS role... [STP] Locating Data volume by APFS role...
[DBG] Checking pfctl availability [DBG] Checking pfctl availability
``` ```
@@ -252,7 +252,7 @@ Todos os comandos produzem logs estruturados:
Use `--verbose` para mensagens de debug e `--log-file <caminho>` para salvar em um arquivo: Use `--verbose` para mensagens de debug e `--log-file <caminho>` para salvar em um arquivo:
```bash ```bash
sudo ./unleash heal --verbose --log-file /tmp/unleash.log sudo ./runaway heal --verbose --log-file /tmp/runaway.log
``` ```
--- ---
@@ -263,22 +263,22 @@ Execute estes para coletar informações antes de buscar ajuda:
```bash ```bash
# Verificação rápida de saúde # Verificação rápida de saúde
sudo ./unleash doctor sudo ./runaway doctor
# Auditoria completa do sistema # Auditoria completa do sistema
sudo ./unleash audit sudo ./runaway audit
# Gerar relatório # Gerar relatório
sudo ./unleash report sudo ./runaway report
# Simular um bypass # Simular um bypass
sudo ./unleash demo sudo ./runaway demo
``` ```
--- ---
## Obtendo Ajuda ## Obtendo Ajuda
- [GitHub Issues](https://github.com/mateussiqueira/unleash/issues) - [GitHub Issues](https://github.com/mateussiqueira/runaway/issues)
- [Discussões](https://github.com/mateussiqueira/unleash/discussions) - [Discussões](https://github.com/mateussiqueira/runaway/discussions)
- [Política de Segurança](https://github.com/mateussiqueira/unleash/blob/main/SECURITY.md) - [Política de Segurança](https://github.com/mateussiqueira/runaway/blob/main/SECURITY.md)
+21 -21
View File
@@ -1,6 +1,6 @@
--- ---
layout: default layout: default
title: Scenarios — unleash title: Scenarios — runaway
--- ---
# Scenarios # Scenarios
@@ -10,8 +10,8 @@ title: Scenarios — unleash
Check the serial number before you buy: Check the serial number before you buy:
```bash ```bash
./unleash predict ABC12345678 # check serial against known org prefixes ./runaway predict ABC12345678 # check serial against known org prefixes
./unleash check # is this Mac safe to wipe? ./runaway check # is this Mac safe to wipe?
``` ```
`predict` looks up the device serial against known MDM org prefixes. `predict` looks up the device serial against known MDM org prefixes.
@@ -27,12 +27,12 @@ If it matches JAMF, Mosyle, or another org, you know what you're dealing with be
**Fix:** Boot to Recovery and run: **Fix:** Boot to Recovery and run:
```bash ```bash
./unleash suppress ./runaway suppress
``` ```
Or `bypass` if you need a new admin user. This removes the DEP markers, Or `bypass` if you need a new admin user. This removes the DEP markers,
user-level artifacts, and MDM preferences that MA transferred over. user-level artifacts, and MDM preferences that MA transferred over.
*This is the #1 case most other tools miss — Unleash handles it.* *This is the #1 case most other tools miss — Runaway handles it.*
--- ---
@@ -43,7 +43,7 @@ user-level artifacts, and MDM preferences that MA transferred over.
**Fix:** **Fix:**
```bash ```bash
sudo ./unleash heal sudo ./runaway heal
``` ```
Re-disables daemons and re-checks all layers. If you ran `persist` Re-disables daemons and re-checks all layers. If you ran `persist`
@@ -58,8 +58,8 @@ before the update, this happens automatically on the next boot.
**Strategy:** **Strategy:**
1. Boot to Recovery **without connecting to Wi-Fi** 1. Boot to Recovery **without connecting to Wi-Fi**
2. Run `unleash bypass` before the device ever phones home 2. Run `runaway bypass` before the device ever phones home
3. Run `unleash persist` and `unleash whitelist` so it stays clean 3. Run `runaway persist` and `runaway whitelist` so it stays clean
4. Only then connect to the internet 4. Only then connect to the internet
The serial stays in ABM forever — but as long as the device never The serial stays in ABM forever — but as long as the device never
@@ -70,10 +70,10 @@ connects with full protections removed, it will not re-enroll.
## Used Mac that already has a user logged in ## Used Mac that already has a user logged in
```bash ```bash
sudo ./unleash audit # check current state sudo ./runaway audit # check current state
sudo ./unleash harden # kill MDM processes immediately sudo ./runaway harden # kill MDM processes immediately
sudo ./unleash whitelist # block MDM while keeping iCloud sudo ./runaway whitelist # block MDM while keeping iCloud
sudo ./unleash persist # survive future updates sudo ./runaway persist # survive future updates
``` ```
--- ---
@@ -81,7 +81,7 @@ sudo ./unleash persist # survive future updates
## Setting up a new Mac before first boot ## Setting up a new Mac before first boot
1. Boot to Recovery without Wi-Fi 1. Boot to Recovery without Wi-Fi
2. Run `unleash init` — interactive wizard 2. Run `runaway init` — interactive wizard
3. It will: suppress MDM, install persist, install whitelist, run audit 3. It will: suppress MDM, install persist, install whitelist, run audit
4. Reboot, set up normally, MDM never bothers you 4. Reboot, set up normally, MDM never bothers you
@@ -92,7 +92,7 @@ sudo ./unleash persist # survive future updates
Some organizations require the Mac to enroll but only when connected to the corporate VPN. Some organizations require the Mac to enroll but only when connected to the corporate VPN.
```bash ```bash
sudo ./unleash vpn-kill sudo ./runaway vpn-kill
``` ```
This installs a pf kill-switch that blocks MDM traffic when the device This installs a pf kill-switch that blocks MDM traffic when the device
@@ -108,8 +108,8 @@ A DFU restore erases everything but doesn't remove ABM assignment.
1. Restore via Apple Configurator 2 1. Restore via Apple Configurator 2
2. **Do not connect to Wi-Fi** 2. **Do not connect to Wi-Fi**
3. Boot to Recovery 3. Boot to Recovery
4. Run `unleash bypass` 4. Run `runaway bypass`
5. Run `unleash persist && unleash whitelist` 5. Run `runaway persist && runaway whitelist`
6. Reboot and connect to the internet safely 6. Reboot and connect to the internet safely
--- ---
@@ -120,15 +120,15 @@ For deploying across multiple machines:
```bash ```bash
# Scripted bypass # Scripted bypass
./unleash suppress --log-file /var/log/unleash-deploy.log ./runaway suppress --log-file /var/log/runaway-deploy.log
# With persist + monitor # With persist + monitor
sudo ./unleash persist sudo ./runaway persist
sudo ./unleash monitor sudo ./runaway monitor
# Audit report in JSON # Audit report in JSON
sudo ./unleash report --json sudo ./runaway report --json
# Discord alerts # Discord alerts
sudo ./unleash discord-bot <token> <userId> sudo ./runaway discord-bot <token> <userId>
``` ```
+3 -3
View File
@@ -1,6 +1,6 @@
--- ---
layout: default layout: default
title: Security — unleash title: Security — runaway
--- ---
# Security & Safety # Security & Safety
@@ -8,7 +8,7 @@ title: Security — unleash
## Design Principles ## Design Principles
### No root persistence ### No root persistence
Unleash does not install backdoors, create hidden users, or modify the Runaway does not install backdoors, create hidden users, or modify the
system volume. All changes target the **Data volume** only and are system volume. All changes target the **Data volume** only and are
fully reversible. fully reversible.
@@ -58,4 +58,4 @@ network access.
## Responsible Disclosure ## Responsible Disclosure
Found a security issue? Found a security issue?
See the [Security Policy](https://github.com/mateussiqueira/unleash/blob/main/SECURITY.md). See the [Security Policy](https://github.com/mateussiqueira/runaway/blob/main/SECURITY.md).
+3 -3
View File
@@ -19,10 +19,10 @@
<circle cx="128" cy="164" r="8" fill="#f38ba8"/> <circle cx="128" cy="164" r="8" fill="#f38ba8"/>
<circle cx="152" cy="164" r="8" fill="#fab387"/> <circle cx="152" cy="164" r="8" fill="#fab387"/>
<circle cx="176" cy="164" r="8" fill="#a6e3a1"/> <circle cx="176" cy="164" r="8" fill="#a6e3a1"/>
<text x="600" y="170" fill="#6c7086" text-anchor="middle" font-family="SFMono-Regular,Consolas,monospace" font-size="20">unleash — terminal</text> <text x="600" y="170" fill="#6c7086" text-anchor="middle" font-family="SFMono-Regular,Consolas,monospace" font-size="20">runaway — terminal</text>
<!-- Code lines --> <!-- Code lines -->
<text x="140" y="240" fill="#89b4fa" font-family="SFMono-Regular,Consolas,monospace" font-size="22">$ sudo ./unleash bypass</text> <text x="140" y="240" fill="#89b4fa" font-family="SFMono-Regular,Consolas,monospace" font-size="22">$ sudo ./runaway bypass</text>
<text x="140" y="290" fill="#a6e3a1" font-family="SFMono-Regular,Consolas,monospace" font-size="20">✓ MDM domains blocked (13/13)</text> <text x="140" y="290" fill="#a6e3a1" font-family="SFMono-Regular,Consolas,monospace" font-size="20">✓ MDM domains blocked (13/13)</text>
<text x="140" y="330" fill="#a6e3a1" font-family="SFMono-Regular,Consolas,monospace" font-size="20">✓ DEP enrollment markers removed</text> <text x="140" y="330" fill="#a6e3a1" font-family="SFMono-Regular,Consolas,monospace" font-size="20">✓ DEP enrollment markers removed</text>
@@ -34,7 +34,7 @@
<text x="600" y="470" fill="#a6e3a1" text-anchor="middle" font-family="SFMono-Regular,Consolas,monospace" font-size="24" font-weight="bold">MDM BYPASSED — reboot and enjoy</text> <text x="600" y="470" fill="#a6e3a1" text-anchor="middle" font-family="SFMono-Regular,Consolas,monospace" font-size="24" font-weight="bold">MDM BYPASSED — reboot and enjoy</text>
<!-- Footer --> <!-- Footer -->
<text x="600" y="560" fill="#6c7086" text-anchor="middle" font-family="SFMono-Regular,Consolas,monospace" font-size="18">github.com/mateussiqueira/unleash</text> <text x="600" y="560" fill="#6c7086" text-anchor="middle" font-family="SFMono-Regular,Consolas,monospace" font-size="18">github.com/mateussiqueira/runaway</text>
<!-- Cursor blink --> <!-- Cursor blink -->
<rect x="380" y="226" width="14" height="26" fill="#cdd6f4" rx="3"> <rect x="380" y="226" width="14" height="26" fill="#cdd6f4" rx="3">

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

+41 -41
View File
@@ -1,6 +1,6 @@
--- ---
layout: default layout: default
title: Troubleshooting — unleash title: Troubleshooting — runaway
--- ---
# Troubleshooting # Troubleshooting
@@ -16,7 +16,7 @@ Volume auto-detection failed.
**Fix:** **Fix:**
1. Run `diskutil list` to find your Data volume 1. Run `diskutil list` to find your Data volume
2. Mount it: `diskutil mount /dev/diskXsY` 2. Mount it: `diskutil mount /dev/diskXsY`
3. Re-run unleash 3. Re-run runaway
--- ---
@@ -34,11 +34,11 @@ Volume auto-detection failed.
Various commands require root: Various commands require root:
``` ```
[ERR] Firewall needs sudo: sudo ./unleash firewall [ERR] Firewall needs sudo: sudo ./runaway firewall
[ERR] Heal needs sudo: sudo ./unleash heal [ERR] Heal needs sudo: sudo ./runaway heal
[ERR] Hardening needs sudo: sudo ./unleash harden [ERR] Hardening needs sudo: sudo ./runaway harden
[ERR] Audit needs sudo: sudo ./unleash audit [ERR] Audit needs sudo: sudo ./runaway audit
[ERR] Check needs sudo: sudo ./unleash check [ERR] Check needs sudo: sudo ./runaway check
``` ```
**Fix:** Prepend `sudo` to the command. **Fix:** Prepend `sudo` to the command.
@@ -51,18 +51,18 @@ The most common cause is **user-level artifacts** carried over by Migration Assi
**Fix from Recovery:** **Fix from Recovery:**
```bash ```bash
sudo ./unleash suppress sudo ./runaway suppress
``` ```
**Fix from booted system:** **Fix from booted system:**
```bash ```bash
sudo ./unleash harden sudo ./runaway harden
``` ```
If it keeps returning: If it keeps returning:
```bash ```bash
sudo ./unleash persist # auto-heal on every boot sudo ./runaway persist # auto-heal on every boot
sudo ./unleash monitor # watch for re-enrollment sudo ./runaway monitor # watch for re-enrollment
``` ```
--- ---
@@ -73,7 +73,7 @@ System updates restore enrollment daemons automatically.
**Fix:** **Fix:**
```bash ```bash
sudo ./unleash heal sudo ./runaway heal
``` ```
If you ran `persist` before the update, this runs automatically on next boot. If you ran `persist` before the update, this runs automatically on next boot.
@@ -85,19 +85,19 @@ If you ran `persist` before the update, this runs automatically on next boot.
This is **cosmetic**. macOS stores profile state on the read-only SSV (System Sealed Volume). This is **cosmetic**. macOS stores profile state on the read-only SSV (System Sealed Volume).
**Don't trust** `profiles status -v`. **Don't trust** `profiles status -v`.
**Trust** `unleash status -d` instead. **Trust** `runaway status -d` instead.
--- ---
### FileVault is enabled ### FileVault is enabled
Unleash detects FileVault and prompts for the recovery key or volume password. Runaway detects FileVault and prompts for the recovery key or volume password.
**Fix:** If automatic unlock fails, unlock the volume manually in Disk Utility first: **Fix:** If automatic unlock fails, unlock the volume manually in Disk Utility first:
1. Go to Disk Utility in Recovery 1. Go to Disk Utility in Recovery
2. Select the Data volume 2. Select the Data volume
3. File → Unlock → Enter password 3. File → Unlock → Enter password
4. Re-run unleash 4. Re-run runaway
--- ---
@@ -107,7 +107,7 @@ The basic `/etc/hosts` block includes `albert.apple.com` (iCloud activation) and
**Fix:** Use `whitelist` instead of the basic block: **Fix:** Use `whitelist` instead of the basic block:
```bash ```bash
sudo ./unleash whitelist sudo ./runaway whitelist
``` ```
Or manually remove these two lines from `/etc/hosts`: Or manually remove these two lines from `/etc/hosts`:
@@ -133,14 +133,14 @@ Or manually remove these two lines from `/etc/hosts`:
### Monitor won't start ### Monitor won't start
**Check:** **Check:**
1. Is it already running? `sudo ./unleash monitor-status` 1. Is it already running? `sudo ./runaway monitor-status`
2. Permissions: needs root 2. Permissions: needs root
3. Check logs: `/var/log/unleash-monitor.log` 3. Check logs: `/var/log/runaway-monitor.log`
**Fix:** **Fix:**
```bash ```bash
sudo ./unleash monitor-stop sudo ./runaway monitor-stop
sudo ./unleash monitor sudo ./runaway monitor
``` ```
--- ---
@@ -150,7 +150,7 @@ sudo ./unleash monitor
Recovery mode has no internet by default. Recovery mode has no internet by default.
**Fix:** **Fix:**
1. Use a USB drive with unleash copied to it 1. Use a USB drive with runaway copied to it
2. Or connect to Wi-Fi in Recovery (top-right menu → Wi-Fi icon) 2. Or connect to Wi-Fi in Recovery (top-right menu → Wi-Fi icon)
--- ---
@@ -161,10 +161,10 @@ Recovery mode has no internet by default.
ERROR: Library not found: /path/to/lib/colors.sh ERROR: Library not found: /path/to/lib/colors.sh
``` ```
**Cause:** Running the source `unleash` script from outside the repo directory. **Cause:** Running the source `runaway` script from outside the repo directory.
**Fix:** **Fix:**
- Use the standalone version (`unleash-standalone.sh`) instead - Use the standalone version (`runaway-standalone.sh`) instead
- Or run from the repo root where the `lib/` directory exists - Or run from the repo root where the `lib/` directory exists
- Or install via Homebrew - Or install via Homebrew
@@ -176,8 +176,8 @@ pf might have existing rules that conflict.
**Fix:** **Fix:**
```bash ```bash
sudo ./unleash firewall-off # clear existing rules sudo ./runaway firewall-off # clear existing rules
sudo ./unleash firewall # re-apply sudo ./runaway firewall # re-apply
``` ```
--- ---
@@ -189,8 +189,8 @@ A full DFU/IPSW restore doesn't remove ABM assignment — the serial stays in Ap
**Strategy:** **Strategy:**
1. After restore, **do not connect to Wi-Fi** 1. After restore, **do not connect to Wi-Fi**
2. Boot to Recovery 2. Boot to Recovery
3. Run `unleash bypass` before the device ever phones home 3. Run `runaway bypass` before the device ever phones home
4. Run `unleash persist` and `unleash whitelist` 4. Run `runaway persist` and `runaway whitelist`
5. Only then connect to the internet 5. Only then connect to the internet
The serial stays in ABM forever — but if the device never connects without protections, it won't re-enroll. The serial stays in ABM forever — but if the device never connects without protections, it won't re-enroll.
@@ -206,8 +206,8 @@ The serial stays in ABM forever — but if the device never connects without pro
**Fix:** **Fix:**
1. Make sure you have `gpg` installed 1. Make sure you have `gpg` installed
2. Import the signing key: `gpg --keyserver keys.openpgp.org --recv-key <KEY_ID>` 2. Import the signing key: `gpg --keyserver keys.openpgp.org --recv-key <KEY_ID>`
3. Try `sudo ./unleash update` again 3. Try `sudo ./runaway update` again
4. Or download manually from [GitHub Releases](https://github.com/mateussiqueira/unleash/releases) 4. Or download manually from [GitHub Releases](https://github.com/mateussiqueira/runaway/releases)
--- ---
@@ -219,9 +219,9 @@ Error: ... homebrew-core ...
**Fix:** Make sure the tap is up to date: **Fix:** Make sure the tap is up to date:
```bash ```bash
brew untap mateussiqueira/unleash brew untap mateussiqueira/runaway
brew tap mateussiqueira/unleash brew tap mateussiqueira/runaway
brew install unleash brew install runaway
``` ```
--- ---
@@ -234,7 +234,7 @@ All commands produce structured logs:
[INF] Data volume: /Volumes/Macintosh HD - Data [INF] Data volume: /Volumes/Macintosh HD - Data
[ OK] Admin 'apple' created (UID 501) [ OK] Admin 'apple' created (UID 501)
[WRN] DEP activation record present [WRN] DEP activation record present
[ERR] Firewall needs sudo: sudo ./unleash firewall [ERR] Firewall needs sudo: sudo ./runaway firewall
[STP] Locating Data volume by APFS role... [STP] Locating Data volume by APFS role...
[DBG] Checking pfctl availability [DBG] Checking pfctl availability
``` ```
@@ -252,7 +252,7 @@ All commands produce structured logs:
Use `--verbose` for debug messages and `--log-file <path>` to save to a file: Use `--verbose` for debug messages and `--log-file <path>` to save to a file:
```bash ```bash
sudo ./unleash heal --verbose --log-file /tmp/unleash.log sudo ./runaway heal --verbose --log-file /tmp/runaway.log
``` ```
--- ---
@@ -263,22 +263,22 @@ Run these to gather information before seeking help:
```bash ```bash
# Quick health check # Quick health check
sudo ./unleash doctor sudo ./runaway doctor
# Full system audit # Full system audit
sudo ./unleash audit sudo ./runaway audit
# Generate report # Generate report
sudo ./unleash report sudo ./runaway report
# Dry-run a bypass # Dry-run a bypass
sudo ./unleash demo sudo ./runaway demo
``` ```
--- ---
## Getting Help ## Getting Help
- [GitHub Issues](https://github.com/mateussiqueira/unleash/issues) - [GitHub Issues](https://github.com/mateussiqueira/runaway/issues)
- [Discussions](https://github.com/mateussiqueira/unleash/discussions) - [Discussions](https://github.com/mateussiqueira/runaway/discussions)
- [Security Policy](https://github.com/mateussiqueira/unleash/blob/main/SECURITY.md) - [Security Policy](https://github.com/mateussiqueira/runaway/blob/main/SECURITY.md)
+6 -6
View File
@@ -7,13 +7,13 @@
# chmod +x "/Volumes/YourSSD/auto-bypass-usb.sh" # chmod +x "/Volumes/YourSSD/auto-bypass-usb.sh"
# "/Volumes/YourSSD/auto-bypass-usb.sh" # "/Volumes/YourSSD/auto-bypass-usb.sh"
UNLEASH_DIR="$(cd "$(dirname "$0")" && pwd)" RUNAWAY_DIR="$(cd "$(dirname "$0")" && pwd)"
UNLEASH="$UNLEASH_DIR/unleash" RUNAWAY="$RUNAWAY_DIR/runaway"
if [ ! -f "$UNLEASH" ]; then if [ ! -f "$RUNAWAY" ]; then
echo "unleash not found at $UNLEASH" echo "runaway not found at $RUNAWAY"
echo "Copy the entire unleash/ folder alongside this script." echo "Copy the entire runaway/ folder alongside this script."
exit 1 exit 1
fi fi
"$UNLEASH" bypass "$RUNAWAY" bypass
+3 -3
View File
@@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
OUT="unleash-standalone.sh" OUT="runaway-standalone.sh"
SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)" SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
VERSION="$(grep '^VERSION=' "$SCRIPT_DIR/unleash" | head -1 | cut -d'"' -f2)" VERSION="$(grep '^VERSION=' "$SCRIPT_DIR/runaway" | head -1 | cut -d'"' -f2)"
[ -z "$VERSION" ] && VERSION="1.0.0" [ -z "$VERSION" ] && VERSION="1.0.0"
cat > "$OUT" << HEADER cat > "$OUT" << HEADER
@@ -19,7 +19,7 @@ for lib in colors config detect validate dscl suppress backup status launchd hea
echo "" >> "$OUT" echo "" >> "$OUT"
done done
sed -e '1,/_lib in /d' -e '/^done$/,$!d' -e '/^done$/d' "$SCRIPT_DIR/unleash" >> "$OUT" sed -e '1,/_lib in /d' -e '/^done$/,$!d' -e '/^done$/d' "$SCRIPT_DIR/runaway" >> "$OUT"
chmod +x "$OUT" chmod +x "$OUT"
echo "Created: $OUT (v$VERSION, $(wc -c < "$OUT") bytes, $(wc -l < "$OUT") lines)" echo "Created: $OUT (v$VERSION, $(wc -c < "$OUT") bytes, $(wc -l < "$OUT") lines)"
+4 -4
View File
@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# prepare-ssd.sh # prepare-ssd.sh
# Prepares an external SSD with unleash + auto-bypass script. # Prepares an external SSD with runaway + auto-bypass script.
# Run this on a working Mac, before you need the bypass. # Run this on a working Mac, before you need the bypass.
# #
# Usage: # Usage:
@@ -12,10 +12,10 @@ SSD="${1:-}"
SRC="$(cd "$(dirname "$0")/.." && pwd)" SRC="$(cd "$(dirname "$0")/.." && pwd)"
echo "Copying unleash to $SSD..." echo "Copying runaway to $SSD..."
cp -R "$SRC" "$SSD/unleash" cp -R "$SRC" "$SSD/runaway"
cp "$SRC/examples/auto-bypass-usb.sh" "$SSD/auto-bypass-usb.sh" cp "$SRC/examples/auto-bypass-usb.sh" "$SSD/auto-bypass-usb.sh"
chmod +x "$SSD/auto-bypass-usb.sh" "$SSD/unleash/unleash" chmod +x "$SSD/auto-bypass-usb.sh" "$SSD/runaway/runaway"
echo "" echo ""
echo "✅ SSD ready at $SSD" echo "✅ SSD ready at $SSD"
+12 -12
View File
@@ -1,20 +1,20 @@
#!/bin/bash #!/bin/bash
# Usage examples for unleash — copy/paste what you need. # Usage examples for runaway — copy/paste what you need.
echo "=== unleash quick examples ===" echo "=== runaway quick examples ==="
echo "" echo ""
echo "From Recovery (external SSD):" echo "From Recovery (external SSD):"
echo ' "/Volumes/YourSSD/unleash/unleash" bypass' echo ' "/Volumes/YourSSD/runaway/runaway" bypass'
echo "" echo ""
echo "From Recovery (one-liner, needs internet):" echo "From Recovery (one-liner, needs internet):"
echo " curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash -o /tmp/unleash && chmod +x /tmp/unleash && /tmp/unleash bypass" echo " curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/runaway -o /tmp/runaway && chmod +x /tmp/runaway && /tmp/runaway bypass"
echo "" echo ""
echo "From booted system (sudo needed):" echo "From booted system (sudo needed):"
echo " sudo ./unleash heal # fix after update" echo " sudo ./runaway heal # fix after update"
echo " sudo ./unleash harden # cleanup live MDM artifacts" echo " sudo ./runaway harden # cleanup live MDM artifacts"
echo " sudo ./unleash audit # deep scan" echo " sudo ./runaway audit # deep scan"
echo " sudo ./unleash check # pre-format report" echo " sudo ./runaway check # pre-format report"
echo " sudo ./unleash monitor # watch MDM in background" echo " sudo ./runaway monitor # watch MDM in background"
echo " sudo ./unleash persist # auto-heal on every boot" echo " sudo ./runaway persist # auto-heal on every boot"
echo " sudo ./unleash firewall # pf kernel block" echo " sudo ./runaway firewall # pf kernel block"
echo " sudo ./unleash whitelist # block MDM only, keep iCloud" echo " sudo ./runaway whitelist # block MDM only, keep iCloud"
+9 -9
View File
@@ -3,13 +3,13 @@
# Generates a terminal demo output for README/site. # Generates a terminal demo output for README/site.
# Run: bash record-demo.sh > demo-output.txt # Run: bash record-demo.sh > demo-output.txt
echo "$ ./unleash --version" echo "$ ./runaway --version"
./unleash --version ./runaway --version
echo "" echo ""
echo "$ sudo ./unleash doctor" echo "$ sudo ./runaway doctor"
echo "[SUDO] Simulated doctor output for demo:" echo "[SUDO] Simulated doctor output for demo:"
echo " ✓ Script location: /Users/user/unleash" echo " ✓ Script location: /Users/user/runaway"
echo " ✓ Library files: 21/21 modules loaded" echo " ✓ Library files: 21/21 modules loaded"
echo " ✓ Root privileges" echo " ✓ Root privileges"
echo " ⚠ Recovery mode: no (limited to booted commands)" echo " ⚠ Recovery mode: no (limited to booted commands)"
@@ -20,16 +20,16 @@ echo " ✓ launchctl available"
echo " ⚠ Third-party firewall: Little Snitch detected" echo " ⚠ Third-party firewall: Little Snitch detected"
echo "" echo ""
echo "$ sudo ./unleash check" echo "$ sudo ./runaway check"
sudo ./unleash check 2>/dev/null || echo "[DEMO] Would show pre-format assessment" sudo ./runaway check 2>/dev/null || echo "[DEMO] Would show pre-format assessment"
echo "" echo ""
echo "$ sudo ./unleash audit" echo "$ sudo ./runaway audit"
echo "[DEMO] Audit scan complete:" echo "[DEMO] Audit scan complete:"
echo " Profiles: 0" echo " Profiles: 0"
echo " DEP record: clean" echo " DEP record: clean"
echo " Risk: LOW" echo " Risk: LOW"
echo "" echo ""
echo "$ ./unleash --version" echo "$ ./runaway --version"
./unleash --version ./runaway --version
+2 -2
View File
@@ -1,5 +1,5 @@
BACKUP_DIR="$(dirname "$(dirname "$0")")/.unleash-backup" BACKUP_DIR="$(dirname "$(dirname "$0")")/.runaway-backup"
check_disk_space() { check_disk_space() {
local data_mount="$1" local data_mount="$1"
@@ -80,7 +80,7 @@ restore_state() {
success "launchd override restored" success "launchd override restored"
fi fi
sed -i '' '/# Added by unleash/d' "$data_mount/private/etc/hosts" 2>/dev/null || true sed -i '' '/# Added by runaway/d' "$data_mount/private/etc/hosts" 2>/dev/null || true
rm -f "$BACKUP_DIR/data_volume_path" "$BACKUP_DIR/timestamp" rm -f "$BACKUP_DIR/data_volume_path" "$BACKUP_DIR/timestamp"
success "Restore complete" success "Restore complete"
+13 -13
View File
@@ -56,20 +56,20 @@ run_preformat_check() {
step "Checking pf firewall status..." step "Checking pf firewall status..."
if command -v pfctl &>/dev/null; then if command -v pfctl &>/dev/null; then
if pfctl -a "com.unleash/mdm" -s rules 2>/dev/null | grep -q "block"; then if pfctl -a "com.runaway/mdm" -s rules 2>/dev/null | grep -q "block"; then
echo -e " ${GRN}Unleash pf firewall active${NC}" echo -e " ${GRN}Runaway pf firewall active${NC}"
else else
echo -e " ${YEL}No Unleash pf firewall rules${NC}" echo -e " ${YEL}No Runaway pf firewall rules${NC}"
fi fi
else else
echo -e " ${YEL}pfctl not available${NC}" echo -e " ${YEL}pfctl not available${NC}"
fi fi
step "Checking persistence LaunchDaemon..." step "Checking persistence LaunchDaemon..."
if [ -f "/Library/LaunchDaemons/com.unleash.heal.plist" ]; then if [ -f "/Library/LaunchDaemons/com.runaway.heal.plist" ]; then
echo -e " ${GRN}Unleash LaunchDaemon installed (auto-heal on boot)${NC}" echo -e " ${GRN}Runaway LaunchDaemon installed (auto-heal on boot)${NC}"
else else
echo -e " ${YEL}No Unleash LaunchDaemon${NC}" echo -e " ${YEL}No Runaway LaunchDaemon${NC}"
fi fi
echo "" echo ""
@@ -78,12 +78,12 @@ run_preformat_check() {
echo -e "${CYAN}║${NC} ${GRN}SAFE TO FORMAT${NC} — No MDM enrollment detected ${CYAN}║${NC}" echo -e "${CYAN}║${NC} ${GRN}SAFE TO FORMAT${NC} — No MDM enrollment detected ${CYAN}║${NC}"
echo -e "${CYAN}║${NC} This Mac should not lock after a wipe. ${CYAN}║${NC}" echo -e "${CYAN}║${NC} This Mac should not lock after a wipe. ${CYAN}║${NC}"
echo -e "${CYAN}║${NC} If you want defense-in-depth anyway, run: ${CYAN}║${NC}" echo -e "${CYAN}║${NC} If you want defense-in-depth anyway, run: ${CYAN}║${NC}"
echo -e "${CYAN}║${NC} ${YEL}sudo ./unleash persist && sudo ./unleash firewall${NC} ${CYAN}║${NC}" echo -e "${CYAN}║${NC} ${YEL}sudo ./runaway persist && sudo ./runaway firewall${NC} ${CYAN}║${NC}"
else else
echo -e "${CYAN}║${NC} ${RED}MDM DETECTED${NC} — This Mac WILL lock after format ${CYAN}║${NC}" echo -e "${CYAN}║${NC} ${RED}MDM DETECTED${NC} — This Mac WILL lock after format ${CYAN}║${NC}"
echo -e "${CYAN}║${NC} Run from Recovery after wipe: ${YEL}./unleash bypass${NC} ${CYAN}║${NC}" echo -e "${CYAN}║${NC} Run from Recovery after wipe: ${YEL}./runaway bypass${NC} ${CYAN}║${NC}"
echo -e "${CYAN}║${NC} To survive macOS updates (not full wipes): ${CYAN}║${NC}" echo -e "${CYAN}║${NC} To survive macOS updates (not full wipes): ${CYAN}║${NC}"
echo -e "${CYAN}║${NC} ${YEL}sudo ./unleash persist && sudo ./unleash firewall${NC} ${CYAN}║${NC}" echo -e "${CYAN}║${NC} ${YEL}sudo ./runaway persist && sudo ./runaway firewall${NC} ${CYAN}║${NC}"
fi fi
echo -e "${CYAN}╚══════════════════════════════════════════════════════════════╝${NC}" echo -e "${CYAN}╚══════════════════════════════════════════════════════════════╝${NC}"
} }
@@ -94,19 +94,19 @@ check_upgrade_safety() {
step "Checking if suppression will survive upgrade..." step "Checking if suppression will survive upgrade..."
local issues=0 local issues=0
if [ -f "/Library/LaunchDaemons/com.unleash.heal.plist" ]; then if [ -f "/Library/LaunchDaemons/com.runaway.heal.plist" ]; then
echo -e " ${GRN}Persistence installed — heal runs after reboot${NC}" echo -e " ${GRN}Persistence installed — heal runs after reboot${NC}"
else else
echo -e " ${RED}No persistence — upgrade may restore MDM${NC}" echo -e " ${RED}No persistence — upgrade may restore MDM${NC}"
echo -e " ${YEL}Fix: sudo ./unleash persist${NC}" echo -e " ${YEL}Fix: sudo ./runaway persist${NC}"
issues=$((issues + 1)) issues=$((issues + 1))
fi fi
if command -v pfctl &>/dev/null && pfctl -a "com.unleash/mdm" -s rules 2>/dev/null | grep -q "block"; then if command -v pfctl &>/dev/null && pfctl -a "com.runaway/mdm" -s rules 2>/dev/null | grep -q "block"; then
echo -e " ${GRN}pf firewall active — survives upgrade${NC}" echo -e " ${GRN}pf firewall active — survives upgrade${NC}"
else else
echo -e " ${YEL}No pf firewall — upgrade may restore MDM connectivity${NC}" echo -e " ${YEL}No pf firewall — upgrade may restore MDM connectivity${NC}"
echo -e " ${YEL}Fix: sudo ./unleash whitelist${NC}" echo -e " ${YEL}Fix: sudo ./runaway whitelist${NC}"
issues=$((issues + 1)) issues=$((issues + 1))
fi fi
+8 -8
View File
@@ -1,4 +1,4 @@
CONFIG_FILE="$HOME/.unleash.conf" CONFIG_FILE="$HOME/.runaway.conf"
load_config() { load_config() {
[ -f "$CONFIG_FILE" ] || return 0 [ -f "$CONFIG_FILE" ] || return 0
@@ -20,10 +20,10 @@ _rewrite_config() {
local tmp local tmp
[ -f "$CONFIG_FILE" ] || touch "$CONFIG_FILE" [ -f "$CONFIG_FILE" ] || touch "$CONFIG_FILE"
tmp=$(mktemp "${CONFIG_FILE}.XXXXXX") || return 1 tmp=$(mktemp "${CONFIG_FILE}.XXXXXX") || return 1
if ! UNLEASH_CONFIG_KEY="$key" UNLEASH_CONFIG_VALUE="$value" \ if ! RUNAWAY_CONFIG_KEY="$key" RUNAWAY_CONFIG_VALUE="$value" \
UNLEASH_CONFIG_OPERATION="${3:-set}" awk ' RUNAWAY_CONFIG_OPERATION="${3:-set}" awk '
BEGIN { key=ENVIRON["UNLEASH_CONFIG_KEY"]; value=ENVIRON["UNLEASH_CONFIG_VALUE"]; BEGIN { key=ENVIRON["RUNAWAY_CONFIG_KEY"]; value=ENVIRON["RUNAWAY_CONFIG_VALUE"];
operation=ENVIRON["UNLEASH_CONFIG_OPERATION"] } operation=ENVIRON["RUNAWAY_CONFIG_OPERATION"] }
index($0, key "=")==1 { if (!found++ && operation=="set") print key "=" value; next } index($0, key "=")==1 { if (!found++ && operation=="set") print key "=" value; next }
{ print } { print }
END { if (!found && operation=="set") print key "=" value } END { if (!found && operation=="set") print key "=" value }
@@ -56,7 +56,7 @@ cmd_config() {
local key="${3:-}" local key="${3:-}"
local value="${4:-}" local value="${4:-}"
[ -z "$key" ] || [ -z "$value" ] && { [ -z "$key" ] || [ -z "$value" ] && {
info "Usage: ./unleash config set KEY VALUE" info "Usage: ./runaway config set KEY VALUE"
info "Keys: WEBHOOK, LOG_LEVEL (verbose), LOG_FILE" info "Keys: WEBHOOK, LOG_LEVEL (verbose), LOG_FILE"
return 1 return 1
} }
@@ -64,14 +64,14 @@ cmd_config() {
;; ;;
unset) unset)
local key="${3:-}" local key="${3:-}"
[ -z "$key" ] && { info "Usage: ./unleash config unset KEY"; return 1; } [ -z "$key" ] && { info "Usage: ./runaway config unset KEY"; return 1; }
if [ -f "$CONFIG_FILE" ]; then if [ -f "$CONFIG_FILE" ]; then
_rewrite_config "$key" "" unset || return 1 _rewrite_config "$key" "" unset || return 1
success "Removed $key from config" success "Removed $key from config"
fi fi
;; ;;
*) *)
info "Usage: ./unleash config {show|set KEY VALUE|unset KEY}" info "Usage: ./runaway config {show|set KEY VALUE|unset KEY}"
;; ;;
esac esac
} }
+2 -2
View File
@@ -1,5 +1,5 @@
run_demo() { run_demo() {
header "Unleash Demo — Simulated MDM Bypass" header "Runaway Demo — Simulated MDM Bypass"
local demo_dir local demo_dir
demo_dir=$(mktemp -d) demo_dir=$(mktemp -d)
@@ -79,6 +79,6 @@ run_demo() {
echo -e "${CYAN}╔═══════════════════════════════════════════════╗${NC}" echo -e "${CYAN}╔═══════════════════════════════════════════════╗${NC}"
echo -e "${CYAN}║${NC} ${GRN}Demo Complete${NC} ${CYAN}║${NC}" echo -e "${CYAN}║${NC} ${GRN}Demo Complete${NC} ${CYAN}║${NC}"
echo -e "${CYAN}║${NC} Commands used: suppress, heal ${CYAN}║${NC}" echo -e "${CYAN}║${NC} Commands used: suppress, heal ${CYAN}║${NC}"
echo -e "${CYAN}║${NC} Try: ${YEL}sudo ./unleash doctor${NC} for real diagnostics ${CYAN}║${NC}" echo -e "${CYAN}║${NC} Try: ${YEL}sudo ./runaway doctor${NC} for real diagnostics ${CYAN}║${NC}"
echo -e "${CYAN}╚═══════════════════════════════════════════════╝${NC}" echo -e "${CYAN}╚═══════════════════════════════════════════════╝${NC}"
} }
+4 -4
View File
@@ -1,5 +1,5 @@
DISCORD_BOT_DIR="/tmp/unleash-discord" DISCORD_BOT_DIR="/tmp/runaway-discord"
DISCORD_BOT_SCRIPT="${DISCORD_BOT_DIR}/bot.sh" DISCORD_BOT_SCRIPT="${DISCORD_BOT_DIR}/bot.sh"
DISCORD_BOT_PID="${DISCORD_BOT_DIR}/bot.pid" DISCORD_BOT_PID="${DISCORD_BOT_DIR}/bot.pid"
@@ -22,7 +22,7 @@ cmd_discord_bot_install() {
cat > "$DISCORD_BOT_SCRIPT" <<- BOT cat > "$DISCORD_BOT_SCRIPT" <<- BOT
#!/bin/bash #!/bin/bash
# Unleash Discord Bot — monitors MDM and sends alerts # Runaway Discord Bot — monitors MDM and sends alerts
TOKEN="$token" TOKEN="$token"
CHANNEL_ID="$channel_id" CHANNEL_ID="$channel_id"
LAST_STATE="" LAST_STATE=""
@@ -35,7 +35,7 @@ while true; do
curl -s -X POST "https://discord.com/api/v10/channels/\$CHANNEL_ID/messages" \ curl -s -X POST "https://discord.com/api/v10/channels/\$CHANNEL_ID/messages" \
-H "Authorization: Bot \$TOKEN" \ -H "Authorization: Bot \$TOKEN" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{"content":"🚨 **Unleash Alert** — MDM enrollment detected on '"$(hostname)"'"}' -d '{"content":"🚨 **Runaway Alert** — MDM enrollment detected on '"$(hostname)"'"}'
fi fi
LAST_STATE="\$STATE" LAST_STATE="\$STATE"
sleep 300 sleep 300
@@ -47,7 +47,7 @@ BOT
local pid=$! local pid=$!
echo "$pid" > "$DISCORD_BOT_PID" echo "$pid" > "$DISCORD_BOT_PID"
success "Discord bot started (PID $pid)" success "Discord bot started (PID $pid)"
info "To stop: ./unleash discord-bot-stop" info "To stop: ./runaway discord-bot-stop"
} }
cmd_discord_bot_stop() { cmd_discord_bot_stop() {
+5 -5
View File
@@ -47,7 +47,7 @@ _network_diagnostics() {
run_doctor() { run_doctor() {
if [ "${1:-}" = --network ]; then _network_diagnostics; return; fi if [ "${1:-}" = --network ]; then _network_diagnostics; return; fi
header "Unleash Doctor — Pre-Flight Check" header "Runaway Doctor — Pre-Flight Check"
local errors=0 warnings=0 local errors=0 warnings=0
@@ -150,22 +150,22 @@ run_doctor() {
echo "" echo ""
step "Persistence status" step "Persistence status"
if [ -f "/Library/LaunchDaemons/com.unleash.heal.plist" ]; then if [ -f "/Library/LaunchDaemons/com.runaway.heal.plist" ]; then
echo " heal LaunchDaemon: installed" echo " heal LaunchDaemon: installed"
else else
echo " heal LaunchDaemon: not installed" echo " heal LaunchDaemon: not installed"
fi fi
if [ -f "/Library/LaunchDaemons/com.unleash.monitor.plist" ]; then if [ -f "/Library/LaunchDaemons/com.runaway.monitor.plist" ]; then
echo " monitor LaunchDaemon: installed" echo " monitor LaunchDaemon: installed"
else else
echo " monitor LaunchDaemon: not installed" echo " monitor LaunchDaemon: not installed"
fi fi
if [ -f "/etc/pf.anchors/com.unleash/mdm" ]; then if [ -f "/etc/pf.anchors/com.runaway/mdm" ]; then
echo " pf firewall anchor: installed" echo " pf firewall anchor: installed"
else else
echo " pf firewall anchor: not installed" echo " pf firewall anchor: not installed"
fi fi
if [ -f "/etc/pf.anchors/com.unleash.selective" ]; then if [ -f "/etc/pf.anchors/com.runaway.selective" ]; then
echo " pf selective anchor: installed" echo " pf selective anchor: installed"
else else
echo " pf selective anchor: not installed" echo " pf selective anchor: not installed"
+12 -12
View File
@@ -1,5 +1,5 @@
FIREWALL_ANCHOR="com.unleash/mdm" FIREWALL_ANCHOR="com.runaway/mdm"
FIREWALL_CONF="/etc/pf.conf" FIREWALL_CONF="/etc/pf.conf"
FIREWALL_ANCHOR_DIR="/etc/pf.anchors" FIREWALL_ANCHOR_DIR="/etc/pf.anchors"
@@ -36,7 +36,7 @@ install_pf_mdm_block() {
mkdir -p "$anchor_dir" mkdir -p "$anchor_dir"
cat > "$anchor_file" << 'ANCHOR' cat > "$anchor_file" << 'ANCHOR'
# Unleash MDM block — Apple MDM infrastructure IP ranges # Runaway MDM block — Apple MDM infrastructure IP ranges
# These ranges host deviceenrollment.apple.com, mdmenrollment.apple.com, etc. # These ranges host deviceenrollment.apple.com, mdmenrollment.apple.com, etc.
# Blocking at pf level is immune to DNS-over-HTTPS bypass. # Blocking at pf level is immune to DNS-over-HTTPS bypass.
block drop out proto {tcp,udp} to {17.0.0.0/8} block drop out proto {tcp,udp} to {17.0.0.0/8}
@@ -50,15 +50,15 @@ ANCHOR
local load_line="load anchor \"${FIREWALL_ANCHOR}\" from \"${anchor_file}\"" local load_line="load anchor \"${FIREWALL_ANCHOR}\" from \"${anchor_file}\""
if [ -f "$pf_conf" ]; then if [ -f "$pf_conf" ]; then
if grep -q "com.unleash" "$pf_conf" 2>/dev/null; then if grep -q "com.runaway" "$pf_conf" 2>/dev/null; then
info "pf.conf already has Unleash anchor" info "pf.conf already has Runaway anchor"
else else
printf '\n%s\n%s\n%s\n' "# Added by unleash — MDM block" "$anchor_line" "$load_line" >> "$pf_conf" printf '\n%s\n%s\n%s\n' "# Added by runaway — MDM block" "$anchor_line" "$load_line" >> "$pf_conf"
success "pf.conf updated" success "pf.conf updated"
fi fi
else else
cat > "$pf_conf" <<- EOF cat > "$pf_conf" <<- EOF
# pf.conf — restored by unleash # pf.conf — restored by runaway
# #
# Default macOS pf.conf # Default macOS pf.conf
scrub-anchor "com.apple/*" scrub-anchor "com.apple/*"
@@ -69,11 +69,11 @@ ANCHOR
anchor "com.apple/*" anchor "com.apple/*"
load anchor "com.apple" from "/etc/pf.anchors/com.apple" load anchor "com.apple" from "/etc/pf.anchors/com.apple"
# Added by unleash — MDM block # Added by runaway — MDM block
${anchor_line} ${anchor_line}
${load_line} ${load_line}
EOF EOF
success "pf.conf created with Unleash anchor" success "pf.conf created with Runaway anchor"
fi fi
step "Loading pf rules..." step "Loading pf rules..."
@@ -96,7 +96,7 @@ remove_pf_mdm_block() {
local root="" local root=""
[ -n "$data_mount" ] && root="$data_mount" [ -n "$data_mount" ] && root="$data_mount"
step "Removing Unleash pf anchor..." step "Removing Runaway pf anchor..."
local anchor_file="${root}${FIREWALL_ANCHOR_DIR}/${FIREWALL_ANCHOR}" local anchor_file="${root}${FIREWALL_ANCHOR_DIR}/${FIREWALL_ANCHOR}"
if [ -f "$anchor_file" ]; then if [ -f "$anchor_file" ]; then
@@ -110,7 +110,7 @@ remove_pf_mdm_block() {
local tmp_conf local tmp_conf
tmp_conf=$(mktemp "${pf_conf}.XXXXXX") || return 1 tmp_conf=$(mktemp "${pf_conf}.XXXXXX") || return 1
if ! cp -p "$pf_conf" "$tmp_conf" \ if ! cp -p "$pf_conf" "$tmp_conf" \
|| ! sed '/# Added by unleash/d; /com\.unleash/d' "$pf_conf" > "$tmp_conf" \ || ! sed '/# Added by runaway/d; /com\.runaway/d' "$pf_conf" > "$tmp_conf" \
|| ! mv "$tmp_conf" "$pf_conf"; then || ! mv "$tmp_conf" "$pf_conf"; then
rm -f "$tmp_conf" rm -f "$tmp_conf"
return 1 return 1
@@ -133,9 +133,9 @@ pf_status() {
pfctl -si 2>/dev/null | grep -E "Status|Enabled" || echo " pf not enabled" pfctl -si 2>/dev/null | grep -E "Status|Enabled" || echo " pf not enabled"
echo "" echo ""
if pfctl -a "$FIREWALL_ANCHOR" -s rules 2>/dev/null; then if pfctl -a "$FIREWALL_ANCHOR" -s rules 2>/dev/null; then
info "Unleash MDM anchor rules:" info "Runaway MDM anchor rules:"
else else
info "No Unleash MDM anchor loaded" info "No Runaway MDM anchor loaded"
fi fi
else else
warn "pfctl not available" warn "pfctl not available"
+10 -10
View File
@@ -73,13 +73,13 @@ install_persist_launchdaemon() {
local root local root
root="$(_persist_mount_root "$data_mount")" root="$(_persist_mount_root "$data_mount")"
local unleash_src local runaway_src
unleash_src=$(_launchd_script_path) runaway_src=$(_launchd_script_path)
step "Installing LaunchDaemon for boot-time persistence..." step "Installing LaunchDaemon for boot-time persistence..."
local plist_dir="${root}/Library/LaunchDaemons" local plist_dir="${root}/Library/LaunchDaemons"
local plist_path="${plist_dir}/com.unleash.heal.plist" local plist_path="${plist_dir}/com.runaway.heal.plist"
mkdir -p "$plist_dir" mkdir -p "$plist_dir"
@@ -89,11 +89,11 @@ install_persist_launchdaemon() {
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>Label</key> <key>Label</key>
<string>com.unleash.heal</string> <string>com.runaway.heal</string>
<key>ProgramArguments</key> <key>ProgramArguments</key>
<array> <array>
<string>/bin/bash</string> <string>/bin/bash</string>
<string>${unleash_src}</string> <string>${runaway_src}</string>
<string>heal</string> <string>heal</string>
</array> </array>
<key>RunAtLoad</key> <key>RunAtLoad</key>
@@ -105,9 +105,9 @@ install_persist_launchdaemon() {
<key>KeepAlive</key> <key>KeepAlive</key>
<false/> <false/>
<key>StandardOutPath</key> <key>StandardOutPath</key>
<string>/var/log/unleash-heal.log</string> <string>/var/log/runaway-heal.log</string>
<key>StandardErrorPath</key> <key>StandardErrorPath</key>
<string>/var/log/unleash-heal.err</string> <string>/var/log/runaway-heal.err</string>
</dict> </dict>
</plist> </plist>
PLIST PLIST
@@ -131,16 +131,16 @@ remove_persist_launchdaemon() {
local data_mount="$1" local data_mount="$1"
local root local root
root="$(_persist_mount_root "$data_mount")" root="$(_persist_mount_root "$data_mount")"
local plist_path="${root}/Library/LaunchDaemons/com.unleash.heal.plist" local plist_path="${root}/Library/LaunchDaemons/com.runaway.heal.plist"
if [ -f "$plist_path" ]; then if [ -f "$plist_path" ]; then
step "Removing Unleash LaunchDaemon..." step "Removing Runaway LaunchDaemon..."
if command -v launchctl &>/dev/null; then if command -v launchctl &>/dev/null; then
launchctl unload "$plist_path" 2>/dev/null || true launchctl unload "$plist_path" 2>/dev/null || true
fi fi
rm -f "$plist_path" rm -f "$plist_path"
success "LaunchDaemon removed" success "LaunchDaemon removed"
else else
info "No Unleash LaunchDaemon installed" info "No Runaway LaunchDaemon installed"
fi fi
} }
+5 -5
View File
@@ -1,8 +1,8 @@
show_history() { show_history() {
header "Unleash Event History" header "Runaway Event History"
local log_dir="${1:-/var/log}" local log_dir="${1:-/var/log}"
local logs=("$log_dir/unleash-monitor.log" "$log_dir/unleash-heal.log" "$log_dir/unleash-monitor.err") local logs=("$log_dir/runaway-monitor.log" "$log_dir/runaway-heal.log" "$log_dir/runaway-monitor.err")
local found=false local found=false
for logfile in "${logs[@]}"; do for logfile in "${logs[@]}"; do
@@ -20,11 +20,11 @@ show_history() {
if [ "$found" = false ]; then if [ "$found" = false ]; then
info "No event logs found." info "No event logs found."
info "Run 'sudo ./unleash monitor' or 'sudo ./unleash persist' first." info "Run 'sudo ./runaway monitor' or 'sudo ./runaway persist' first."
fi fi
step "Backup records" step "Backup records"
local backup_dir=".unleash-backup" local backup_dir=".runaway-backup"
if [ -d "$backup_dir" ] && [ -f "$backup_dir/timestamp" ]; then if [ -d "$backup_dir" ] && [ -f "$backup_dir/timestamp" ]; then
local ts local ts
ts=$(cat "$backup_dir/timestamp") ts=$(cat "$backup_dir/timestamp")
@@ -36,7 +36,7 @@ show_history() {
clear_history() { clear_history() {
local log_dir="${1:-/var/log}" local log_dir="${1:-/var/log}"
local logs=("$log_dir/unleash-monitor.log" "$log_dir/unleash-heal.log" "$log_dir/unleash-monitor.err") local logs=("$log_dir/runaway-monitor.log" "$log_dir/runaway-heal.log" "$log_dir/runaway-monitor.err")
for logfile in "${logs[@]}"; do for logfile in "${logs[@]}"; do
if [ -f "$logfile" ]; then if [ -f "$logfile" ]; then
: > "$logfile" : > "$logfile"
+9 -9
View File
@@ -1,8 +1,8 @@
cmd_init() { cmd_init() {
header "unleash init — Setup Wizard" header "runaway init — Setup Wizard"
echo "This will walk you through setting up unleash for your Mac." echo "This will walk you through setting up runaway for your Mac."
echo "Press Ctrl+C at any time to abort." echo "Press Ctrl+C at any time to abort."
echo "" echo ""
@@ -46,7 +46,7 @@ cmd_init() {
if $root_ok; then if $root_ok; then
install_pf_mdm_block "" install_pf_mdm_block ""
else else
info "Skipping firewall (needs root). Run: sudo ./unleash firewall" info "Skipping firewall (needs root). Run: sudo ./runaway firewall"
fi fi
fi fi
@@ -57,7 +57,7 @@ cmd_init() {
if $root_ok; then if $root_ok; then
install_monitor_launchdaemon "" install_monitor_launchdaemon ""
else else
info "Skipping monitor (needs root). Run: sudo ./unleash monitor-install" info "Skipping monitor (needs root). Run: sudo ./runaway monitor-install"
fi fi
fi fi
@@ -68,9 +68,9 @@ cmd_init() {
if $root_ok && ! is_recovery; then if $root_ok && ! is_recovery; then
install_persist_launchdaemon "" install_persist_launchdaemon ""
elif is_recovery; then elif is_recovery; then
echo -e "${YEL}Run after reboot: sudo ./unleash persist${NC}" echo -e "${YEL}Run after reboot: sudo ./runaway persist${NC}"
else else
info "Skipping persist (needs root). Run: sudo ./unleash persist" info "Skipping persist (needs root). Run: sudo ./runaway persist"
fi fi
fi fi
@@ -86,7 +86,7 @@ cmd_init() {
echo "" echo ""
success "Setup complete!" success "Setup complete!"
info "Recommended next steps:" info "Recommended next steps:"
info " - From Recovery: ./unleash bypass (full bypass)" info " - From Recovery: ./runaway bypass (full bypass)"
info " - From Recovery: ./unleash check (pre-format check)" info " - From Recovery: ./runaway check (pre-format check)"
info " - After login: sudo ./unleash harden" info " - After login: sudo ./runaway harden"
} }
+2 -2
View File
@@ -56,7 +56,7 @@ detect_configurator_enrollment() {
return 0 return 0
else else
echo "" echo ""
echo -e "${YEL}Fix: re-run bypass from Recovery, then run 'sudo ./unleash harden'${NC}" echo -e "${YEL}Fix: re-run bypass from Recovery, then run 'sudo ./runaway harden'${NC}"
return 1 return 1
fi fi
} }
@@ -144,7 +144,7 @@ detect_migration_assistant() {
echo -e "$details" | sed '/^$/d' echo -e "$details" | sed '/^$/d'
echo "" echo ""
echo -e "${YEL}These user-level artifacts can re-enable MDM on every login.${NC}" echo -e "${YEL}These user-level artifacts can re-enable MDM on every login.${NC}"
echo -e "${YEL}Fix: run 'sudo ./unleash harden' or './unleash suppress' from Recovery.${NC}" echo -e "${YEL}Fix: run 'sudo ./runaway harden' or './runaway suppress' from Recovery.${NC}"
return 1 return 1
else else
echo -e "${GRN}✓ No Migration Assistant artifacts found${NC}" echo -e "${GRN}✓ No Migration Assistant artifacts found${NC}"
+19 -19
View File
@@ -3,13 +3,13 @@ install_monitor_launchdaemon() {
local root="" local root=""
[ -n "$data_mount" ] && root="$data_mount" [ -n "$data_mount" ] && root="$data_mount"
local unleash_src local runaway_src
unleash_src=$(_launchd_script_path) runaway_src=$(_launchd_script_path)
step "Installing monitor LaunchDaemon..." step "Installing monitor LaunchDaemon..."
local plist_dir="${root}/Library/LaunchDaemons" local plist_dir="${root}/Library/LaunchDaemons"
local plist_path="${plist_dir}/com.unleash.monitor.plist" local plist_path="${plist_dir}/com.runaway.monitor.plist"
mkdir -p "$plist_dir" mkdir -p "$plist_dir"
cat > "$plist_path" <<- PLIST cat > "$plist_path" <<- PLIST
@@ -18,11 +18,11 @@ install_monitor_launchdaemon() {
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>Label</key> <key>Label</key>
<string>com.unleash.monitor</string> <string>com.runaway.monitor</string>
<key>ProgramArguments</key> <key>ProgramArguments</key>
<array> <array>
<string>/bin/bash</string> <string>/bin/bash</string>
<string>${unleash_src}</string> <string>${runaway_src}</string>
<string>monitor</string> <string>monitor</string>
</array> </array>
<key>RunAtLoad</key> <key>RunAtLoad</key>
@@ -32,9 +32,9 @@ install_monitor_launchdaemon() {
<key>Nice</key> <key>Nice</key>
<integer>1</integer> <integer>1</integer>
<key>StandardOutPath</key> <key>StandardOutPath</key>
<string>/var/log/unleash-monitor.log</string> <string>/var/log/runaway-monitor.log</string>
<key>StandardErrorPath</key> <key>StandardErrorPath</key>
<string>/var/log/unleash-monitor.err</string> <string>/var/log/runaway-monitor.err</string>
</dict> </dict>
</plist> </plist>
PLIST PLIST
@@ -55,7 +55,7 @@ uninstall_monitor_launchdaemon() {
local data_mount="$1" local data_mount="$1"
local root="" local root=""
[ -n "$data_mount" ] && root="$data_mount" [ -n "$data_mount" ] && root="$data_mount"
local plist_path="${root}/Library/LaunchDaemons/com.unleash.monitor.plist" local plist_path="${root}/Library/LaunchDaemons/com.runaway.monitor.plist"
if [ -f "$plist_path" ]; then if [ -f "$plist_path" ]; then
step "Removing monitor LaunchDaemon..." step "Removing monitor LaunchDaemon..."
@@ -73,16 +73,16 @@ monitor_mdm() {
header "MDM Monitor (continuous)" header "MDM Monitor (continuous)"
if ! is_root; then if ! is_root; then
error_exit "Monitor requires sudo: sudo ./unleash monitor" error_exit "Monitor requires sudo: sudo ./runaway monitor"
fi fi
local logfile="/var/log/unleash-monitor.log" local logfile="/var/log/runaway-monitor.log"
local pidfile="/tmp/unleash-monitor.pid" local pidfile="/tmp/runaway-monitor.pid"
local webhook="${DISCORD_WEBHOOK:-}" local webhook="${DISCORD_WEBHOOK:-}"
if [ -f "$pidfile" ] && kill -0 "$(cat "$pidfile")" 2>/dev/null; then if [ -f "$pidfile" ] && kill -0 "$(cat "$pidfile")" 2>/dev/null; then
echo -e "${YEL}Monitor already running (PID $(cat "$pidfile"))${NC}" echo -e "${YEL}Monitor already running (PID $(cat "$pidfile"))${NC}"
echo -e "${YEL}Run 'sudo ./unleash monitor-stop' to stop it${NC}" echo -e "${YEL}Run 'sudo ./runaway monitor-stop' to stop it${NC}"
return 0 return 0
fi fi
@@ -132,11 +132,11 @@ monitor_mdm() {
if [ "$state" = "dirty" ] && [ $((now - last_notification)) -gt 3600 ]; then if [ "$state" = "dirty" ] && [ $((now - last_notification)) -gt 3600 ]; then
last_notification=$now last_notification=$now
if command -v osascript &>/dev/null; then if command -v osascript &>/dev/null; then
osascript -e "display notification \"$reason\" with title \"Unleash MDM Alert\" subtitle \"MDM enrollment detected\"" 2>/dev/null || true osascript -e "display notification \"$reason\" with title \"Runaway MDM Alert\" subtitle \"MDM enrollment detected\"" 2>/dev/null || true
fi fi
if [ -n "$webhook" ]; then if [ -n "$webhook" ]; then
local payload local payload
payload=$(printf '{"content":"🚨 **Unleash Alert** — MDM enrollment detected: %s","username":"Unleash Monitor"}' "$reason") payload=$(printf '{"content":"🚨 **Runaway Alert** — MDM enrollment detected: %s","username":"Runaway Monitor"}' "$reason")
curl -s -H "Content-Type: application/json" -d "$payload" "$webhook" 2>/dev/null || warn "Webhook failed" curl -s -H "Content-Type: application/json" -d "$payload" "$webhook" 2>/dev/null || warn "Webhook failed"
fi fi
heal_suppress "" heal_suppress ""
@@ -152,11 +152,11 @@ monitor_mdm() {
if [ "$consecutive_failures" -ge 12 ]; then if [ "$consecutive_failures" -ge 12 ]; then
echo "$(date) CRITICAL: 12 consecutive dirty checks" >> "$logfile" echo "$(date) CRITICAL: 12 consecutive dirty checks" >> "$logfile"
if command -v osascript &>/dev/null; then if command -v osascript &>/dev/null; then
osascript -e "display dialog \"MDM keeps coming back after 12 attempts. Something is persistently re-enrolling.\" with title \"Unleash\" buttons {\"OK\"} default button \"OK\"" 2>/dev/null || true osascript -e "display dialog \"MDM keeps coming back after 12 attempts. Something is persistently re-enrolling.\" with title \"Runaway\" buttons {\"OK\"} default button \"OK\"" 2>/dev/null || true
fi fi
if [ -n "$webhook" ]; then if [ -n "$webhook" ]; then
curl -s -H "Content-Type: application/json" \ curl -s -H "Content-Type: application/json" \
-d '{"content":"🚨 **Unleash CRITICAL** — 12 consecutive MDM detections. Persistent re-enrollment detected.","username":"Unleash Monitor"}' \ -d '{"content":"🚨 **Runaway CRITICAL** — 12 consecutive MDM detections. Persistent re-enrollment detected.","username":"Runaway Monitor"}' \
"$webhook" 2>/dev/null || true "$webhook" 2>/dev/null || true
fi fi
consecutive_failures=0 consecutive_failures=0
@@ -168,7 +168,7 @@ monitor_mdm() {
} }
stop_monitor() { stop_monitor() {
local pidfile="${1:-/tmp/unleash-monitor.pid}" local pidfile="${1:-/tmp/runaway-monitor.pid}"
if [ -f "$pidfile" ]; then if [ -f "$pidfile" ]; then
local pid local pid
pid=$(cat "$pidfile") pid=$(cat "$pidfile")
@@ -185,10 +185,10 @@ stop_monitor() {
} }
monitor_status() { monitor_status() {
local pidfile="${1:-/tmp/unleash-monitor.pid}" local pidfile="${1:-/tmp/runaway-monitor.pid}"
if [ -f "$pidfile" ] && kill -0 "$(cat "$pidfile")" 2>/dev/null; then if [ -f "$pidfile" ] && kill -0 "$(cat "$pidfile")" 2>/dev/null; then
echo -e "${GRN}Monitor running (PID $(cat "$pidfile"))${NC}" echo -e "${GRN}Monitor running (PID $(cat "$pidfile"))${NC}"
tail -5 /var/log/unleash-monitor.log 2>/dev/null || echo " (no log entries yet)" tail -5 /var/log/runaway-monitor.log 2>/dev/null || echo " (no log entries yet)"
else else
echo -e "${YEL}Monitor not running${NC}" echo -e "${YEL}Monitor not running${NC}"
fi fi
+3 -3
View File
@@ -1,6 +1,6 @@
cmd_predict() { cmd_predict() {
header "unleash predict — Serial Number Lookup" header "runaway predict — Serial Number Lookup"
local serial="" local serial=""
serial=$(ioreg -rd1 -c IOPlatformExpertDevice 2>/dev/null | grep -i "IOPlatformSerialNumber" | awk -F'"' '{print $4}' || echo "") serial=$(ioreg -rd1 -c IOPlatformExpertDevice 2>/dev/null | grep -i "IOPlatformSerialNumber" | awk -F'"' '{print $4}' || echo "")
@@ -12,7 +12,7 @@ cmd_predict() {
read -r -p "Enter serial number (or press Enter to skip): " serial read -r -p "Enter serial number (or press Enter to skip): " serial
fi fi
if [ -z "$serial" ]; then if [ -z "$serial" ]; then
info "No serial provided. Run: ./unleash predict <serial>" info "No serial provided. Run: ./runaway predict <serial>"
return 0 return 0
fi fi
@@ -44,7 +44,7 @@ ORGS
org_name=$(echo "$match" | cut -d: -f2) org_name=$(echo "$match" | cut -d: -f2)
echo -e "${YEL}⚠ Predicted enrollment: $org_name${NC}" echo -e "${YEL}⚠ Predicted enrollment: $org_name${NC}"
info "This serial prefix is commonly associated with $org_name-managed devices." info "This serial prefix is commonly associated with $org_name-managed devices."
info "Remediation: sudo ./unleash remediate" info "Remediation: sudo ./runaway remediate"
else else
info "No known association for this serial prefix." info "No known association for this serial prefix."
info "The device may be from a smaller org or not organizationally enrolled." info "The device may be from a smaller org or not organizationally enrolled."
+1 -1
View File
@@ -14,7 +14,7 @@ ORGS
} }
cmd_remediate() { cmd_remediate() {
header "unleash remediate — Per-Org MDM Cleanup" header "runaway remediate — Per-Org MDM Cleanup"
local org="${1:-auto}" local org="${1:-auto}"
+16 -16
View File
@@ -3,7 +3,7 @@ generate_report() {
generate_report_json generate_report_json
return return
fi fi
header "Unleash System Report" header "Runaway System Report"
local ts local ts
ts=$(date '+%Y-%m-%d %H:%M:%S') ts=$(date '+%Y-%m-%d %H:%M:%S')
@@ -46,29 +46,29 @@ generate_report() {
if command -v pfctl &>/dev/null; then if command -v pfctl &>/dev/null; then
pfctl -si 2>/dev/null | grep -E "Status|Enabled" || echo " pf not enabled" pfctl -si 2>/dev/null | grep -E "Status|Enabled" || echo " pf not enabled"
echo "" echo ""
pfctl -a "com.unleash/mdm" -s rules 2>/dev/null \ pfctl -a "com.runaway/mdm" -s rules 2>/dev/null \
&& echo " Unleash MDM anchor: active" \ && echo " Runaway MDM anchor: active" \
|| echo " Unleash MDM anchor: not loaded" || echo " Runaway MDM anchor: not loaded"
pfctl -a "com.unleash.selective" -s rules 2>/dev/null \ pfctl -a "com.runaway.selective" -s rules 2>/dev/null \
&& echo " Unleash selective anchor: active" \ && echo " Runaway selective anchor: active" \
|| echo " Unleash selective anchor: not loaded" || echo " Runaway selective anchor: not loaded"
fi fi
echo "" echo ""
step "Persistence" step "Persistence"
[ -f "/Library/LaunchDaemons/com.unleash.heal.plist" ] \ [ -f "/Library/LaunchDaemons/com.runaway.heal.plist" ] \
&& echo " heal LaunchDaemon: installed" \ && echo " heal LaunchDaemon: installed" \
|| echo " heal LaunchDaemon: not installed" || echo " heal LaunchDaemon: not installed"
[ -f "/Library/LaunchDaemons/com.unleash.monitor.plist" ] \ [ -f "/Library/LaunchDaemons/com.runaway.monitor.plist" ] \
&& echo " monitor LaunchDaemon: installed" \ && echo " monitor LaunchDaemon: installed" \
|| echo " monitor LaunchDaemon: not installed" || echo " monitor LaunchDaemon: not installed"
[ -f "/tmp/unleash-monitor.pid" ] \ [ -f "/tmp/runaway-monitor.pid" ] \
&& echo " monitor process: running" \ && echo " monitor process: running" \
|| echo " monitor process: not running" || echo " monitor process: not running"
echo "" echo ""
step "Recent Events" step "Recent Events"
for logfile in /var/log/unleash-monitor.log /var/log/unleash-heal.log; do for logfile in /var/log/runaway-monitor.log /var/log/runaway-heal.log; do
if [ -f "$logfile" ] && [ -s "$logfile" ]; then if [ -f "$logfile" ] && [ -s "$logfile" ]; then
echo " From $(basename "$logfile"):" echo " From $(basename "$logfile"):"
tail -3 "$logfile" | sed 's/^/ /' tail -3 "$logfile" | sed 's/^/ /'
@@ -125,11 +125,11 @@ generate_report_json() {
report="${report} \"installed_profiles\": $profile_count,\n" report="${report} \"installed_profiles\": $profile_count,\n"
local heal_installed="false" local heal_installed="false"
[ -f "/Library/LaunchDaemons/com.unleash.heal.plist" ] && heal_installed="true" [ -f "/Library/LaunchDaemons/com.runaway.heal.plist" ] && heal_installed="true"
local monitor_installed="false" local monitor_installed="false"
[ -f "/Library/LaunchDaemons/com.unleash.monitor.plist" ] && monitor_installed="true" [ -f "/Library/LaunchDaemons/com.runaway.monitor.plist" ] && monitor_installed="true"
local monitor_running="false" local monitor_running="false"
[ -f "/tmp/unleash-monitor.pid" ] && monitor_running="true" [ -f "/tmp/runaway-monitor.pid" ] && monitor_running="true"
report="${report} \"persistence\": {\n" report="${report} \"persistence\": {\n"
report="${report} \"heal_launchdaemon\": $heal_installed,\n" report="${report} \"heal_launchdaemon\": $heal_installed,\n"
report="${report} \"monitor_launchdaemon\": $monitor_installed,\n" report="${report} \"monitor_launchdaemon\": $monitor_installed,\n"
@@ -137,11 +137,11 @@ generate_report_json() {
report="${report} },\n" report="${report} },\n"
local fw_active="false" local fw_active="false"
if command -v pfctl &>/dev/null && pfctl -a "com.unleash/mdm" -s rules 2>/dev/null | grep -q "block"; then if command -v pfctl &>/dev/null && pfctl -a "com.runaway/mdm" -s rules 2>/dev/null | grep -q "block"; then
fw_active="true" fw_active="true"
fi fi
local selective_active="false" local selective_active="false"
if command -v pfctl &>/dev/null && pfctl -a "com.unleash.selective" -s rules 2>/dev/null | grep -q "block"; then if command -v pfctl &>/dev/null && pfctl -a "com.runaway.selective" -s rules 2>/dev/null | grep -q "block"; then
selective_active="true" selective_active="true"
fi fi
report="${report} \"firewall\": {\n" report="${report} \"firewall\": {\n"
+8 -8
View File
@@ -1,4 +1,4 @@
GPG_KEY_URL="https://raw.githubusercontent.com/mateussiqueira/unleash/main/.github/unleash.gpg" GPG_KEY_URL="https://raw.githubusercontent.com/mateussiqueira/runaway/main/.github/runaway.gpg"
import_gpg_key() { import_gpg_key() {
local tmp_key local tmp_key
@@ -30,13 +30,13 @@ verify_gpg_signature() {
} }
do_self_update() { do_self_update() {
header "Unleash Update" header "Runaway Update"
if ! command -v curl &>/dev/null; then if ! command -v curl &>/dev/null; then
error_exit "curl required for update" error_exit "curl required for update"
fi fi
local repo="mateussiqueira/unleash" local repo="mateussiqueira/runaway"
local api_url="https://api.github.com/repos/${repo}/releases/latest" local api_url="https://api.github.com/repos/${repo}/releases/latest"
local tmp_dir local tmp_dir
tmp_dir=$(mktemp -d) tmp_dir=$(mktemp -d)
@@ -62,11 +62,11 @@ do_self_update() {
info "Updating from v$VERSION to v$latest_tag..." info "Updating from v$VERSION to v$latest_tag..."
begin "Downloading latest unleash" begin "Downloading latest runaway"
local dl_url="https://raw.githubusercontent.com/${repo}/main/unleash" local dl_url="https://raw.githubusercontent.com/${repo}/main/runaway"
local sig_url="${dl_url}.sig" local sig_url="${dl_url}.sig"
local tmp="$tmp_dir/unleash" local tmp="$tmp_dir/runaway"
local sig_tmp="$tmp_dir/unleash.sig" local sig_tmp="$tmp_dir/runaway.sig"
if curl -sL "$dl_url" -o "$tmp" && [ -s "$tmp" ]; then if curl -sL "$dl_url" -o "$tmp" && [ -s "$tmp" ]; then
curl -sL "$sig_url" -o "$sig_tmp" 2>/dev/null || true curl -sL "$sig_url" -o "$sig_tmp" 2>/dev/null || true
end_ok end_ok
@@ -87,7 +87,7 @@ do_self_update() {
end_fail; error_exit "Downloaded script has syntax errors" end_fail; error_exit "Downloaded script has syntax errors"
fi fi
local target="${0:-unleash}" local target="${0:-runaway}"
if [ ! -w "$target" ]; then if [ ! -w "$target" ]; then
info "$target not writable, trying sudo..." info "$target not writable, trying sudo..."
cp "$tmp" "$target" 2>/dev/null || sudo cp "$tmp" "$target" 2>/dev/null || { cp "$tmp" "$target" 2>/dev/null || sudo cp "$tmp" "$target" 2>/dev/null || {
+6 -6
View File
@@ -1,6 +1,6 @@
cmd_suggest() { cmd_suggest() {
header "unleash suggest — Risk-Based Recommendations" header "runaway suggest — Risk-Based Recommendations"
local score=0 local score=0
local recommendations="" local recommendations=""
@@ -14,8 +14,8 @@ cmd_suggest() {
recommendations="$recommendations\n - Run 'check' for pre-format safety report" recommendations="$recommendations\n - Run 'check' for pre-format safety report"
else else
info "System is booted normally" info "System is booted normally"
recommendations="$recommendations\n - Run 'sudo ./unleash heal' to check MDM state" recommendations="$recommendations\n - Run 'sudo ./runaway heal' to check MDM state"
recommendations="$recommendations\n - Run 'sudo ./unleash audit' for deep scan" recommendations="$recommendations\n - Run 'sudo ./runaway audit' for deep scan"
fi fi
local cfg_dir="/private/var/db/ConfigurationProfiles/Settings" local cfg_dir="/private/var/db/ConfigurationProfiles/Settings"
@@ -33,11 +33,11 @@ cmd_suggest() {
else else
echo -e "${YEL}⚠ MDM domains not blocked${NC}" echo -e "${YEL}⚠ MDM domains not blocked${NC}"
score=$((score + 5)) score=$((score + 5))
recommendations="$recommendations\n - Run 'sudo ./unleash firewall' for pf-level block" recommendations="$recommendations\n - Run 'sudo ./runaway firewall' for pf-level block"
fi fi
if command -v pfctl &>/dev/null; then if command -v pfctl &>/dev/null; then
if pfctl -a "com.unleash/mdm" -s rules 2>/dev/null | grep -q "block"; then if pfctl -a "com.runaway/mdm" -s rules 2>/dev/null | grep -q "block"; then
echo -e "${GRN}✓ pf firewall active${NC}" echo -e "${GRN}✓ pf firewall active${NC}"
fi fi
fi fi
@@ -46,7 +46,7 @@ cmd_suggest() {
local ma_result=$? local ma_result=$?
if [ "$ma_result" -ne 0 ]; then if [ "$ma_result" -ne 0 ]; then
score=$((score + 8)) score=$((score + 8))
recommendations="$recommendations\n - Run 'sudo ./unleash harden' to clean user artifacts" recommendations="$recommendations\n - Run 'sudo ./runaway harden' to clean user artifacts"
fi fi
detect_configurator_enrollment detect_configurator_enrollment
+6 -6
View File
@@ -6,7 +6,7 @@ _restore_rosetta_hosts() {
local hosts="$1" tmp_hosts local hosts="$1" tmp_hosts
tmp_hosts=$(mktemp "${hosts}.XXXXXX") || return 1 tmp_hosts=$(mktemp "${hosts}.XXXXXX") || return 1
if ! cp -p "$hosts" "$tmp_hosts" || ! awk ' if ! cp -p "$hosts" "$tmp_hosts" || ! awk '
$0=="# Added by unleash — DEP enrollment block" { owned=1; print; next } $0=="# Added by runaway — DEP enrollment block" { owned=1; print; next }
owned && /^(0[.]0[.]0[.]0|::)[[:space:]]+configuration[.]apple[.]com[[:space:]]*$/ { next } owned && /^(0[.]0[.]0[.]0|::)[[:space:]]+configuration[.]apple[.]com[[:space:]]*$/ { next }
owned && $0 !~ /^(0[.]0[.]0[.]0|::)[[:space:]]+[[:alnum:]_.-]+[[:space:]]*$/ { owned=0 } owned && $0 !~ /^(0[.]0[.]0[.]0|::)[[:space:]]+[[:alnum:]_.-]+[[:space:]]*$/ { owned=0 }
{ print } { print }
@@ -18,11 +18,11 @@ _restore_rosetta_hosts() {
rm -f "$tmp_hosts" rm -f "$tmp_hosts"
return 0 return 0
fi fi
if [ ! -e "$hosts.unleash-rosetta.bak" ]; then if [ ! -e "$hosts.runaway-rosetta.bak" ]; then
cp -p "$hosts" "$hosts.unleash-rosetta.bak" || { rm -f "$tmp_hosts"; return 1; } cp -p "$hosts" "$hosts.runaway-rosetta.bak" || { rm -f "$tmp_hosts"; return 1; }
fi fi
mv "$tmp_hosts" "$hosts" || { rm -f "$tmp_hosts"; return 1; } mv "$tmp_hosts" "$hosts" || { rm -f "$tmp_hosts"; return 1; }
info "Removed old Unleash Rosetta blocks; backup: $hosts.unleash-rosetta.bak" info "Removed old Runaway Rosetta blocks; backup: $hosts.runaway-rosetta.bak"
} }
suppress_enrollment() { suppress_enrollment() {
@@ -59,9 +59,9 @@ suppress_enrollment() {
step "Blocking enrollment domains (Data volume hosts)..." step "Blocking enrollment domains (Data volume hosts)..."
[ -f "$hosts" ] || { mkdir -p "$(dirname "$hosts")"; touch "$hosts"; } [ -f "$hosts" ] || { mkdir -p "$(dirname "$hosts")"; touch "$hosts"; }
_restore_rosetta_hosts "$hosts" || error_exit "Could not repair old Rosetta hosts blocks." _restore_rosetta_hosts "$hosts" || error_exit "Could not repair old Rosetta hosts blocks."
grep -q "Added by unleash" "$hosts" 2>/dev/null || { grep -q "Added by runaway" "$hosts" 2>/dev/null || {
echo "" >>"$hosts" echo "" >>"$hosts"
echo "# Added by unleash — DEP enrollment block" >>"$hosts" echo "# Added by runaway — DEP enrollment block" >>"$hosts"
} }
local domains=( local domains=(
+3 -3
View File
@@ -1,5 +1,5 @@
TELEMETRY_FILE="$HOME/.unleash-telemetry" TELEMETRY_FILE="$HOME/.runaway-telemetry"
telemetry_opt_in() { telemetry_opt_in() {
local val="${1:-}" local val="${1:-}"
@@ -13,7 +13,7 @@ telemetry_opt_in() {
local current="disabled" local current="disabled"
[ -f "$TELEMETRY_FILE" ] && current="enabled" [ -f "$TELEMETRY_FILE" ] && current="enabled"
info "Telemetry: $current" info "Telemetry: $current"
info "Usage: sudo ./unleash telemetry on|off" info "Usage: sudo ./runaway telemetry on|off"
fi fi
} }
@@ -26,7 +26,7 @@ telemetry_send() {
telemetry_is_enabled || return 0 telemetry_is_enabled || return 0
local event="$1" local event="$1"
local data="${2:-{}}" local data="${2:-{}}"
local url="https://unleash-telemetry.mateussiqueira.workers.dev/event" local url="https://runaway-telemetry.mateussiqueira.workers.dev/event"
local payload local payload
payload=$(printf '{"event":"%s","version":"%s","arch":"%s","os":"%s","data":%s}' \ payload=$(printf '{"event":"%s","version":"%s","arch":"%s","os":"%s","data":%s}' \
"$event" "$VERSION" "$(uname -m)" "$(uname -s)" "$data") "$event" "$VERSION" "$(uname -m)" "$(uname -s)" "$data")
+14 -14
View File
@@ -1,12 +1,12 @@
do_uninstall() { do_uninstall() {
header "Unleash — Full Uninstall" header "Runaway — Full Uninstall"
if ! is_root; then if ! is_root; then
error_exit "Uninstall needs sudo: sudo ./unleash uninstall" error_exit "Uninstall needs sudo: sudo ./runaway uninstall"
fi fi
begin "Removing heal LaunchDaemon" begin "Removing heal LaunchDaemon"
local plist="/Library/LaunchDaemons/com.unleash.heal.plist" local plist="/Library/LaunchDaemons/com.runaway.heal.plist"
if [ -f "$plist" ]; then if [ -f "$plist" ]; then
launchctl unload "$plist" 2>/dev/null || true launchctl unload "$plist" 2>/dev/null || true
rm -f "$plist" rm -f "$plist"
@@ -16,7 +16,7 @@ do_uninstall() {
fi fi
begin "Removing monitor LaunchDaemon" begin "Removing monitor LaunchDaemon"
plist="/Library/LaunchDaemons/com.unleash.monitor.plist" plist="/Library/LaunchDaemons/com.runaway.monitor.plist"
if [ -f "$plist" ]; then if [ -f "$plist" ]; then
launchctl unload "$plist" 2>/dev/null || true launchctl unload "$plist" 2>/dev/null || true
rm -f "$plist" rm -f "$plist"
@@ -26,17 +26,17 @@ do_uninstall() {
fi fi
begin "Cleaning pf anchors" begin "Cleaning pf anchors"
local anchors=("/etc/pf.anchors/com.unleash/mdm" "/etc/pf.anchors/com.unleash.selective") local anchors=("/etc/pf.anchors/com.runaway/mdm" "/etc/pf.anchors/com.runaway.selective")
for a in "${anchors[@]}"; do for a in "${anchors[@]}"; do
[ -f "$a" ] && rm -f "$a" [ -f "$a" ] && rm -f "$a"
done done
for anchor_name in "com.unleash/mdm" "com.unleash.selective"; do for anchor_name in "com.runaway/mdm" "com.runaway.selective"; do
pfctl -a "$anchor_name" -F all 2>/dev/null || true pfctl -a "$anchor_name" -F all 2>/dev/null || true
done done
local pf_conf="/etc/pf.conf" local pf_conf="/etc/pf.conf"
if [ -f "$pf_conf" ]; then if [ -f "$pf_conf" ]; then
sed -i '' '/# Added by unleash/d' "$pf_conf" 2>/dev/null || true sed -i '' '/# Added by runaway/d' "$pf_conf" 2>/dev/null || true
sed -i '' '/com\.unleash/d' "$pf_conf" 2>/dev/null || true sed -i '' '/com\.runaway/d' "$pf_conf" 2>/dev/null || true
fi fi
pfctl -f /etc/pf.conf 2>/dev/null || true pfctl -f /etc/pf.conf 2>/dev/null || true
end_ok end_ok
@@ -44,7 +44,7 @@ do_uninstall() {
begin "Cleaning hosts entries" begin "Cleaning hosts entries"
local hosts="/private/etc/hosts" local hosts="/private/etc/hosts"
if [ -f "$hosts" ]; then if [ -f "$hosts" ]; then
sed -i '' '/# Added by unleash/d' "$hosts" 2>/dev/null || true sed -i '' '/# Added by runaway/d' "$hosts" 2>/dev/null || true
local domains=("iprofiles.apple.com" "deviceenrollment.apple.com" "mdmenrollment.apple.com") local domains=("iprofiles.apple.com" "deviceenrollment.apple.com" "mdmenrollment.apple.com")
for d in "${domains[@]}"; do for d in "${domains[@]}"; do
sed -i '' "/[[:space:]]$d/d" "$hosts" 2>/dev/null || true sed -i '' "/[[:space:]]$d/d" "$hosts" 2>/dev/null || true
@@ -68,7 +68,7 @@ do_uninstall() {
fi fi
begin "Removing backup directory" begin "Removing backup directory"
local backup=".unleash-backup" local backup=".runaway-backup"
if [ -d "$backup" ]; then if [ -d "$backup" ]; then
rm -rf "$backup" 2>/dev/null || true rm -rf "$backup" 2>/dev/null || true
end_ok end_ok
@@ -77,15 +77,15 @@ do_uninstall() {
fi fi
begin "Removing config file" begin "Removing config file"
if [ -f "$HOME/.unleash.conf" ]; then if [ -f "$HOME/.runaway.conf" ]; then
rm -f "$HOME/.unleash.conf" rm -f "$HOME/.runaway.conf"
end_ok end_ok
else else
end_fail; echo " Not found" end_fail; echo " Not found"
fi fi
begin "Stopping monitor if running" begin "Stopping monitor if running"
local pidfile="/tmp/unleash-monitor.pid" local pidfile="/tmp/runaway-monitor.pid"
if [ -f "$pidfile" ]; then if [ -f "$pidfile" ]; then
kill "$(cat "$pidfile")" 2>/dev/null || true kill "$(cat "$pidfile")" 2>/dev/null || true
rm -f "$pidfile" rm -f "$pidfile"
@@ -97,5 +97,5 @@ do_uninstall() {
echo "" echo ""
success "Uninstall complete" success "Uninstall complete"
info "Your system is back to its original state." info "Your system is back to its original state."
info "The unleash script itself was not removed." info "The runaway script itself was not removed."
} }
+10 -10
View File
@@ -1,11 +1,11 @@
VPN_RULES_ANCHOR="com.unleash/vpn-kill" VPN_RULES_ANCHOR="com.runaway/vpn-kill"
VPN_RULES_FILE="/etc/pf.anchors/com.unleash/vpn-kill" VPN_RULES_FILE="/etc/pf.anchors/com.runaway/vpn-kill"
vpn_kill_install() { vpn_kill_install() {
header "VPN Kill-Switch — MDM Leak Protection" header "VPN Kill-Switch — MDM Leak Protection"
if ! is_root; then if ! is_root; then
error_exit "VPN kill-switch needs sudo: sudo ./unleash vpn-kill" error_exit "VPN kill-switch needs sudo: sudo ./runaway vpn-kill"
fi fi
local vpn_if="" local vpn_if=""
@@ -15,7 +15,7 @@ vpn_kill_install() {
interfaces=$(ifconfig 2>/dev/null | grep -E "^utun[0-9]+:" | sed 's/:.*//' || true) interfaces=$(ifconfig 2>/dev/null | grep -E "^utun[0-9]+:" | sed 's/:.*//' || true)
if [ -z "$interfaces" ]; then if [ -z "$interfaces" ]; then
warn "No VPN interfaces detected" warn "No VPN interfaces detected"
info "You can specify manually: sudo ./unleash vpn-kill --interface utunX" info "You can specify manually: sudo ./runaway vpn-kill --interface utunX"
info "Common VPN interfaces: utun0-9 (WireGuard), utun10+ (OpenVPN), ppp0 (L2TP)" info "Common VPN interfaces: utun0-9 (WireGuard), utun10+ (OpenVPN), ppp0 (L2TP)"
else else
for iface in $interfaces; do for iface in $interfaces; do
@@ -33,16 +33,16 @@ vpn_kill_install() {
if [ -z "$vpn_if" ]; then if [ -z "$vpn_if" ]; then
warn "No active VPN detected. Installing kill-switch anyway (no default route)." warn "No active VPN detected. Installing kill-switch anyway (no default route)."
info "Usage: sudo ./unleash vpn-kill --interface utunX" info "Usage: sudo ./runaway vpn-kill --interface utunX"
return 1 return 1
fi fi
step "Installing pf rules for VPN kill-switch..." step "Installing pf rules for VPN kill-switch..."
local anchor_dir="/etc/pf.anchors/com.unleash" local anchor_dir="/etc/pf.anchors/com.runaway"
mkdir -p "$anchor_dir" mkdir -p "$anchor_dir"
cat > "$VPN_RULES_FILE" << RULES cat > "$VPN_RULES_FILE" << RULES
# Unleash VPN kill-switch # Runaway VPN kill-switch
# Only allow MDM traffic through VPN interface $vpn_if # Only allow MDM traffic through VPN interface $vpn_if
block drop out proto {tcp,udp} to {17.0.0.0/8, 17.128.0.0/10} block drop out proto {tcp,udp} to {17.0.0.0/8, 17.128.0.0/10}
pass out proto {tcp,udp} to {17.0.0.0/8, 17.128.0.0/10} no state pass out proto {tcp,udp} to {17.0.0.0/8, 17.128.0.0/10} no state
@@ -58,7 +58,7 @@ RULES
if grep -q "vpn-kill" "$pf_conf" 2>/dev/null; then if grep -q "vpn-kill" "$pf_conf" 2>/dev/null; then
info "pf.conf already has VPN kill-switch anchor" info "pf.conf already has VPN kill-switch anchor"
else else
printf '\n%s\n%s\n%s\n' "# Added by unleash — VPN kill-switch (prevents MDM leaks)" "$anchor_line" "$load_line" >> "$pf_conf" printf '\n%s\n%s\n%s\n' "# Added by runaway — VPN kill-switch (prevents MDM leaks)" "$anchor_line" "$load_line" >> "$pf_conf"
fi fi
if pfctl -e -f "$pf_conf" 2>/dev/null; then if pfctl -e -f "$pf_conf" 2>/dev/null; then
@@ -81,7 +81,7 @@ vpn_kill_remove() {
header "Remove VPN Kill-Switch" header "Remove VPN Kill-Switch"
if ! is_root; then if ! is_root; then
error_exit "Needs sudo: sudo ./unleash vpn-kill-remove" error_exit "Needs sudo: sudo ./runaway vpn-kill-remove"
fi fi
if [ -f "$VPN_RULES_FILE" ]; then if [ -f "$VPN_RULES_FILE" ]; then
@@ -91,7 +91,7 @@ vpn_kill_remove() {
local pf_conf="/etc/pf.conf" local pf_conf="/etc/pf.conf"
if [ -f "$pf_conf" ]; then if [ -f "$pf_conf" ]; then
sed -i '' '/# Added by unleash — VPN kill-switch/d' "$pf_conf" 2>/dev/null || true sed -i '' '/# Added by runaway — VPN kill-switch/d' "$pf_conf" 2>/dev/null || true
sed -i '' '/vpn-kill/d' "$pf_conf" 2>/dev/null || true sed -i '' '/vpn-kill/d' "$pf_conf" 2>/dev/null || true
success "pf.conf cleaned" success "pf.conf cleaned"
fi fi
+8 -8
View File
@@ -8,7 +8,7 @@ install_selective_block() {
step "Installing selective pf rules (block MDM only, allow Apple services)..." step "Installing selective pf rules (block MDM only, allow Apple services)..."
local anchor_dir="${root}/etc/pf.anchors" local anchor_dir="${root}/etc/pf.anchors"
local anchor_file="${anchor_dir}/com.unleash.selective" local anchor_file="${anchor_dir}/com.runaway.selective"
mkdir -p "$anchor_dir" mkdir -p "$anchor_dir"
: > "$anchor_file" : > "$anchor_file"
@@ -26,14 +26,14 @@ install_selective_block() {
success "Selective anchor written: $anchor_file" success "Selective anchor written: $anchor_file"
local pf_conf="${root}/etc/pf.conf" local pf_conf="${root}/etc/pf.conf"
local anchor_line="anchor \"com.unleash.selective\"" local anchor_line="anchor \"com.runaway.selective\""
local load_line="load anchor \"com.unleash.selective\" from \"${anchor_file}\"" local load_line="load anchor \"com.runaway.selective\" from \"${anchor_file}\""
if [ -f "$pf_conf" ]; then if [ -f "$pf_conf" ]; then
if grep -q "com.unleash.selective" "$pf_conf" 2>/dev/null; then if grep -q "com.runaway.selective" "$pf_conf" 2>/dev/null; then
info "pf.conf already has selective anchor" info "pf.conf already has selective anchor"
else else
printf '\n%s\n%s\n%s\n' "# Added by unleash — selective MDM block (iCloud-safe)" "$anchor_line" "$load_line" >> "$pf_conf" printf '\n%s\n%s\n%s\n' "# Added by runaway — selective MDM block (iCloud-safe)" "$anchor_line" "$load_line" >> "$pf_conf"
success "pf.conf updated with selective rules" success "pf.conf updated with selective rules"
fi fi
else else
@@ -45,7 +45,7 @@ dummynet-anchor "com.apple/*"
fwd-anchor "com.apple/*" fwd-anchor "com.apple/*"
anchor "com.apple/*" anchor "com.apple/*"
load anchor "com.apple" from "/etc/pf.anchors/com.apple" load anchor "com.apple" from "/etc/pf.anchors/com.apple"
# Added by unleash — selective MDM block (iCloud-safe) # Added by runaway — selective MDM block (iCloud-safe)
${anchor_line} ${anchor_line}
${load_line} ${load_line}
EOF EOF
@@ -67,7 +67,7 @@ restore_hosts_based_block() {
[ -n "$data_mount" ] && root="$data_mount" [ -n "$data_mount" ] && root="$data_mount"
local hosts="${root}/private/etc/hosts" local hosts="${root}/private/etc/hosts"
if [ -f "$hosts" ] && grep -q "Added by unleash" "$hosts" 2>/dev/null; then if [ -f "$hosts" ] && grep -q "Added by runaway" "$hosts" 2>/dev/null; then
info "unleash hosts entries intact" info "runaway hosts entries intact"
fi fi
} }
+20 -20
View File
@@ -54,10 +54,10 @@ show_cmd_help() {
discord-bot-status) echo "Check Discord bot status." ;; discord-bot-status) echo "Check Discord bot status." ;;
demo) echo "Simulated bypass flow (no changes)." ;; demo) echo "Simulated bypass flow (no changes)." ;;
update) echo "Self-update from GitHub releases." ;; update) echo "Self-update from GitHub releases." ;;
uninstall) echo "Remove all Unleash traces." ;; uninstall) echo "Remove all Runaway traces." ;;
reinstall) echo "Uninstall + clean install." ;; reinstall) echo "Uninstall + clean install." ;;
report) echo "Generate full status report (markdown or --json)." ;; report) echo "Generate full status report (markdown or --json)." ;;
config) echo "View/edit ~/.unleash.conf settings." ;; config) echo "View/edit ~/.runaway.conf settings." ;;
vpn-kill) echo "Install pf kill-switch (blocks MDM outside VPN)." ;; vpn-kill) echo "Install pf kill-switch (blocks MDM outside VPN)." ;;
vpn-kill-remove) echo "Remove VPN kill-switch." ;; vpn-kill-remove) echo "Remove VPN kill-switch." ;;
vpn-kill-status) echo "Check VPN kill-switch status." ;; vpn-kill-status) echo "Check VPN kill-switch status." ;;
@@ -69,7 +69,7 @@ show_cmd_help() {
show_help() { show_help() {
cat <<'HELP' cat <<'HELP'
Usage: ./unleash <command> [options] Usage: ./runaway <command> [options]
Bypass / suppress / monitor MDM enrollment on macOS. Bypass / suppress / monitor MDM enrollment on macOS.
@@ -127,9 +127,9 @@ Bypass / suppress / monitor MDM enrollment on macOS.
vpn-kill-status Check VPN kill-switch status vpn-kill-status Check VPN kill-switch status
Management: Management:
config View/edit persistent settings (~/.unleash.conf) config View/edit persistent settings (~/.runaway.conf)
update Self-update to the latest GitHub release update Self-update to the latest GitHub release
uninstall Remove all Unleash traces from the system uninstall Remove all Runaway traces from the system
reinstall Uninstall + reinstall (persist + whitelist + monitor) reinstall Uninstall + reinstall (persist + whitelist + monitor)
discord-bot Start Discord MDM alert bot discord-bot Start Discord MDM alert bot
discord-bot-stop Stop Discord bot discord-bot-stop Stop Discord bot
@@ -172,7 +172,7 @@ HELP
} }
cmd_version() { cmd_version() {
echo "unleash v$VERSION" echo "runaway v$VERSION"
exit 0 exit 0
} }
@@ -235,7 +235,7 @@ cmd_dualboot() {
return 0 return 0
fi fi
if ! is_root; then if ! is_root; then
error_exit "Dual-boot needs sudo: sudo ./unleash dualboot" error_exit "Dual-boot needs sudo: sudo ./runaway dualboot"
fi fi
header "Dual-Boot Mode" header "Dual-Boot Mode"
@@ -293,7 +293,7 @@ cmd_heal() {
heal_suppress "$data_mount" heal_suppress "$data_mount"
else else
if ! is_root; then if ! is_root; then
error_exit "Heal needs sudo: sudo ./unleash heal" error_exit "Heal needs sudo: sudo ./runaway heal"
fi fi
heal_suppress "" heal_suppress ""
fi fi
@@ -305,7 +305,7 @@ cmd_persist() {
data_mount=$(resolve_data_volume) data_mount=$(resolve_data_volume)
else else
if ! is_root; then if ! is_root; then
error_exit "Persistence needs sudo: sudo ./unleash persist" error_exit "Persistence needs sudo: sudo ./runaway persist"
fi fi
data_mount="" data_mount=""
fi fi
@@ -324,7 +324,7 @@ cmd_unpersist() {
cmd_firewall() { cmd_firewall() {
if ! is_root; then if ! is_root; then
error_exit "Firewall needs sudo: sudo ./unleash firewall" error_exit "Firewall needs sudo: sudo ./runaway firewall"
fi fi
if is_recovery; then if is_recovery; then
local data_mount local data_mount
@@ -337,7 +337,7 @@ cmd_firewall() {
cmd_firewall_off() { cmd_firewall_off() {
if ! is_root; then if ! is_root; then
error_exit "Needs sudo: sudo ./unleash firewall-off" error_exit "Needs sudo: sudo ./runaway firewall-off"
fi fi
if is_recovery; then if is_recovery; then
local data_mount local data_mount
@@ -350,7 +350,7 @@ cmd_firewall_off() {
cmd_harden() { cmd_harden() {
if ! is_root; then if ! is_root; then
error_exit "Hardening needs sudo: sudo ./unleash harden" error_exit "Hardening needs sudo: sudo ./runaway harden"
fi fi
if is_recovery; then if is_recovery; then
info "In Recovery — will skip live-OS checks" info "In Recovery — will skip live-OS checks"
@@ -360,14 +360,14 @@ cmd_harden() {
cmd_audit() { cmd_audit() {
if ! is_root; then if ! is_root; then
error_exit "Audit needs sudo: sudo ./unleash audit" error_exit "Audit needs sudo: sudo ./runaway audit"
fi fi
deep_status deep_status
} }
cmd_whitelist() { cmd_whitelist() {
if ! is_root; then if ! is_root; then
error_exit "Whitelist needs sudo: sudo ./unleash whitelist" error_exit "Whitelist needs sudo: sudo ./runaway whitelist"
fi fi
if is_recovery; then if is_recovery; then
local data_mount local data_mount
@@ -390,7 +390,7 @@ cmd_status() {
cmd_check() { cmd_check() {
if ! is_root; then if ! is_root; then
error_exit "Check needs sudo: sudo ./unleash check" error_exit "Check needs sudo: sudo ./runaway check"
fi fi
run_preformat_check run_preformat_check
echo "" echo ""
@@ -444,12 +444,12 @@ cmd_test() {
info "" info ""
info "Dry-run complete. No changes were made." info "Dry-run complete. No changes were made."
;; ;;
*) info "Usage: ./unleash test {bypass|suppress|heal|harden|firewall|whitelist|all}" ;; *) info "Usage: ./runaway test {bypass|suppress|heal|harden|firewall|whitelist|all}" ;;
esac esac
} }
cmd_interactive_recovery() { cmd_interactive_recovery() {
header "unleash" header "runaway"
local data_mount local data_mount
data_mount=$(resolve_data_volume) data_mount=$(resolve_data_volume)
@@ -530,9 +530,9 @@ cmd_interactive_recovery() {
} }
cmd_interactive_normal() { cmd_interactive_normal() {
header "unleash" header "runaway"
echo -e "${YEL}Not in Recovery. Limited options.${NC}" echo -e "${YEL}Not in Recovery. Limited options.${NC}"
echo " Try: sudo ./unleash heal | harden | audit | check | monitor" echo " Try: sudo ./runaway heal | harden | audit | check | monitor"
echo "" echo ""
PS3="Choose: " PS3="Choose: "
@@ -546,7 +546,7 @@ cmd_interactive_normal() {
case $opt in case $opt in
"Auto-heal") "Auto-heal")
if ! is_root; then if ! is_root; then
error_exit "Heal needs sudo. Run: sudo ./unleash" error_exit "Heal needs sudo. Run: sudo ./runaway"
fi fi
heal_suppress "" heal_suppress ""
;; ;;
+160 -160
View File
@@ -126,7 +126,7 @@ confirm() {
[[ "$response" =~ ^[Yy]$ ]] [[ "$response" =~ ^[Yy]$ ]]
} }
CONFIG_FILE="$HOME/.unleash.conf" CONFIG_FILE="$HOME/.runaway.conf"
load_config() { load_config() {
[ -f "$CONFIG_FILE" ] || return 0 [ -f "$CONFIG_FILE" ] || return 0
@@ -148,10 +148,10 @@ _rewrite_config() {
local tmp local tmp
[ -f "$CONFIG_FILE" ] || touch "$CONFIG_FILE" [ -f "$CONFIG_FILE" ] || touch "$CONFIG_FILE"
tmp=$(mktemp "${CONFIG_FILE}.XXXXXX") || return 1 tmp=$(mktemp "${CONFIG_FILE}.XXXXXX") || return 1
if ! UNLEASH_CONFIG_KEY="$key" UNLEASH_CONFIG_VALUE="$value" \ if ! RUNAWAY_CONFIG_KEY="$key" RUNAWAY_CONFIG_VALUE="$value" \
UNLEASH_CONFIG_OPERATION="${3:-set}" awk ' RUNAWAY_CONFIG_OPERATION="${3:-set}" awk '
BEGIN { key=ENVIRON["UNLEASH_CONFIG_KEY"]; value=ENVIRON["UNLEASH_CONFIG_VALUE"]; BEGIN { key=ENVIRON["RUNAWAY_CONFIG_KEY"]; value=ENVIRON["RUNAWAY_CONFIG_VALUE"];
operation=ENVIRON["UNLEASH_CONFIG_OPERATION"] } operation=ENVIRON["RUNAWAY_CONFIG_OPERATION"] }
index($0, key "=")==1 { if (!found++ && operation=="set") print key "=" value; next } index($0, key "=")==1 { if (!found++ && operation=="set") print key "=" value; next }
{ print } { print }
END { if (!found && operation=="set") print key "=" value } END { if (!found && operation=="set") print key "=" value }
@@ -184,7 +184,7 @@ cmd_config() {
local key="${3:-}" local key="${3:-}"
local value="${4:-}" local value="${4:-}"
[ -z "$key" ] || [ -z "$value" ] && { [ -z "$key" ] || [ -z "$value" ] && {
info "Usage: ./unleash config set KEY VALUE" info "Usage: ./runaway config set KEY VALUE"
info "Keys: WEBHOOK, LOG_LEVEL (verbose), LOG_FILE" info "Keys: WEBHOOK, LOG_LEVEL (verbose), LOG_FILE"
return 1 return 1
} }
@@ -192,14 +192,14 @@ cmd_config() {
;; ;;
unset) unset)
local key="${3:-}" local key="${3:-}"
[ -z "$key" ] && { info "Usage: ./unleash config unset KEY"; return 1; } [ -z "$key" ] && { info "Usage: ./runaway config unset KEY"; return 1; }
if [ -f "$CONFIG_FILE" ]; then if [ -f "$CONFIG_FILE" ]; then
_rewrite_config "$key" "" unset || return 1 _rewrite_config "$key" "" unset || return 1
success "Removed $key from config" success "Removed $key from config"
fi fi
;; ;;
*) *)
info "Usage: ./unleash config {show|set KEY VALUE|unset KEY}" info "Usage: ./runaway config {show|set KEY VALUE|unset KEY}"
;; ;;
esac esac
} }
@@ -454,7 +454,7 @@ _restore_rosetta_hosts() {
local hosts="$1" tmp_hosts local hosts="$1" tmp_hosts
tmp_hosts=$(mktemp "${hosts}.XXXXXX") || return 1 tmp_hosts=$(mktemp "${hosts}.XXXXXX") || return 1
if ! cp -p "$hosts" "$tmp_hosts" || ! awk ' if ! cp -p "$hosts" "$tmp_hosts" || ! awk '
$0=="# Added by unleash — DEP enrollment block" { owned=1; print; next } $0=="# Added by runaway — DEP enrollment block" { owned=1; print; next }
owned && /^(0[.]0[.]0[.]0|::)[[:space:]]+configuration[.]apple[.]com[[:space:]]*$/ { next } owned && /^(0[.]0[.]0[.]0|::)[[:space:]]+configuration[.]apple[.]com[[:space:]]*$/ { next }
owned && $0 !~ /^(0[.]0[.]0[.]0|::)[[:space:]]+[[:alnum:]_.-]+[[:space:]]*$/ { owned=0 } owned && $0 !~ /^(0[.]0[.]0[.]0|::)[[:space:]]+[[:alnum:]_.-]+[[:space:]]*$/ { owned=0 }
{ print } { print }
@@ -466,11 +466,11 @@ _restore_rosetta_hosts() {
rm -f "$tmp_hosts" rm -f "$tmp_hosts"
return 0 return 0
fi fi
if [ ! -e "$hosts.unleash-rosetta.bak" ]; then if [ ! -e "$hosts.runaway-rosetta.bak" ]; then
cp -p "$hosts" "$hosts.unleash-rosetta.bak" || { rm -f "$tmp_hosts"; return 1; } cp -p "$hosts" "$hosts.runaway-rosetta.bak" || { rm -f "$tmp_hosts"; return 1; }
fi fi
mv "$tmp_hosts" "$hosts" || { rm -f "$tmp_hosts"; return 1; } mv "$tmp_hosts" "$hosts" || { rm -f "$tmp_hosts"; return 1; }
info "Removed old Unleash Rosetta blocks; backup: $hosts.unleash-rosetta.bak" info "Removed old Runaway Rosetta blocks; backup: $hosts.runaway-rosetta.bak"
} }
suppress_enrollment() { suppress_enrollment() {
@@ -507,9 +507,9 @@ suppress_enrollment() {
step "Blocking enrollment domains (Data volume hosts)..." step "Blocking enrollment domains (Data volume hosts)..."
[ -f "$hosts" ] || { mkdir -p "$(dirname "$hosts")"; touch "$hosts"; } [ -f "$hosts" ] || { mkdir -p "$(dirname "$hosts")"; touch "$hosts"; }
_restore_rosetta_hosts "$hosts" || error_exit "Could not repair old Rosetta hosts blocks." _restore_rosetta_hosts "$hosts" || error_exit "Could not repair old Rosetta hosts blocks."
grep -q "Added by unleash" "$hosts" 2>/dev/null || { grep -q "Added by runaway" "$hosts" 2>/dev/null || {
echo "" >>"$hosts" echo "" >>"$hosts"
echo "# Added by unleash — DEP enrollment block" >>"$hosts" echo "# Added by runaway — DEP enrollment block" >>"$hosts"
} }
local domains=( local domains=(
@@ -719,7 +719,7 @@ full_bypass_mode() {
} }
BACKUP_DIR="$(dirname "$(dirname "$0")")/.unleash-backup" BACKUP_DIR="$(dirname "$(dirname "$0")")/.runaway-backup"
check_disk_space() { check_disk_space() {
local data_mount="$1" local data_mount="$1"
@@ -800,7 +800,7 @@ restore_state() {
success "launchd override restored" success "launchd override restored"
fi fi
sed -i '' '/# Added by unleash/d' "$data_mount/private/etc/hosts" 2>/dev/null || true sed -i '' '/# Added by runaway/d' "$data_mount/private/etc/hosts" 2>/dev/null || true
rm -f "$BACKUP_DIR/data_volume_path" "$BACKUP_DIR/timestamp" rm -f "$BACKUP_DIR/data_volume_path" "$BACKUP_DIR/timestamp"
success "Restore complete" success "Restore complete"
@@ -1136,13 +1136,13 @@ install_persist_launchdaemon() {
local root local root
root="$(_persist_mount_root "$data_mount")" root="$(_persist_mount_root "$data_mount")"
local unleash_src local runaway_src
unleash_src=$(_launchd_script_path) runaway_src=$(_launchd_script_path)
step "Installing LaunchDaemon for boot-time persistence..." step "Installing LaunchDaemon for boot-time persistence..."
local plist_dir="${root}/Library/LaunchDaemons" local plist_dir="${root}/Library/LaunchDaemons"
local plist_path="${plist_dir}/com.unleash.heal.plist" local plist_path="${plist_dir}/com.runaway.heal.plist"
mkdir -p "$plist_dir" mkdir -p "$plist_dir"
@@ -1152,11 +1152,11 @@ install_persist_launchdaemon() {
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>Label</key> <key>Label</key>
<string>com.unleash.heal</string> <string>com.runaway.heal</string>
<key>ProgramArguments</key> <key>ProgramArguments</key>
<array> <array>
<string>/bin/bash</string> <string>/bin/bash</string>
<string>${unleash_src}</string> <string>${runaway_src}</string>
<string>heal</string> <string>heal</string>
</array> </array>
<key>RunAtLoad</key> <key>RunAtLoad</key>
@@ -1168,9 +1168,9 @@ install_persist_launchdaemon() {
<key>KeepAlive</key> <key>KeepAlive</key>
<false/> <false/>
<key>StandardOutPath</key> <key>StandardOutPath</key>
<string>/var/log/unleash-heal.log</string> <string>/var/log/runaway-heal.log</string>
<key>StandardErrorPath</key> <key>StandardErrorPath</key>
<string>/var/log/unleash-heal.err</string> <string>/var/log/runaway-heal.err</string>
</dict> </dict>
</plist> </plist>
PLIST PLIST
@@ -1194,22 +1194,22 @@ remove_persist_launchdaemon() {
local data_mount="$1" local data_mount="$1"
local root local root
root="$(_persist_mount_root "$data_mount")" root="$(_persist_mount_root "$data_mount")"
local plist_path="${root}/Library/LaunchDaemons/com.unleash.heal.plist" local plist_path="${root}/Library/LaunchDaemons/com.runaway.heal.plist"
if [ -f "$plist_path" ]; then if [ -f "$plist_path" ]; then
step "Removing Unleash LaunchDaemon..." step "Removing Runaway LaunchDaemon..."
if command -v launchctl &>/dev/null; then if command -v launchctl &>/dev/null; then
launchctl unload "$plist_path" 2>/dev/null || true launchctl unload "$plist_path" 2>/dev/null || true
fi fi
rm -f "$plist_path" rm -f "$plist_path"
success "LaunchDaemon removed" success "LaunchDaemon removed"
else else
info "No Unleash LaunchDaemon installed" info "No Runaway LaunchDaemon installed"
fi fi
} }
FIREWALL_ANCHOR="com.unleash/mdm" FIREWALL_ANCHOR="com.runaway/mdm"
FIREWALL_CONF="/etc/pf.conf" FIREWALL_CONF="/etc/pf.conf"
FIREWALL_ANCHOR_DIR="/etc/pf.anchors" FIREWALL_ANCHOR_DIR="/etc/pf.anchors"
@@ -1246,7 +1246,7 @@ install_pf_mdm_block() {
mkdir -p "$anchor_dir" mkdir -p "$anchor_dir"
cat > "$anchor_file" << 'ANCHOR' cat > "$anchor_file" << 'ANCHOR'
# Unleash MDM block — Apple MDM infrastructure IP ranges # Runaway MDM block — Apple MDM infrastructure IP ranges
# These ranges host deviceenrollment.apple.com, mdmenrollment.apple.com, etc. # These ranges host deviceenrollment.apple.com, mdmenrollment.apple.com, etc.
# Blocking at pf level is immune to DNS-over-HTTPS bypass. # Blocking at pf level is immune to DNS-over-HTTPS bypass.
block drop out proto {tcp,udp} to {17.0.0.0/8} block drop out proto {tcp,udp} to {17.0.0.0/8}
@@ -1260,15 +1260,15 @@ ANCHOR
local load_line="load anchor \"${FIREWALL_ANCHOR}\" from \"${anchor_file}\"" local load_line="load anchor \"${FIREWALL_ANCHOR}\" from \"${anchor_file}\""
if [ -f "$pf_conf" ]; then if [ -f "$pf_conf" ]; then
if grep -q "com.unleash" "$pf_conf" 2>/dev/null; then if grep -q "com.runaway" "$pf_conf" 2>/dev/null; then
info "pf.conf already has Unleash anchor" info "pf.conf already has Runaway anchor"
else else
printf '\n%s\n%s\n%s\n' "# Added by unleash — MDM block" "$anchor_line" "$load_line" >> "$pf_conf" printf '\n%s\n%s\n%s\n' "# Added by runaway — MDM block" "$anchor_line" "$load_line" >> "$pf_conf"
success "pf.conf updated" success "pf.conf updated"
fi fi
else else
cat > "$pf_conf" <<- EOF cat > "$pf_conf" <<- EOF
# pf.conf — restored by unleash # pf.conf — restored by runaway
# #
# Default macOS pf.conf # Default macOS pf.conf
scrub-anchor "com.apple/*" scrub-anchor "com.apple/*"
@@ -1279,11 +1279,11 @@ ANCHOR
anchor "com.apple/*" anchor "com.apple/*"
load anchor "com.apple" from "/etc/pf.anchors/com.apple" load anchor "com.apple" from "/etc/pf.anchors/com.apple"
# Added by unleash — MDM block # Added by runaway — MDM block
${anchor_line} ${anchor_line}
${load_line} ${load_line}
EOF EOF
success "pf.conf created with Unleash anchor" success "pf.conf created with Runaway anchor"
fi fi
step "Loading pf rules..." step "Loading pf rules..."
@@ -1306,7 +1306,7 @@ remove_pf_mdm_block() {
local root="" local root=""
[ -n "$data_mount" ] && root="$data_mount" [ -n "$data_mount" ] && root="$data_mount"
step "Removing Unleash pf anchor..." step "Removing Runaway pf anchor..."
local anchor_file="${root}${FIREWALL_ANCHOR_DIR}/${FIREWALL_ANCHOR}" local anchor_file="${root}${FIREWALL_ANCHOR_DIR}/${FIREWALL_ANCHOR}"
if [ -f "$anchor_file" ]; then if [ -f "$anchor_file" ]; then
@@ -1320,7 +1320,7 @@ remove_pf_mdm_block() {
local tmp_conf local tmp_conf
tmp_conf=$(mktemp "${pf_conf}.XXXXXX") || return 1 tmp_conf=$(mktemp "${pf_conf}.XXXXXX") || return 1
if ! cp -p "$pf_conf" "$tmp_conf" \ if ! cp -p "$pf_conf" "$tmp_conf" \
|| ! sed '/# Added by unleash/d; /com\.unleash/d' "$pf_conf" > "$tmp_conf" \ || ! sed '/# Added by runaway/d; /com\.runaway/d' "$pf_conf" > "$tmp_conf" \
|| ! mv "$tmp_conf" "$pf_conf"; then || ! mv "$tmp_conf" "$pf_conf"; then
rm -f "$tmp_conf" rm -f "$tmp_conf"
return 1 return 1
@@ -1343,9 +1343,9 @@ pf_status() {
pfctl -si 2>/dev/null | grep -E "Status|Enabled" || echo " pf not enabled" pfctl -si 2>/dev/null | grep -E "Status|Enabled" || echo " pf not enabled"
echo "" echo ""
if pfctl -a "$FIREWALL_ANCHOR" -s rules 2>/dev/null; then if pfctl -a "$FIREWALL_ANCHOR" -s rules 2>/dev/null; then
info "Unleash MDM anchor rules:" info "Runaway MDM anchor rules:"
else else
info "No Unleash MDM anchor loaded" info "No Runaway MDM anchor loaded"
fi fi
else else
warn "pfctl not available" warn "pfctl not available"
@@ -1471,7 +1471,7 @@ install_selective_block() {
step "Installing selective pf rules (block MDM only, allow Apple services)..." step "Installing selective pf rules (block MDM only, allow Apple services)..."
local anchor_dir="${root}/etc/pf.anchors" local anchor_dir="${root}/etc/pf.anchors"
local anchor_file="${anchor_dir}/com.unleash.selective" local anchor_file="${anchor_dir}/com.runaway.selective"
mkdir -p "$anchor_dir" mkdir -p "$anchor_dir"
: > "$anchor_file" : > "$anchor_file"
@@ -1489,14 +1489,14 @@ install_selective_block() {
success "Selective anchor written: $anchor_file" success "Selective anchor written: $anchor_file"
local pf_conf="${root}/etc/pf.conf" local pf_conf="${root}/etc/pf.conf"
local anchor_line="anchor \"com.unleash.selective\"" local anchor_line="anchor \"com.runaway.selective\""
local load_line="load anchor \"com.unleash.selective\" from \"${anchor_file}\"" local load_line="load anchor \"com.runaway.selective\" from \"${anchor_file}\""
if [ -f "$pf_conf" ]; then if [ -f "$pf_conf" ]; then
if grep -q "com.unleash.selective" "$pf_conf" 2>/dev/null; then if grep -q "com.runaway.selective" "$pf_conf" 2>/dev/null; then
info "pf.conf already has selective anchor" info "pf.conf already has selective anchor"
else else
printf '\n%s\n%s\n%s\n' "# Added by unleash — selective MDM block (iCloud-safe)" "$anchor_line" "$load_line" >> "$pf_conf" printf '\n%s\n%s\n%s\n' "# Added by runaway — selective MDM block (iCloud-safe)" "$anchor_line" "$load_line" >> "$pf_conf"
success "pf.conf updated with selective rules" success "pf.conf updated with selective rules"
fi fi
else else
@@ -1508,7 +1508,7 @@ dummynet-anchor "com.apple/*"
fwd-anchor "com.apple/*" fwd-anchor "com.apple/*"
anchor "com.apple/*" anchor "com.apple/*"
load anchor "com.apple" from "/etc/pf.anchors/com.apple" load anchor "com.apple" from "/etc/pf.anchors/com.apple"
# Added by unleash — selective MDM block (iCloud-safe) # Added by runaway — selective MDM block (iCloud-safe)
${anchor_line} ${anchor_line}
${load_line} ${load_line}
EOF EOF
@@ -1530,8 +1530,8 @@ restore_hosts_based_block() {
[ -n "$data_mount" ] && root="$data_mount" [ -n "$data_mount" ] && root="$data_mount"
local hosts="${root}/private/etc/hosts" local hosts="${root}/private/etc/hosts"
if [ -f "$hosts" ] && grep -q "Added by unleash" "$hosts" 2>/dev/null; then if [ -f "$hosts" ] && grep -q "Added by runaway" "$hosts" 2>/dev/null; then
info "unleash hosts entries intact" info "runaway hosts entries intact"
fi fi
} }
@@ -1593,20 +1593,20 @@ run_preformat_check() {
step "Checking pf firewall status..." step "Checking pf firewall status..."
if command -v pfctl &>/dev/null; then if command -v pfctl &>/dev/null; then
if pfctl -a "com.unleash/mdm" -s rules 2>/dev/null | grep -q "block"; then if pfctl -a "com.runaway/mdm" -s rules 2>/dev/null | grep -q "block"; then
echo -e " ${GRN}Unleash pf firewall active${NC}" echo -e " ${GRN}Runaway pf firewall active${NC}"
else else
echo -e " ${YEL}No Unleash pf firewall rules${NC}" echo -e " ${YEL}No Runaway pf firewall rules${NC}"
fi fi
else else
echo -e " ${YEL}pfctl not available${NC}" echo -e " ${YEL}pfctl not available${NC}"
fi fi
step "Checking persistence LaunchDaemon..." step "Checking persistence LaunchDaemon..."
if [ -f "/Library/LaunchDaemons/com.unleash.heal.plist" ]; then if [ -f "/Library/LaunchDaemons/com.runaway.heal.plist" ]; then
echo -e " ${GRN}Unleash LaunchDaemon installed (auto-heal on boot)${NC}" echo -e " ${GRN}Runaway LaunchDaemon installed (auto-heal on boot)${NC}"
else else
echo -e " ${YEL}No Unleash LaunchDaemon${NC}" echo -e " ${YEL}No Runaway LaunchDaemon${NC}"
fi fi
echo "" echo ""
@@ -1615,12 +1615,12 @@ run_preformat_check() {
echo -e "${CYAN}║${NC} ${GRN}SAFE TO FORMAT${NC} — No MDM enrollment detected ${CYAN}║${NC}" echo -e "${CYAN}║${NC} ${GRN}SAFE TO FORMAT${NC} — No MDM enrollment detected ${CYAN}║${NC}"
echo -e "${CYAN}║${NC} This Mac should not lock after a wipe. ${CYAN}║${NC}" echo -e "${CYAN}║${NC} This Mac should not lock after a wipe. ${CYAN}║${NC}"
echo -e "${CYAN}║${NC} If you want defense-in-depth anyway, run: ${CYAN}║${NC}" echo -e "${CYAN}║${NC} If you want defense-in-depth anyway, run: ${CYAN}║${NC}"
echo -e "${CYAN}║${NC} ${YEL}sudo ./unleash persist && sudo ./unleash firewall${NC} ${CYAN}║${NC}" echo -e "${CYAN}║${NC} ${YEL}sudo ./runaway persist && sudo ./runaway firewall${NC} ${CYAN}║${NC}"
else else
echo -e "${CYAN}║${NC} ${RED}MDM DETECTED${NC} — This Mac WILL lock after format ${CYAN}║${NC}" echo -e "${CYAN}║${NC} ${RED}MDM DETECTED${NC} — This Mac WILL lock after format ${CYAN}║${NC}"
echo -e "${CYAN}║${NC} Run from Recovery after wipe: ${YEL}./unleash bypass${NC} ${CYAN}║${NC}" echo -e "${CYAN}║${NC} Run from Recovery after wipe: ${YEL}./runaway bypass${NC} ${CYAN}║${NC}"
echo -e "${CYAN}║${NC} To survive macOS updates (not full wipes): ${CYAN}║${NC}" echo -e "${CYAN}║${NC} To survive macOS updates (not full wipes): ${CYAN}║${NC}"
echo -e "${CYAN}║${NC} ${YEL}sudo ./unleash persist && sudo ./unleash firewall${NC} ${CYAN}║${NC}" echo -e "${CYAN}║${NC} ${YEL}sudo ./runaway persist && sudo ./runaway firewall${NC} ${CYAN}║${NC}"
fi fi
echo -e "${CYAN}╚══════════════════════════════════════════════════════════════╝${NC}" echo -e "${CYAN}╚══════════════════════════════════════════════════════════════╝${NC}"
} }
@@ -1631,19 +1631,19 @@ check_upgrade_safety() {
step "Checking if suppression will survive upgrade..." step "Checking if suppression will survive upgrade..."
local issues=0 local issues=0
if [ -f "/Library/LaunchDaemons/com.unleash.heal.plist" ]; then if [ -f "/Library/LaunchDaemons/com.runaway.heal.plist" ]; then
echo -e " ${GRN}Persistence installed — heal runs after reboot${NC}" echo -e " ${GRN}Persistence installed — heal runs after reboot${NC}"
else else
echo -e " ${RED}No persistence — upgrade may restore MDM${NC}" echo -e " ${RED}No persistence — upgrade may restore MDM${NC}"
echo -e " ${YEL}Fix: sudo ./unleash persist${NC}" echo -e " ${YEL}Fix: sudo ./runaway persist${NC}"
issues=$((issues + 1)) issues=$((issues + 1))
fi fi
if command -v pfctl &>/dev/null && pfctl -a "com.unleash/mdm" -s rules 2>/dev/null | grep -q "block"; then if command -v pfctl &>/dev/null && pfctl -a "com.runaway/mdm" -s rules 2>/dev/null | grep -q "block"; then
echo -e " ${GRN}pf firewall active — survives upgrade${NC}" echo -e " ${GRN}pf firewall active — survives upgrade${NC}"
else else
echo -e " ${YEL}No pf firewall — upgrade may restore MDM connectivity${NC}" echo -e " ${YEL}No pf firewall — upgrade may restore MDM connectivity${NC}"
echo -e " ${YEL}Fix: sudo ./unleash whitelist${NC}" echo -e " ${YEL}Fix: sudo ./runaway whitelist${NC}"
issues=$((issues + 1)) issues=$((issues + 1))
fi fi
@@ -1667,13 +1667,13 @@ install_monitor_launchdaemon() {
local root="" local root=""
[ -n "$data_mount" ] && root="$data_mount" [ -n "$data_mount" ] && root="$data_mount"
local unleash_src local runaway_src
unleash_src=$(_launchd_script_path) runaway_src=$(_launchd_script_path)
step "Installing monitor LaunchDaemon..." step "Installing monitor LaunchDaemon..."
local plist_dir="${root}/Library/LaunchDaemons" local plist_dir="${root}/Library/LaunchDaemons"
local plist_path="${plist_dir}/com.unleash.monitor.plist" local plist_path="${plist_dir}/com.runaway.monitor.plist"
mkdir -p "$plist_dir" mkdir -p "$plist_dir"
cat > "$plist_path" <<- PLIST cat > "$plist_path" <<- PLIST
@@ -1682,11 +1682,11 @@ install_monitor_launchdaemon() {
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>Label</key> <key>Label</key>
<string>com.unleash.monitor</string> <string>com.runaway.monitor</string>
<key>ProgramArguments</key> <key>ProgramArguments</key>
<array> <array>
<string>/bin/bash</string> <string>/bin/bash</string>
<string>${unleash_src}</string> <string>${runaway_src}</string>
<string>monitor</string> <string>monitor</string>
</array> </array>
<key>RunAtLoad</key> <key>RunAtLoad</key>
@@ -1696,9 +1696,9 @@ install_monitor_launchdaemon() {
<key>Nice</key> <key>Nice</key>
<integer>1</integer> <integer>1</integer>
<key>StandardOutPath</key> <key>StandardOutPath</key>
<string>/var/log/unleash-monitor.log</string> <string>/var/log/runaway-monitor.log</string>
<key>StandardErrorPath</key> <key>StandardErrorPath</key>
<string>/var/log/unleash-monitor.err</string> <string>/var/log/runaway-monitor.err</string>
</dict> </dict>
</plist> </plist>
PLIST PLIST
@@ -1719,7 +1719,7 @@ uninstall_monitor_launchdaemon() {
local data_mount="$1" local data_mount="$1"
local root="" local root=""
[ -n "$data_mount" ] && root="$data_mount" [ -n "$data_mount" ] && root="$data_mount"
local plist_path="${root}/Library/LaunchDaemons/com.unleash.monitor.plist" local plist_path="${root}/Library/LaunchDaemons/com.runaway.monitor.plist"
if [ -f "$plist_path" ]; then if [ -f "$plist_path" ]; then
step "Removing monitor LaunchDaemon..." step "Removing monitor LaunchDaemon..."
@@ -1737,16 +1737,16 @@ monitor_mdm() {
header "MDM Monitor (continuous)" header "MDM Monitor (continuous)"
if ! is_root; then if ! is_root; then
error_exit "Monitor requires sudo: sudo ./unleash monitor" error_exit "Monitor requires sudo: sudo ./runaway monitor"
fi fi
local logfile="/var/log/unleash-monitor.log" local logfile="/var/log/runaway-monitor.log"
local pidfile="/tmp/unleash-monitor.pid" local pidfile="/tmp/runaway-monitor.pid"
local webhook="${DISCORD_WEBHOOK:-}" local webhook="${DISCORD_WEBHOOK:-}"
if [ -f "$pidfile" ] && kill -0 "$(cat "$pidfile")" 2>/dev/null; then if [ -f "$pidfile" ] && kill -0 "$(cat "$pidfile")" 2>/dev/null; then
echo -e "${YEL}Monitor already running (PID $(cat "$pidfile"))${NC}" echo -e "${YEL}Monitor already running (PID $(cat "$pidfile"))${NC}"
echo -e "${YEL}Run 'sudo ./unleash monitor-stop' to stop it${NC}" echo -e "${YEL}Run 'sudo ./runaway monitor-stop' to stop it${NC}"
return 0 return 0
fi fi
@@ -1796,11 +1796,11 @@ monitor_mdm() {
if [ "$state" = "dirty" ] && [ $((now - last_notification)) -gt 3600 ]; then if [ "$state" = "dirty" ] && [ $((now - last_notification)) -gt 3600 ]; then
last_notification=$now last_notification=$now
if command -v osascript &>/dev/null; then if command -v osascript &>/dev/null; then
osascript -e "display notification \"$reason\" with title \"Unleash MDM Alert\" subtitle \"MDM enrollment detected\"" 2>/dev/null || true osascript -e "display notification \"$reason\" with title \"Runaway MDM Alert\" subtitle \"MDM enrollment detected\"" 2>/dev/null || true
fi fi
if [ -n "$webhook" ]; then if [ -n "$webhook" ]; then
local payload local payload
payload=$(printf '{"content":"🚨 **Unleash Alert** — MDM enrollment detected: %s","username":"Unleash Monitor"}' "$reason") payload=$(printf '{"content":"🚨 **Runaway Alert** — MDM enrollment detected: %s","username":"Runaway Monitor"}' "$reason")
curl -s -H "Content-Type: application/json" -d "$payload" "$webhook" 2>/dev/null || warn "Webhook failed" curl -s -H "Content-Type: application/json" -d "$payload" "$webhook" 2>/dev/null || warn "Webhook failed"
fi fi
heal_suppress "" heal_suppress ""
@@ -1816,11 +1816,11 @@ monitor_mdm() {
if [ "$consecutive_failures" -ge 12 ]; then if [ "$consecutive_failures" -ge 12 ]; then
echo "$(date) CRITICAL: 12 consecutive dirty checks" >> "$logfile" echo "$(date) CRITICAL: 12 consecutive dirty checks" >> "$logfile"
if command -v osascript &>/dev/null; then if command -v osascript &>/dev/null; then
osascript -e "display dialog \"MDM keeps coming back after 12 attempts. Something is persistently re-enrolling.\" with title \"Unleash\" buttons {\"OK\"} default button \"OK\"" 2>/dev/null || true osascript -e "display dialog \"MDM keeps coming back after 12 attempts. Something is persistently re-enrolling.\" with title \"Runaway\" buttons {\"OK\"} default button \"OK\"" 2>/dev/null || true
fi fi
if [ -n "$webhook" ]; then if [ -n "$webhook" ]; then
curl -s -H "Content-Type: application/json" \ curl -s -H "Content-Type: application/json" \
-d '{"content":"🚨 **Unleash CRITICAL** — 12 consecutive MDM detections. Persistent re-enrollment detected.","username":"Unleash Monitor"}' \ -d '{"content":"🚨 **Runaway CRITICAL** — 12 consecutive MDM detections. Persistent re-enrollment detected.","username":"Runaway Monitor"}' \
"$webhook" 2>/dev/null || true "$webhook" 2>/dev/null || true
fi fi
consecutive_failures=0 consecutive_failures=0
@@ -1832,7 +1832,7 @@ monitor_mdm() {
} }
stop_monitor() { stop_monitor() {
local pidfile="${1:-/tmp/unleash-monitor.pid}" local pidfile="${1:-/tmp/runaway-monitor.pid}"
if [ -f "$pidfile" ]; then if [ -f "$pidfile" ]; then
local pid local pid
pid=$(cat "$pidfile") pid=$(cat "$pidfile")
@@ -1849,20 +1849,20 @@ stop_monitor() {
} }
monitor_status() { monitor_status() {
local pidfile="${1:-/tmp/unleash-monitor.pid}" local pidfile="${1:-/tmp/runaway-monitor.pid}"
if [ -f "$pidfile" ] && kill -0 "$(cat "$pidfile")" 2>/dev/null; then if [ -f "$pidfile" ] && kill -0 "$(cat "$pidfile")" 2>/dev/null; then
echo -e "${GRN}Monitor running (PID $(cat "$pidfile"))${NC}" echo -e "${GRN}Monitor running (PID $(cat "$pidfile"))${NC}"
tail -5 /var/log/unleash-monitor.log 2>/dev/null || echo " (no log entries yet)" tail -5 /var/log/runaway-monitor.log 2>/dev/null || echo " (no log entries yet)"
else else
echo -e "${YEL}Monitor not running${NC}" echo -e "${YEL}Monitor not running${NC}"
fi fi
} }
show_history() { show_history() {
header "Unleash Event History" header "Runaway Event History"
local log_dir="${1:-/var/log}" local log_dir="${1:-/var/log}"
local logs=("$log_dir/unleash-monitor.log" "$log_dir/unleash-heal.log" "$log_dir/unleash-monitor.err") local logs=("$log_dir/runaway-monitor.log" "$log_dir/runaway-heal.log" "$log_dir/runaway-monitor.err")
local found=false local found=false
for logfile in "${logs[@]}"; do for logfile in "${logs[@]}"; do
@@ -1880,11 +1880,11 @@ show_history() {
if [ "$found" = false ]; then if [ "$found" = false ]; then
info "No event logs found." info "No event logs found."
info "Run 'sudo ./unleash monitor' or 'sudo ./unleash persist' first." info "Run 'sudo ./runaway monitor' or 'sudo ./runaway persist' first."
fi fi
step "Backup records" step "Backup records"
local backup_dir=".unleash-backup" local backup_dir=".runaway-backup"
if [ -d "$backup_dir" ] && [ -f "$backup_dir/timestamp" ]; then if [ -d "$backup_dir" ] && [ -f "$backup_dir/timestamp" ]; then
local ts local ts
ts=$(cat "$backup_dir/timestamp") ts=$(cat "$backup_dir/timestamp")
@@ -1896,7 +1896,7 @@ show_history() {
clear_history() { clear_history() {
local log_dir="${1:-/var/log}" local log_dir="${1:-/var/log}"
local logs=("$log_dir/unleash-monitor.log" "$log_dir/unleash-heal.log" "$log_dir/unleash-monitor.err") local logs=("$log_dir/runaway-monitor.log" "$log_dir/runaway-heal.log" "$log_dir/runaway-monitor.err")
for logfile in "${logs[@]}"; do for logfile in "${logs[@]}"; do
if [ -f "$logfile" ]; then if [ -f "$logfile" ]; then
: > "$logfile" : > "$logfile"
@@ -1954,7 +1954,7 @@ _network_diagnostics() {
run_doctor() { run_doctor() {
if [ "${1:-}" = --network ]; then _network_diagnostics; return; fi if [ "${1:-}" = --network ]; then _network_diagnostics; return; fi
header "Unleash Doctor — Pre-Flight Check" header "Runaway Doctor — Pre-Flight Check"
local errors=0 warnings=0 local errors=0 warnings=0
@@ -2057,22 +2057,22 @@ run_doctor() {
echo "" echo ""
step "Persistence status" step "Persistence status"
if [ -f "/Library/LaunchDaemons/com.unleash.heal.plist" ]; then if [ -f "/Library/LaunchDaemons/com.runaway.heal.plist" ]; then
echo " heal LaunchDaemon: installed" echo " heal LaunchDaemon: installed"
else else
echo " heal LaunchDaemon: not installed" echo " heal LaunchDaemon: not installed"
fi fi
if [ -f "/Library/LaunchDaemons/com.unleash.monitor.plist" ]; then if [ -f "/Library/LaunchDaemons/com.runaway.monitor.plist" ]; then
echo " monitor LaunchDaemon: installed" echo " monitor LaunchDaemon: installed"
else else
echo " monitor LaunchDaemon: not installed" echo " monitor LaunchDaemon: not installed"
fi fi
if [ -f "/etc/pf.anchors/com.unleash/mdm" ]; then if [ -f "/etc/pf.anchors/com.runaway/mdm" ]; then
echo " pf firewall anchor: installed" echo " pf firewall anchor: installed"
else else
echo " pf firewall anchor: not installed" echo " pf firewall anchor: not installed"
fi fi
if [ -f "/etc/pf.anchors/com.unleash.selective" ]; then if [ -f "/etc/pf.anchors/com.runaway.selective" ]; then
echo " pf selective anchor: installed" echo " pf selective anchor: installed"
else else
echo " pf selective anchor: not installed" echo " pf selective anchor: not installed"
@@ -2090,7 +2090,7 @@ run_doctor() {
echo -e "${CYAN}╚══════════════════════════════════════╝${NC}" echo -e "${CYAN}╚══════════════════════════════════════╝${NC}"
} }
GPG_KEY_URL="https://raw.githubusercontent.com/mateussiqueira/unleash/main/.github/unleash.gpg" GPG_KEY_URL="https://raw.githubusercontent.com/mateussiqueira/runaway/main/.github/runaway.gpg"
import_gpg_key() { import_gpg_key() {
local tmp_key local tmp_key
@@ -2122,13 +2122,13 @@ verify_gpg_signature() {
} }
do_self_update() { do_self_update() {
header "Unleash Update" header "Runaway Update"
if ! command -v curl &>/dev/null; then if ! command -v curl &>/dev/null; then
error_exit "curl required for update" error_exit "curl required for update"
fi fi
local repo="mateussiqueira/unleash" local repo="mateussiqueira/runaway"
local api_url="https://api.github.com/repos/${repo}/releases/latest" local api_url="https://api.github.com/repos/${repo}/releases/latest"
local tmp_dir local tmp_dir
tmp_dir=$(mktemp -d) tmp_dir=$(mktemp -d)
@@ -2154,11 +2154,11 @@ do_self_update() {
info "Updating from v$VERSION to v$latest_tag..." info "Updating from v$VERSION to v$latest_tag..."
begin "Downloading latest unleash" begin "Downloading latest runaway"
local dl_url="https://raw.githubusercontent.com/${repo}/main/unleash" local dl_url="https://raw.githubusercontent.com/${repo}/main/runaway"
local sig_url="${dl_url}.sig" local sig_url="${dl_url}.sig"
local tmp="$tmp_dir/unleash" local tmp="$tmp_dir/runaway"
local sig_tmp="$tmp_dir/unleash.sig" local sig_tmp="$tmp_dir/runaway.sig"
if curl -sL "$dl_url" -o "$tmp" && [ -s "$tmp" ]; then if curl -sL "$dl_url" -o "$tmp" && [ -s "$tmp" ]; then
curl -sL "$sig_url" -o "$sig_tmp" 2>/dev/null || true curl -sL "$sig_url" -o "$sig_tmp" 2>/dev/null || true
end_ok end_ok
@@ -2179,7 +2179,7 @@ do_self_update() {
end_fail; error_exit "Downloaded script has syntax errors" end_fail; error_exit "Downloaded script has syntax errors"
fi fi
local target="${0:-unleash}" local target="${0:-runaway}"
if [ ! -w "$target" ]; then if [ ! -w "$target" ]; then
info "$target not writable, trying sudo..." info "$target not writable, trying sudo..."
cp "$tmp" "$target" 2>/dev/null || sudo cp "$tmp" "$target" 2>/dev/null || { cp "$tmp" "$target" 2>/dev/null || sudo cp "$tmp" "$target" 2>/dev/null || {
@@ -2196,14 +2196,14 @@ do_self_update() {
} }
do_uninstall() { do_uninstall() {
header "Unleash — Full Uninstall" header "Runaway — Full Uninstall"
if ! is_root; then if ! is_root; then
error_exit "Uninstall needs sudo: sudo ./unleash uninstall" error_exit "Uninstall needs sudo: sudo ./runaway uninstall"
fi fi
begin "Removing heal LaunchDaemon" begin "Removing heal LaunchDaemon"
local plist="/Library/LaunchDaemons/com.unleash.heal.plist" local plist="/Library/LaunchDaemons/com.runaway.heal.plist"
if [ -f "$plist" ]; then if [ -f "$plist" ]; then
launchctl unload "$plist" 2>/dev/null || true launchctl unload "$plist" 2>/dev/null || true
rm -f "$plist" rm -f "$plist"
@@ -2213,7 +2213,7 @@ do_uninstall() {
fi fi
begin "Removing monitor LaunchDaemon" begin "Removing monitor LaunchDaemon"
plist="/Library/LaunchDaemons/com.unleash.monitor.plist" plist="/Library/LaunchDaemons/com.runaway.monitor.plist"
if [ -f "$plist" ]; then if [ -f "$plist" ]; then
launchctl unload "$plist" 2>/dev/null || true launchctl unload "$plist" 2>/dev/null || true
rm -f "$plist" rm -f "$plist"
@@ -2223,17 +2223,17 @@ do_uninstall() {
fi fi
begin "Cleaning pf anchors" begin "Cleaning pf anchors"
local anchors=("/etc/pf.anchors/com.unleash/mdm" "/etc/pf.anchors/com.unleash.selective") local anchors=("/etc/pf.anchors/com.runaway/mdm" "/etc/pf.anchors/com.runaway.selective")
for a in "${anchors[@]}"; do for a in "${anchors[@]}"; do
[ -f "$a" ] && rm -f "$a" [ -f "$a" ] && rm -f "$a"
done done
for anchor_name in "com.unleash/mdm" "com.unleash.selective"; do for anchor_name in "com.runaway/mdm" "com.runaway.selective"; do
pfctl -a "$anchor_name" -F all 2>/dev/null || true pfctl -a "$anchor_name" -F all 2>/dev/null || true
done done
local pf_conf="/etc/pf.conf" local pf_conf="/etc/pf.conf"
if [ -f "$pf_conf" ]; then if [ -f "$pf_conf" ]; then
sed -i '' '/# Added by unleash/d' "$pf_conf" 2>/dev/null || true sed -i '' '/# Added by runaway/d' "$pf_conf" 2>/dev/null || true
sed -i '' '/com\.unleash/d' "$pf_conf" 2>/dev/null || true sed -i '' '/com\.runaway/d' "$pf_conf" 2>/dev/null || true
fi fi
pfctl -f /etc/pf.conf 2>/dev/null || true pfctl -f /etc/pf.conf 2>/dev/null || true
end_ok end_ok
@@ -2241,7 +2241,7 @@ do_uninstall() {
begin "Cleaning hosts entries" begin "Cleaning hosts entries"
local hosts="/private/etc/hosts" local hosts="/private/etc/hosts"
if [ -f "$hosts" ]; then if [ -f "$hosts" ]; then
sed -i '' '/# Added by unleash/d' "$hosts" 2>/dev/null || true sed -i '' '/# Added by runaway/d' "$hosts" 2>/dev/null || true
local domains=("iprofiles.apple.com" "deviceenrollment.apple.com" "mdmenrollment.apple.com") local domains=("iprofiles.apple.com" "deviceenrollment.apple.com" "mdmenrollment.apple.com")
for d in "${domains[@]}"; do for d in "${domains[@]}"; do
sed -i '' "/[[:space:]]$d/d" "$hosts" 2>/dev/null || true sed -i '' "/[[:space:]]$d/d" "$hosts" 2>/dev/null || true
@@ -2265,7 +2265,7 @@ do_uninstall() {
fi fi
begin "Removing backup directory" begin "Removing backup directory"
local backup=".unleash-backup" local backup=".runaway-backup"
if [ -d "$backup" ]; then if [ -d "$backup" ]; then
rm -rf "$backup" 2>/dev/null || true rm -rf "$backup" 2>/dev/null || true
end_ok end_ok
@@ -2274,15 +2274,15 @@ do_uninstall() {
fi fi
begin "Removing config file" begin "Removing config file"
if [ -f "$HOME/.unleash.conf" ]; then if [ -f "$HOME/.runaway.conf" ]; then
rm -f "$HOME/.unleash.conf" rm -f "$HOME/.runaway.conf"
end_ok end_ok
else else
end_fail; echo " Not found" end_fail; echo " Not found"
fi fi
begin "Stopping monitor if running" begin "Stopping monitor if running"
local pidfile="/tmp/unleash-monitor.pid" local pidfile="/tmp/runaway-monitor.pid"
if [ -f "$pidfile" ]; then if [ -f "$pidfile" ]; then
kill "$(cat "$pidfile")" 2>/dev/null || true kill "$(cat "$pidfile")" 2>/dev/null || true
rm -f "$pidfile" rm -f "$pidfile"
@@ -2294,7 +2294,7 @@ do_uninstall() {
echo "" echo ""
success "Uninstall complete" success "Uninstall complete"
info "Your system is back to its original state." info "Your system is back to its original state."
info "The unleash script itself was not removed." info "The runaway script itself was not removed."
} }
generate_report() { generate_report() {
@@ -2302,7 +2302,7 @@ generate_report() {
generate_report_json generate_report_json
return return
fi fi
header "Unleash System Report" header "Runaway System Report"
local ts local ts
ts=$(date '+%Y-%m-%d %H:%M:%S') ts=$(date '+%Y-%m-%d %H:%M:%S')
@@ -2345,29 +2345,29 @@ generate_report() {
if command -v pfctl &>/dev/null; then if command -v pfctl &>/dev/null; then
pfctl -si 2>/dev/null | grep -E "Status|Enabled" || echo " pf not enabled" pfctl -si 2>/dev/null | grep -E "Status|Enabled" || echo " pf not enabled"
echo "" echo ""
pfctl -a "com.unleash/mdm" -s rules 2>/dev/null \ pfctl -a "com.runaway/mdm" -s rules 2>/dev/null \
&& echo " Unleash MDM anchor: active" \ && echo " Runaway MDM anchor: active" \
|| echo " Unleash MDM anchor: not loaded" || echo " Runaway MDM anchor: not loaded"
pfctl -a "com.unleash.selective" -s rules 2>/dev/null \ pfctl -a "com.runaway.selective" -s rules 2>/dev/null \
&& echo " Unleash selective anchor: active" \ && echo " Runaway selective anchor: active" \
|| echo " Unleash selective anchor: not loaded" || echo " Runaway selective anchor: not loaded"
fi fi
echo "" echo ""
step "Persistence" step "Persistence"
[ -f "/Library/LaunchDaemons/com.unleash.heal.plist" ] \ [ -f "/Library/LaunchDaemons/com.runaway.heal.plist" ] \
&& echo " heal LaunchDaemon: installed" \ && echo " heal LaunchDaemon: installed" \
|| echo " heal LaunchDaemon: not installed" || echo " heal LaunchDaemon: not installed"
[ -f "/Library/LaunchDaemons/com.unleash.monitor.plist" ] \ [ -f "/Library/LaunchDaemons/com.runaway.monitor.plist" ] \
&& echo " monitor LaunchDaemon: installed" \ && echo " monitor LaunchDaemon: installed" \
|| echo " monitor LaunchDaemon: not installed" || echo " monitor LaunchDaemon: not installed"
[ -f "/tmp/unleash-monitor.pid" ] \ [ -f "/tmp/runaway-monitor.pid" ] \
&& echo " monitor process: running" \ && echo " monitor process: running" \
|| echo " monitor process: not running" || echo " monitor process: not running"
echo "" echo ""
step "Recent Events" step "Recent Events"
for logfile in /var/log/unleash-monitor.log /var/log/unleash-heal.log; do for logfile in /var/log/runaway-monitor.log /var/log/runaway-heal.log; do
if [ -f "$logfile" ] && [ -s "$logfile" ]; then if [ -f "$logfile" ] && [ -s "$logfile" ]; then
echo " From $(basename "$logfile"):" echo " From $(basename "$logfile"):"
tail -3 "$logfile" | sed 's/^/ /' tail -3 "$logfile" | sed 's/^/ /'
@@ -2424,11 +2424,11 @@ generate_report_json() {
report="${report} \"installed_profiles\": $profile_count,\n" report="${report} \"installed_profiles\": $profile_count,\n"
local heal_installed="false" local heal_installed="false"
[ -f "/Library/LaunchDaemons/com.unleash.heal.plist" ] && heal_installed="true" [ -f "/Library/LaunchDaemons/com.runaway.heal.plist" ] && heal_installed="true"
local monitor_installed="false" local monitor_installed="false"
[ -f "/Library/LaunchDaemons/com.unleash.monitor.plist" ] && monitor_installed="true" [ -f "/Library/LaunchDaemons/com.runaway.monitor.plist" ] && monitor_installed="true"
local monitor_running="false" local monitor_running="false"
[ -f "/tmp/unleash-monitor.pid" ] && monitor_running="true" [ -f "/tmp/runaway-monitor.pid" ] && monitor_running="true"
report="${report} \"persistence\": {\n" report="${report} \"persistence\": {\n"
report="${report} \"heal_launchdaemon\": $heal_installed,\n" report="${report} \"heal_launchdaemon\": $heal_installed,\n"
report="${report} \"monitor_launchdaemon\": $monitor_installed,\n" report="${report} \"monitor_launchdaemon\": $monitor_installed,\n"
@@ -2436,11 +2436,11 @@ generate_report_json() {
report="${report} },\n" report="${report} },\n"
local fw_active="false" local fw_active="false"
if command -v pfctl &>/dev/null && pfctl -a "com.unleash/mdm" -s rules 2>/dev/null | grep -q "block"; then if command -v pfctl &>/dev/null && pfctl -a "com.runaway/mdm" -s rules 2>/dev/null | grep -q "block"; then
fw_active="true" fw_active="true"
fi fi
local selective_active="false" local selective_active="false"
if command -v pfctl &>/dev/null && pfctl -a "com.unleash.selective" -s rules 2>/dev/null | grep -q "block"; then if command -v pfctl &>/dev/null && pfctl -a "com.runaway.selective" -s rules 2>/dev/null | grep -q "block"; then
selective_active="true" selective_active="true"
fi fi
report="${report} \"firewall\": {\n" report="${report} \"firewall\": {\n"
@@ -2516,7 +2516,7 @@ detect_configurator_enrollment() {
return 0 return 0
else else
echo "" echo ""
echo -e "${YEL}Fix: re-run bypass from Recovery, then run 'sudo ./unleash harden'${NC}" echo -e "${YEL}Fix: re-run bypass from Recovery, then run 'sudo ./runaway harden'${NC}"
return 1 return 1
fi fi
} }
@@ -2604,7 +2604,7 @@ detect_migration_assistant() {
echo -e "$details" | sed '/^$/d' echo -e "$details" | sed '/^$/d'
echo "" echo ""
echo -e "${YEL}These user-level artifacts can re-enable MDM on every login.${NC}" echo -e "${YEL}These user-level artifacts can re-enable MDM on every login.${NC}"
echo -e "${YEL}Fix: run 'sudo ./unleash harden' or './unleash suppress' from Recovery.${NC}" echo -e "${YEL}Fix: run 'sudo ./runaway harden' or './runaway suppress' from Recovery.${NC}"
return 1 return 1
else else
echo -e "${GRN}✓ No Migration Assistant artifacts found${NC}" echo -e "${GRN}✓ No Migration Assistant artifacts found${NC}"
@@ -2636,7 +2636,7 @@ clean_ma_artifacts() {
} }
run_demo() { run_demo() {
header "Unleash Demo — Simulated MDM Bypass" header "Runaway Demo — Simulated MDM Bypass"
local demo_dir local demo_dir
demo_dir=$(mktemp -d) demo_dir=$(mktemp -d)
@@ -2716,18 +2716,18 @@ run_demo() {
echo -e "${CYAN}╔═══════════════════════════════════════════════╗${NC}" echo -e "${CYAN}╔═══════════════════════════════════════════════╗${NC}"
echo -e "${CYAN}║${NC} ${GRN}Demo Complete${NC} ${CYAN}║${NC}" echo -e "${CYAN}║${NC} ${GRN}Demo Complete${NC} ${CYAN}║${NC}"
echo -e "${CYAN}║${NC} Commands used: suppress, heal ${CYAN}║${NC}" echo -e "${CYAN}║${NC} Commands used: suppress, heal ${CYAN}║${NC}"
echo -e "${CYAN}║${NC} Try: ${YEL}sudo ./unleash doctor${NC} for real diagnostics ${CYAN}║${NC}" echo -e "${CYAN}║${NC} Try: ${YEL}sudo ./runaway doctor${NC} for real diagnostics ${CYAN}║${NC}"
echo -e "${CYAN}╚═══════════════════════════════════════════════╝${NC}" echo -e "${CYAN}╚═══════════════════════════════════════════════╝${NC}"
} }
VPN_RULES_ANCHOR="com.unleash/vpn-kill" VPN_RULES_ANCHOR="com.runaway/vpn-kill"
VPN_RULES_FILE="/etc/pf.anchors/com.unleash/vpn-kill" VPN_RULES_FILE="/etc/pf.anchors/com.runaway/vpn-kill"
vpn_kill_install() { vpn_kill_install() {
header "VPN Kill-Switch — MDM Leak Protection" header "VPN Kill-Switch — MDM Leak Protection"
if ! is_root; then if ! is_root; then
error_exit "VPN kill-switch needs sudo: sudo ./unleash vpn-kill" error_exit "VPN kill-switch needs sudo: sudo ./runaway vpn-kill"
fi fi
local vpn_if="" local vpn_if=""
@@ -2737,7 +2737,7 @@ vpn_kill_install() {
interfaces=$(ifconfig 2>/dev/null | grep -E "^utun[0-9]+:" | sed 's/:.*//' || true) interfaces=$(ifconfig 2>/dev/null | grep -E "^utun[0-9]+:" | sed 's/:.*//' || true)
if [ -z "$interfaces" ]; then if [ -z "$interfaces" ]; then
warn "No VPN interfaces detected" warn "No VPN interfaces detected"
info "You can specify manually: sudo ./unleash vpn-kill --interface utunX" info "You can specify manually: sudo ./runaway vpn-kill --interface utunX"
info "Common VPN interfaces: utun0-9 (WireGuard), utun10+ (OpenVPN), ppp0 (L2TP)" info "Common VPN interfaces: utun0-9 (WireGuard), utun10+ (OpenVPN), ppp0 (L2TP)"
else else
for iface in $interfaces; do for iface in $interfaces; do
@@ -2755,16 +2755,16 @@ vpn_kill_install() {
if [ -z "$vpn_if" ]; then if [ -z "$vpn_if" ]; then
warn "No active VPN detected. Installing kill-switch anyway (no default route)." warn "No active VPN detected. Installing kill-switch anyway (no default route)."
info "Usage: sudo ./unleash vpn-kill --interface utunX" info "Usage: sudo ./runaway vpn-kill --interface utunX"
return 1 return 1
fi fi
step "Installing pf rules for VPN kill-switch..." step "Installing pf rules for VPN kill-switch..."
local anchor_dir="/etc/pf.anchors/com.unleash" local anchor_dir="/etc/pf.anchors/com.runaway"
mkdir -p "$anchor_dir" mkdir -p "$anchor_dir"
cat > "$VPN_RULES_FILE" << RULES cat > "$VPN_RULES_FILE" << RULES
# Unleash VPN kill-switch # Runaway VPN kill-switch
# Only allow MDM traffic through VPN interface $vpn_if # Only allow MDM traffic through VPN interface $vpn_if
block drop out proto {tcp,udp} to {17.0.0.0/8, 17.128.0.0/10} block drop out proto {tcp,udp} to {17.0.0.0/8, 17.128.0.0/10}
pass out proto {tcp,udp} to {17.0.0.0/8, 17.128.0.0/10} no state pass out proto {tcp,udp} to {17.0.0.0/8, 17.128.0.0/10} no state
@@ -2780,7 +2780,7 @@ RULES
if grep -q "vpn-kill" "$pf_conf" 2>/dev/null; then if grep -q "vpn-kill" "$pf_conf" 2>/dev/null; then
info "pf.conf already has VPN kill-switch anchor" info "pf.conf already has VPN kill-switch anchor"
else else
printf '\n%s\n%s\n%s\n' "# Added by unleash — VPN kill-switch (prevents MDM leaks)" "$anchor_line" "$load_line" >> "$pf_conf" printf '\n%s\n%s\n%s\n' "# Added by runaway — VPN kill-switch (prevents MDM leaks)" "$anchor_line" "$load_line" >> "$pf_conf"
fi fi
if pfctl -e -f "$pf_conf" 2>/dev/null; then if pfctl -e -f "$pf_conf" 2>/dev/null; then
@@ -2803,7 +2803,7 @@ vpn_kill_remove() {
header "Remove VPN Kill-Switch" header "Remove VPN Kill-Switch"
if ! is_root; then if ! is_root; then
error_exit "Needs sudo: sudo ./unleash vpn-kill-remove" error_exit "Needs sudo: sudo ./runaway vpn-kill-remove"
fi fi
if [ -f "$VPN_RULES_FILE" ]; then if [ -f "$VPN_RULES_FILE" ]; then
@@ -2813,7 +2813,7 @@ vpn_kill_remove() {
local pf_conf="/etc/pf.conf" local pf_conf="/etc/pf.conf"
if [ -f "$pf_conf" ]; then if [ -f "$pf_conf" ]; then
sed -i '' '/# Added by unleash — VPN kill-switch/d' "$pf_conf" 2>/dev/null || true sed -i '' '/# Added by runaway — VPN kill-switch/d' "$pf_conf" 2>/dev/null || true
sed -i '' '/vpn-kill/d' "$pf_conf" 2>/dev/null || true sed -i '' '/vpn-kill/d' "$pf_conf" 2>/dev/null || true
success "pf.conf cleaned" success "pf.conf cleaned"
fi fi
@@ -2875,10 +2875,10 @@ show_cmd_help() {
discord-bot-status) echo "Check Discord bot status." ;; discord-bot-status) echo "Check Discord bot status." ;;
demo) echo "Simulated bypass flow (no changes)." ;; demo) echo "Simulated bypass flow (no changes)." ;;
update) echo "Self-update from GitHub releases." ;; update) echo "Self-update from GitHub releases." ;;
uninstall) echo "Remove all Unleash traces." ;; uninstall) echo "Remove all Runaway traces." ;;
reinstall) echo "Uninstall + clean install." ;; reinstall) echo "Uninstall + clean install." ;;
report) echo "Generate full status report (markdown or --json)." ;; report) echo "Generate full status report (markdown or --json)." ;;
config) echo "View/edit ~/.unleash.conf settings." ;; config) echo "View/edit ~/.runaway.conf settings." ;;
vpn-kill) echo "Install pf kill-switch (blocks MDM outside VPN)." ;; vpn-kill) echo "Install pf kill-switch (blocks MDM outside VPN)." ;;
vpn-kill-remove) echo "Remove VPN kill-switch." ;; vpn-kill-remove) echo "Remove VPN kill-switch." ;;
vpn-kill-status) echo "Check VPN kill-switch status." ;; vpn-kill-status) echo "Check VPN kill-switch status." ;;
@@ -2890,7 +2890,7 @@ show_cmd_help() {
show_help() { show_help() {
cat <<'HELP' cat <<'HELP'
Usage: ./unleash <command> [options] Usage: ./runaway <command> [options]
Bypass / suppress / monitor MDM enrollment on macOS. Bypass / suppress / monitor MDM enrollment on macOS.
@@ -2948,9 +2948,9 @@ Bypass / suppress / monitor MDM enrollment on macOS.
vpn-kill-status Check VPN kill-switch status vpn-kill-status Check VPN kill-switch status
Management: Management:
config View/edit persistent settings (~/.unleash.conf) config View/edit persistent settings (~/.runaway.conf)
update Self-update to the latest GitHub release update Self-update to the latest GitHub release
uninstall Remove all Unleash traces from the system uninstall Remove all Runaway traces from the system
reinstall Uninstall + reinstall (persist + whitelist + monitor) reinstall Uninstall + reinstall (persist + whitelist + monitor)
discord-bot Start Discord MDM alert bot discord-bot Start Discord MDM alert bot
discord-bot-stop Stop Discord bot discord-bot-stop Stop Discord bot
@@ -2993,7 +2993,7 @@ HELP
} }
cmd_version() { cmd_version() {
echo "unleash v$VERSION" echo "runaway v$VERSION"
exit 0 exit 0
} }
@@ -3056,7 +3056,7 @@ cmd_dualboot() {
return 0 return 0
fi fi
if ! is_root; then if ! is_root; then
error_exit "Dual-boot needs sudo: sudo ./unleash dualboot" error_exit "Dual-boot needs sudo: sudo ./runaway dualboot"
fi fi
header "Dual-Boot Mode" header "Dual-Boot Mode"
@@ -3114,7 +3114,7 @@ cmd_heal() {
heal_suppress "$data_mount" heal_suppress "$data_mount"
else else
if ! is_root; then if ! is_root; then
error_exit "Heal needs sudo: sudo ./unleash heal" error_exit "Heal needs sudo: sudo ./runaway heal"
fi fi
heal_suppress "" heal_suppress ""
fi fi
@@ -3126,7 +3126,7 @@ cmd_persist() {
data_mount=$(resolve_data_volume) data_mount=$(resolve_data_volume)
else else
if ! is_root; then if ! is_root; then
error_exit "Persistence needs sudo: sudo ./unleash persist" error_exit "Persistence needs sudo: sudo ./runaway persist"
fi fi
data_mount="" data_mount=""
fi fi
@@ -3145,7 +3145,7 @@ cmd_unpersist() {
cmd_firewall() { cmd_firewall() {
if ! is_root; then if ! is_root; then
error_exit "Firewall needs sudo: sudo ./unleash firewall" error_exit "Firewall needs sudo: sudo ./runaway firewall"
fi fi
if is_recovery; then if is_recovery; then
local data_mount local data_mount
@@ -3158,7 +3158,7 @@ cmd_firewall() {
cmd_firewall_off() { cmd_firewall_off() {
if ! is_root; then if ! is_root; then
error_exit "Needs sudo: sudo ./unleash firewall-off" error_exit "Needs sudo: sudo ./runaway firewall-off"
fi fi
if is_recovery; then if is_recovery; then
local data_mount local data_mount
@@ -3171,7 +3171,7 @@ cmd_firewall_off() {
cmd_harden() { cmd_harden() {
if ! is_root; then if ! is_root; then
error_exit "Hardening needs sudo: sudo ./unleash harden" error_exit "Hardening needs sudo: sudo ./runaway harden"
fi fi
if is_recovery; then if is_recovery; then
info "In Recovery — will skip live-OS checks" info "In Recovery — will skip live-OS checks"
@@ -3181,14 +3181,14 @@ cmd_harden() {
cmd_audit() { cmd_audit() {
if ! is_root; then if ! is_root; then
error_exit "Audit needs sudo: sudo ./unleash audit" error_exit "Audit needs sudo: sudo ./runaway audit"
fi fi
deep_status deep_status
} }
cmd_whitelist() { cmd_whitelist() {
if ! is_root; then if ! is_root; then
error_exit "Whitelist needs sudo: sudo ./unleash whitelist" error_exit "Whitelist needs sudo: sudo ./runaway whitelist"
fi fi
if is_recovery; then if is_recovery; then
local data_mount local data_mount
@@ -3211,7 +3211,7 @@ cmd_status() {
cmd_check() { cmd_check() {
if ! is_root; then if ! is_root; then
error_exit "Check needs sudo: sudo ./unleash check" error_exit "Check needs sudo: sudo ./runaway check"
fi fi
run_preformat_check run_preformat_check
echo "" echo ""
@@ -3265,12 +3265,12 @@ cmd_test() {
info "" info ""
info "Dry-run complete. No changes were made." info "Dry-run complete. No changes were made."
;; ;;
*) info "Usage: ./unleash test {bypass|suppress|heal|harden|firewall|whitelist|all}" ;; *) info "Usage: ./runaway test {bypass|suppress|heal|harden|firewall|whitelist|all}" ;;
esac esac
} }
cmd_interactive_recovery() { cmd_interactive_recovery() {
header "unleash" header "runaway"
local data_mount local data_mount
data_mount=$(resolve_data_volume) data_mount=$(resolve_data_volume)
@@ -3351,9 +3351,9 @@ cmd_interactive_recovery() {
} }
cmd_interactive_normal() { cmd_interactive_normal() {
header "unleash" header "runaway"
echo -e "${YEL}Not in Recovery. Limited options.${NC}" echo -e "${YEL}Not in Recovery. Limited options.${NC}"
echo " Try: sudo ./unleash heal | harden | audit | check | monitor" echo " Try: sudo ./runaway heal | harden | audit | check | monitor"
echo "" echo ""
PS3="Choose: " PS3="Choose: "
@@ -3367,7 +3367,7 @@ cmd_interactive_normal() {
case $opt in case $opt in
"Auto-heal") "Auto-heal")
if ! is_root; then if ! is_root; then
error_exit "Heal needs sudo. Run: sudo ./unleash" error_exit "Heal needs sudo. Run: sudo ./runaway"
fi fi
heal_suppress "" heal_suppress ""
;; ;;
+4 -4
View File
@@ -14,11 +14,11 @@ for tool in ("bash", "shellcheck"):
if not shutil.which(tool): if not shutil.which(tool):
sys.exit(f"{tool} is required; install it before running make lint") sys.exit(f"{tool} is required; install it before running make lint")
entrypoint = root / "unleash" entrypoint = root / "runaway"
source = entrypoint.read_text() source = entrypoint.read_text()
loader = re.search(r"^for _lib in ([a-z_ ]+); do\n.*?^done$", source, re.M | re.S) loader = re.search(r"^for _lib in ([a-z_ ]+); do\n.*?^done$", source, re.M | re.S)
if not loader: if not loader:
sys.exit("Cannot identify the module loader in unleash") sys.exit("Cannot identify the module loader in runaway")
modules = [root / "lib" / (name + ".sh") for name in loader[1].split()] modules = [root / "lib" / (name + ".sh") for name in loader[1].split()]
if set(modules) != set((root / "lib").glob("*.sh")): if set(modules) != set((root / "lib").glob("*.sh")):
sys.exit("The module loader and library files do not match") sys.exit("The module loader and library files do not match")
@@ -30,7 +30,7 @@ context = source[:loader.start()] + literal_sources
context += "\n" * loader[0].count("\n") + source[loader.end():] context += "\n" * loader[0].count("\n") + source[loader.end():]
examples = sorted((root / "examples").glob("*.sh")) examples = sorted((root / "examples").glob("*.sh"))
failed = False failed = False
for path in [entrypoint, *modules, *examples, root / "unleash-standalone.sh"]: for path in [entrypoint, *modules, *examples, root / "runaway-standalone.sh"]:
result = subprocess.run(["bash", "-n", str(path)], check=False) result = subprocess.run(["bash", "-n", str(path)], check=False)
failed |= result.returncode != 0 failed |= result.returncode != 0
@@ -39,7 +39,7 @@ with tempfile.NamedTemporaryFile(mode="w", suffix=".sh") as temporary:
temporary.flush() temporary.flush()
result = subprocess.run([ result = subprocess.run([
"shellcheck", "--shell=bash", "--external-sources", "--check-sourced", "shellcheck", "--shell=bash", "--external-sources", "--check-sourced",
"--format=json", temporary.name, *map(str, examples), str(root / "unleash-standalone.sh"), "--format=json", temporary.name, *map(str, examples), str(root / "runaway-standalone.sh"),
], capture_output=True, text=True, check=False) ], capture_output=True, text=True, check=False)
if result.stderr: if result.stderr:
print(result.stderr, file=sys.stderr, end="") print(result.stderr, file=sys.stderr, end="")
+3 -3
View File
@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# scripts/sign-release.sh # scripts/sign-release.sh
# Usage: bash scripts/sign-release.sh <version> # Usage: bash scripts/sign-release.sh <version>
# Signs unleash and unleash-standalone.sh with GPG # Signs runaway and runaway-standalone.sh with GPG
set -euo pipefail set -euo pipefail
VERSION="${1:-}" VERSION="${1:-}"
@@ -13,11 +13,11 @@ KEY_ID="${GPG_KEY_ID:-}"
} }
[ -z "$KEY_ID" ] && { echo "No GPG key found. Generate one: gpg --full-generate-key"; exit 1; } [ -z "$KEY_ID" ] && { echo "No GPG key found. Generate one: gpg --full-generate-key"; exit 1; }
for file in unleash unleash-standalone.sh; do for file in runaway runaway-standalone.sh; do
[ -f "$file" ] || continue [ -f "$file" ] || continue
echo "Signing $file..." echo "Signing $file..."
gpg --detach-sign --armor --default-key "$KEY_ID" "$file" gpg --detach-sign --armor --default-key "$KEY_ID" "$file"
echo "Created: $file.asc" echo "Created: $file.asc"
done done
echo "Done. Verify with: gpg --verify unleash.asc unleash" echo "Done. Verify with: gpg --verify runaway.asc runaway"
+1 -1
View File
@@ -10,7 +10,7 @@ import sys
name = pathlib.Path(sys.argv[0]).name name = pathlib.Path(sys.argv[0]).name
args = sys.argv[1:] args = sys.argv[1:]
root = pathlib.Path(os.environ["UNLEASH_TEST_ROOT"]).resolve() root = pathlib.Path(os.environ["RUNAWAY_TEST_ROOT"]).resolve()
with (root / "platform-calls.jsonl").open("a") as log: with (root / "platform-calls.jsonl").open("a") as log:
log.write(json.dumps([name, *args]) + "\n") log.write(json.dumps([name, *args]) + "\n")
+3 -3
View File
@@ -1,9 +1,9 @@
setup_suite() { setup_suite() {
local suite_dir local suite_dir
suite_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" suite_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export UNLEASH_TEST_ROOT="$BATS_SUITE_TMPDIR" export RUNAWAY_TEST_ROOT="$BATS_SUITE_TMPDIR"
export TMPDIR="$UNLEASH_TEST_ROOT/tmp" export TMPDIR="$RUNAWAY_TEST_ROOT/tmp"
local mock_bin="$UNLEASH_TEST_ROOT/bin" local mock_bin="$RUNAWAY_TEST_ROOT/bin"
mkdir -p "$TMPDIR" "$mock_bin" mkdir -p "$TMPDIR" "$mock_bin"
local tool local tool
for tool in sudo diskutil profiles security launchctl pfctl pkill pgrep killall \ for tool in sudo diskutil profiles security launchctl pfctl pkill pgrep killall \
+2 -2
View File
@@ -2,7 +2,7 @@
@test "admin rejects normal mode before resolving a target volume" { @test "admin rejects normal mode before resolving a target volume" {
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
local script="$BATS_TEST_DIRNAME/../$entrypoint" local script="$BATS_TEST_DIRNAME/../$entrypoint"
run bash -u -c ' run bash -u -c '
source <(sed '\''/^main "\$@"$/d'\'' "$1") source <(sed '\''/^main "\$@"$/d'\'' "$1")
@@ -20,7 +20,7 @@
@test "admin dry run returns before accessing account or enrollment state" { @test "admin dry run returns before accessing account or enrollment state" {
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
local script="$BATS_TEST_DIRNAME/../$entrypoint" local script="$BATS_TEST_DIRNAME/../$entrypoint"
run bash -u -c ' run bash -u -c '
source <(sed '\''/^main "\$@"$/d'\'' "$1") source <(sed '\''/^main "\$@"$/d'\'' "$1")
+4 -4
View File
@@ -6,7 +6,7 @@ run_admin_home() {
local target="$BATS_TEST_TMPDIR/External Data" local target="$BATS_TEST_TMPDIR/External Data"
mkdir -p "$target/private/var/db" "$target/private/etc" "$target/Users" mkdir -p "$target/private/var/db" "$target/private/etc" "$target/Users"
sed '/^main "\$@"$/d' "$script" > "$definitions" sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -c ' run "${RUNAWAY_TEST_SHELL:-bash}" -c '
source "$1" source "$1"
target="$2" mode="$3" calls="$4" target="$2" mode="$3" calls="$4"
dscl() { dscl() {
@@ -32,7 +32,7 @@ run_admin_home() {
@test "dualboot assigns the new home to the target UID and staff group" { @test "dualboot assigns the new home to the target UID and staff group" {
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
run_admin_home "$BATS_TEST_DIRNAME/../$entrypoint" fresh run_admin_home "$BATS_TEST_DIRNAME/../$entrypoint" fresh
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
grep -qx ownership "$BATS_TEST_TMPDIR/calls" grep -qx ownership "$BATS_TEST_TMPDIR/calls"
@@ -44,7 +44,7 @@ run_admin_home() {
@test "dualboot stops before setup and network markers when home ownership fails" { @test "dualboot stops before setup and network markers when home ownership fails" {
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
run_admin_home "$BATS_TEST_DIRNAME/../$entrypoint" ownership-fails run_admin_home "$BATS_TEST_DIRNAME/../$entrypoint" ownership-fails
[ "$status" -ne 0 ] [ "$status" -ne 0 ]
[[ "$output" != *"Admin 'fixture' created"* ]] [[ "$output" != *"Admin 'fixture' created"* ]]
@@ -56,7 +56,7 @@ run_admin_home() {
@test "dualboot preserves existing accounts homes and dangling home symlinks" { @test "dualboot preserves existing accounts homes and dangling home symlinks" {
local entrypoint mode local entrypoint mode
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
for mode in existing-user existing-home home-symlink; do for mode in existing-user existing-home home-symlink; do
local target="$BATS_TEST_TMPDIR/External Data" local target="$BATS_TEST_TMPDIR/External Data"
mkdir -p "$target/Users" mkdir -p "$target/Users"
+10 -10
View File
@@ -4,7 +4,7 @@ run_cli() {
local script="$1"; shift local script="$1"; shift
local definitions="$BATS_TEST_TMPDIR/${script##*/}.functions" local definitions="$BATS_TEST_TMPDIR/${script##*/}.functions"
sed '/^main "\$@"$/d' "$script" > "$definitions" sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -u -c ' run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1" source "$1"
shift shift
load_config() { :; } load_config() { :; }
@@ -19,7 +19,7 @@ run_capture() {
local script="$1"; shift local script="$1"; shift
local definitions="$BATS_TEST_TMPDIR/${script##*/}.functions" local definitions="$BATS_TEST_TMPDIR/${script##*/}.functions"
sed '/^main "\$@"$/d' "$script" > "$definitions" sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -u -c ' run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1" source "$1"
shift shift
load_config() { :; } load_config() { :; }
@@ -33,7 +33,7 @@ run_capture() {
@test "optional CLI arguments reach usage or privilege guards under nounset" { @test "optional CLI arguments reach usage or privilege guards under nounset" {
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
local script="$BATS_TEST_DIRNAME/../$entrypoint" local script="$BATS_TEST_DIRNAME/../$entrypoint"
run_cli "$script" audit run_cli "$script" audit
[ "$status" -ne 0 ]; [[ "$output" == *"Audit needs sudo"* ]] [ "$status" -ne 0 ]; [[ "$output" == *"Audit needs sudo"* ]]
@@ -42,15 +42,15 @@ run_capture() {
run_cli "$script" monitor --webhook run_cli "$script" monitor --webhook
[ "$status" -ne 0 ]; [[ "$output" == *"--webhook requires a URL"* ]] [ "$status" -ne 0 ]; [[ "$output" == *"--webhook requires a URL"* ]]
run_cli "$script" config set run_cli "$script" config set
[ "$status" -ne 0 ]; [[ "$output" == *"Usage: ./unleash config set KEY VALUE"* ]] [ "$status" -ne 0 ]; [[ "$output" == *"Usage: ./runaway config set KEY VALUE"* ]]
run_cli "$script" config unset run_cli "$script" config unset
[ "$status" -ne 0 ]; [[ "$output" == *"Usage: ./unleash config unset KEY"* ]] [ "$status" -ne 0 ]; [[ "$output" == *"Usage: ./runaway config unset KEY"* ]]
done done
} }
@test "CLI values retain spaces quotes empty strings and literal shell syntax" { @test "CLI values retain spaces quotes empty strings and literal shell syntax" {
local entrypoint value local entrypoint value
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
for value in 'a b $(printf injected) "quoted"' ''; do for value in 'a b $(printf injected) "quoted"' ''; do
run_capture "$BATS_TEST_DIRNAME/../$entrypoint" config set LOG_FILE "$value" run_capture "$BATS_TEST_DIRNAME/../$entrypoint" config set LOG_FILE "$value"
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
@@ -63,7 +63,7 @@ run_capture() {
@test "global flags around the command persist in the command shell" { @test "global flags around the command persist in the command shell" {
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
run_capture "$BATS_TEST_DIRNAME/../$entrypoint" --dry-run config --verbose set LOG_FILE value --log-file 'a b.log' run_capture "$BATS_TEST_DIRNAME/../$entrypoint" --dry-run config --verbose set LOG_FILE value --log-file 'a b.log'
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[[ "$output" == 'dry=true verbose=true log=<a b.log>'* ]] [[ "$output" == 'dry=true verbose=true log=<a b.log>'* ]]
@@ -73,7 +73,7 @@ run_capture() {
@test "global flags without a command preserve an empty argument list" { @test "global flags without a command preserve an empty argument list" {
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
run_cli "$BATS_TEST_DIRNAME/../$entrypoint" --verbose run_cli "$BATS_TEST_DIRNAME/../$entrypoint" --verbose
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[ "$output" = 'interactive verbose=true' ] [ "$output" = 'interactive verbose=true' ]
@@ -82,7 +82,7 @@ run_capture() {
@test "CLI option terminator preserves values that look like global options" { @test "CLI option terminator preserves values that look like global options" {
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
run_capture "$BATS_TEST_DIRNAME/../$entrypoint" config set LOG_LEVEL -- --verbose run_capture "$BATS_TEST_DIRNAME/../$entrypoint" config set LOG_LEVEL -- --verbose
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[[ "$output" == 'dry=false verbose=false log=<>'* ]] [[ "$output" == 'dry=false verbose=false log=<>'* ]]
@@ -92,7 +92,7 @@ run_capture() {
@test "log-file rejects an empty path or another option as its missing value" { @test "log-file rejects an empty path or another option as its missing value" {
local entrypoint value local entrypoint value
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
for value in '' --dry-run; do for value in '' --dry-run; do
run_cli "$BATS_TEST_DIRNAME/../$entrypoint" --log-file "$value" version run_cli "$BATS_TEST_DIRNAME/../$entrypoint" --log-file "$value" version
[ "$status" -ne 0 ] [ "$status" -ne 0 ]
+1 -1
View File
@@ -9,7 +9,7 @@ setup() {
mkdir -p "$TEST_DIR/private/etc" mkdir -p "$TEST_DIR/private/etc"
mkdir -p "$TEST_DIR/private/var/db/ConfigurationProfiles/Settings" mkdir -p "$TEST_DIR/private/var/db/ConfigurationProfiles/Settings"
echo "test" > "$TEST_DIR/private/etc/hosts" echo "test" > "$TEST_DIR/private/etc/hosts"
BACKUP_DIR="$SCRIPT_DIR/.unleash-backup" BACKUP_DIR="$SCRIPT_DIR/.runaway-backup"
} }
teardown() { teardown() {
+1 -1
View File
@@ -50,7 +50,7 @@ teardown() {
@test "diagnostics use stderr without contaminating helper return values" { @test "diagnostics use stderr without contaminating helper return values" {
local source_file local source_file
for source_file in lib/colors.sh unleash-standalone.sh; do for source_file in lib/colors.sh runaway-standalone.sh; do
run --separate-stderr bash -u -c ' run --separate-stderr bash -u -c '
source <(sed "/^error_exit()/,\$d" "$1") source <(sed "/^error_exit()/,\$d" "$1")
volume_path() { volume_path() {
+1 -1
View File
@@ -37,7 +37,7 @@ teardown() {
} }
@test "config preserves spaces and literal replacement characters" { @test "config preserves spaces and literal replacement characters" {
local value='/tmp/Unleash logs/quoted "name" & \tail' local value='/tmp/Runaway logs/quoted "name" & \tail'
save_config LOG_FILE old save_config LOG_FILE old
save_config LOG_FILE "$value" save_config LOG_FILE "$value"
LOG_FILE='' LOG_FILE=''
+4 -4
View File
@@ -21,12 +21,12 @@ setup() {
@test "network doctor reports build power and link using only read commands" { @test "network doctor reports build power and link using only read commands" {
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
local script="$BATS_TEST_DIRNAME/../$entrypoint" local script="$BATS_TEST_DIRNAME/../$entrypoint"
local definitions="$BATS_TEST_TMPDIR/$entrypoint.functions" local definitions="$BATS_TEST_TMPDIR/$entrypoint.functions"
local calls="$BATS_TEST_TMPDIR/$entrypoint.calls" local calls="$BATS_TEST_TMPDIR/$entrypoint.calls"
sed '/^main "\$@"$/d' "$script" > "$definitions" sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -u -c ' run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1" source "$1"
calls="$2" calls="$2"
load_config() { :; } load_config() { :; }
@@ -61,10 +61,10 @@ setup() {
} }
@test "standalone doctor verifies embedded modules without a lib directory" { @test "standalone doctor verifies embedded modules without a lib directory" {
local script="$BATS_TEST_DIRNAME/../unleash-standalone.sh" local script="$BATS_TEST_DIRNAME/../runaway-standalone.sh"
local definitions="$BATS_TEST_TMPDIR/standalone.functions" local definitions="$BATS_TEST_TMPDIR/standalone.functions"
sed '/^main "\$@"$/d' "$script" > "$definitions" sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -u -c ' run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
unset LIB_DIR unset LIB_DIR
source "$1" source "$1"
load_config() { :; } load_config() { :; }
+2 -2
View File
@@ -2,12 +2,12 @@
@test "dualboot dry run returns before target access with or without root" { @test "dualboot dry run returns before target access with or without root" {
local entrypoint root_status local entrypoint root_status
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
local script="$BATS_TEST_DIRNAME/../$entrypoint" local script="$BATS_TEST_DIRNAME/../$entrypoint"
local definitions="$BATS_TEST_TMPDIR/$entrypoint.functions" local definitions="$BATS_TEST_TMPDIR/$entrypoint.functions"
sed '/^main "\$@"$/d' "$script" > "$definitions" sed '/^main "\$@"$/d' "$script" > "$definitions"
for root_status in 0 1; do for root_status in 0 1; do
run "${UNLEASH_TEST_SHELL:-bash}" -u -c ' run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1" source "$1"
root_status="$2" root_status="$2"
load_config() { :; } load_config() { :; }
+2 -2
View File
@@ -2,7 +2,7 @@
@test "dualboot keeps passwords out of diagnostics while preserving network preferences" { @test "dualboot keeps passwords out of diagnostics while preserving network preferences" {
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
local script="$BATS_TEST_DIRNAME/../$entrypoint" local script="$BATS_TEST_DIRNAME/../$entrypoint"
local definitions="$BATS_TEST_TMPDIR/$entrypoint.functions" local definitions="$BATS_TEST_TMPDIR/$entrypoint.functions"
local target="$BATS_TEST_TMPDIR/$entrypoint Data" log="$BATS_TEST_TMPDIR/$entrypoint.log" local target="$BATS_TEST_TMPDIR/$entrypoint Data" log="$BATS_TEST_TMPDIR/$entrypoint.log"
@@ -11,7 +11,7 @@
printf 'original Wi-Fi networks\n' > "$target/Library/Preferences/com.apple.wifi.known-networks.plist" printf 'original Wi-Fi networks\n' > "$target/Library/Preferences/com.apple.wifi.known-networks.plist"
cp -R "$target/Library" "$BATS_TEST_TMPDIR/$entrypoint.before" cp -R "$target/Library" "$BATS_TEST_TMPDIR/$entrypoint.before"
sed '/^main "\$@"$/d' "$script" > "$definitions" sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -u -c ' run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1" source "$1"
target="$2" logfile="$3" target="$2" logfile="$3"
fixture_password="fixture-password-not-for-a-real-account" fixture_password="fixture-password-not-for-a-real-account"
+9 -9
View File
@@ -4,7 +4,7 @@ setup() {
load '../lib/colors.sh' load '../lib/colors.sh'
load '../lib/firewall.sh' load '../lib/firewall.sh'
TEST_DIR=$(mktemp -d) TEST_DIR=$(mktemp -d)
mkdir -p "$TEST_DIR/etc/pf.anchors/com.unleash" mkdir -p "$TEST_DIR/etc/pf.anchors/com.runaway"
mkdir -p "$TEST_DIR/private/etc" mkdir -p "$TEST_DIR/private/etc"
} }
@@ -14,12 +14,12 @@ teardown() {
@test "install_pf_mdm_block creates anchor" { @test "install_pf_mdm_block creates anchor" {
run install_pf_mdm_block "$TEST_DIR" 2>/dev/null || true run install_pf_mdm_block "$TEST_DIR" 2>/dev/null || true
[ -f "$TEST_DIR/etc/pf.anchors/com.unleash/mdm" ] [ -f "$TEST_DIR/etc/pf.anchors/com.runaway/mdm" ]
} }
@test "install_pf_mdm_block includes MDM ranges" { @test "install_pf_mdm_block includes MDM ranges" {
run install_pf_mdm_block "$TEST_DIR" 2>/dev/null || true run install_pf_mdm_block "$TEST_DIR" 2>/dev/null || true
run grep -c "17.0.0.0/8" "$TEST_DIR/etc/pf.anchors/com.unleash/mdm" run grep -c "17.0.0.0/8" "$TEST_DIR/etc/pf.anchors/com.runaway/mdm"
[ "$output" -ge 1 ] [ "$output" -ge 1 ]
} }
@@ -30,14 +30,14 @@ teardown() {
@test "install_pf_mdm_block adds anchor to pf.conf" { @test "install_pf_mdm_block adds anchor to pf.conf" {
run install_pf_mdm_block "$TEST_DIR" 2>/dev/null || true run install_pf_mdm_block "$TEST_DIR" 2>/dev/null || true
run grep -c "com.unleash" "$TEST_DIR/etc/pf.conf" run grep -c "com.runaway" "$TEST_DIR/etc/pf.conf"
[ "$output" -ge 1 ] [ "$output" -ge 1 ]
} }
@test "install_pf_mdm_block is idempotent on pf.conf" { @test "install_pf_mdm_block is idempotent on pf.conf" {
run install_pf_mdm_block "$TEST_DIR" 2>/dev/null || true run install_pf_mdm_block "$TEST_DIR" 2>/dev/null || true
run install_pf_mdm_block "$TEST_DIR" 2>/dev/null || true run install_pf_mdm_block "$TEST_DIR" 2>/dev/null || true
run grep -c "com.unleash" "$TEST_DIR/etc/pf.conf" run grep -c "com.runaway" "$TEST_DIR/etc/pf.conf"
[ "$output" -ge 1 ] [ "$output" -ge 1 ]
[ "$output" -le 3 ] [ "$output" -le 3 ]
} }
@@ -45,20 +45,20 @@ teardown() {
@test "remove_pf_mdm_block cleans anchor file" { @test "remove_pf_mdm_block cleans anchor file" {
run install_pf_mdm_block "$TEST_DIR" 2>/dev/null || true run install_pf_mdm_block "$TEST_DIR" 2>/dev/null || true
run remove_pf_mdm_block "$TEST_DIR" 2>/dev/null || true run remove_pf_mdm_block "$TEST_DIR" 2>/dev/null || true
[ ! -f "$TEST_DIR/etc/pf.anchors/com.unleash/mdm" ] [ ! -f "$TEST_DIR/etc/pf.anchors/com.runaway/mdm" ]
} }
@test "remove_pf_mdm_block cleans pf.conf" { @test "remove_pf_mdm_block cleans pf.conf" {
run install_pf_mdm_block "$TEST_DIR" 2>/dev/null || true run install_pf_mdm_block "$TEST_DIR" 2>/dev/null || true
run remove_pf_mdm_block "$TEST_DIR" 2>/dev/null || true run remove_pf_mdm_block "$TEST_DIR" 2>/dev/null || true
run grep -c "com.unleash" "$TEST_DIR/etc/pf.conf" || true run grep -c "com.runaway" "$TEST_DIR/etc/pf.conf" || true
[ "$output" -eq 0 ] [ "$output" -eq 0 ]
} }
@test "pf_backup_anchor creates backup file" { @test "pf_backup_anchor creates backup file" {
echo "test" > "$TEST_DIR/etc/pf.anchors/com.unleash/mdm" echo "test" > "$TEST_DIR/etc/pf.anchors/com.runaway/mdm"
run pf_backup_anchor "$TEST_DIR" 2>/dev/null || true run pf_backup_anchor "$TEST_DIR" 2>/dev/null || true
run ls "$TEST_DIR/etc/pf.anchors/com.unleash/mdm.backup."* 2>/dev/null run ls "$TEST_DIR/etc/pf.anchors/com.runaway/mdm.backup."* 2>/dev/null
[ -n "$output" ] [ -n "$output" ]
} }
+2 -2
View File
@@ -11,8 +11,8 @@ setup() {
} }
@test "clear_history does not error with no logs" { @test "clear_history does not error with no logs" {
echo event > "$BATS_TEST_TMPDIR/unleash-monitor.log" echo event > "$BATS_TEST_TMPDIR/runaway-monitor.log"
run clear_history "$BATS_TEST_TMPDIR" run clear_history "$BATS_TEST_TMPDIR"
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[ ! -s "$BATS_TEST_TMPDIR/unleash-monitor.log" ] [ ! -s "$BATS_TEST_TMPDIR/runaway-monitor.log" ]
} }
+2 -2
View File
@@ -4,7 +4,7 @@ setup() {
PROJECT="$BATS_TEST_TMPDIR/project" PROJECT="$BATS_TEST_TMPDIR/project"
mkdir -p "$PROJECT/scripts" "$PROJECT/lib" mkdir -p "$PROJECT/scripts" "$PROJECT/lib"
cp "$BATS_TEST_DIRNAME/../scripts/check-shell.py" "$PROJECT/scripts/" cp "$BATS_TEST_DIRNAME/../scripts/check-shell.py" "$PROJECT/scripts/"
cat > "$PROJECT/unleash" <<'SH' cat > "$PROJECT/runaway" <<'SH'
#!/bin/bash #!/bin/bash
for _lib in sample; do for _lib in sample; do
source "lib/$_lib.sh" source "lib/$_lib.sh"
@@ -12,7 +12,7 @@ done
sample sample
SH SH
printf 'sample() { :; }\n' > "$PROJECT/lib/sample.sh" printf 'sample() { :; }\n' > "$PROJECT/lib/sample.sh"
printf '#!/bin/bash\n' > "$PROJECT/unleash-standalone.sh" printf '#!/bin/bash\n' > "$PROJECT/runaway-standalone.sh"
} }
@test "lint reports sourced module findings without executing the application" { @test "lint reports sourced module findings without executing the application" {
+7 -7
View File
@@ -5,7 +5,7 @@ setup() {
load '../lib/launchd.sh' load '../lib/launchd.sh'
load '../lib/monitor.sh' load '../lib/monitor.sh'
TEST_DIR=$(mktemp -d) TEST_DIR=$(mktemp -d)
SCRIPT_PATH="$TEST_DIR/unleash" SCRIPT_PATH="$TEST_DIR/runaway"
} }
teardown() { teardown() {
@@ -26,30 +26,30 @@ teardown() {
SCRIPT_DIR="$TEST_DIR" SCRIPT_DIR="$TEST_DIR"
mkdir -p "$TEST_DIR" mkdir -p "$TEST_DIR"
run install_monitor_launchdaemon "$TEST_DIR" 2>/dev/null || true run install_monitor_launchdaemon "$TEST_DIR" 2>/dev/null || true
[ -f "$TEST_DIR/Library/LaunchDaemons/com.unleash.monitor.plist" ] [ -f "$TEST_DIR/Library/LaunchDaemons/com.runaway.monitor.plist" ]
} }
@test "install_monitor_launchdaemon plist is valid xml" { @test "install_monitor_launchdaemon plist is valid xml" {
SCRIPT_DIR="$TEST_DIR" SCRIPT_DIR="$TEST_DIR"
mkdir -p "$TEST_DIR" mkdir -p "$TEST_DIR"
run install_monitor_launchdaemon "$TEST_DIR" 2>/dev/null || true run install_monitor_launchdaemon "$TEST_DIR" 2>/dev/null || true
run grep -c "plist" "$TEST_DIR/Library/LaunchDaemons/com.unleash.monitor.plist" run grep -c "plist" "$TEST_DIR/Library/LaunchDaemons/com.runaway.monitor.plist"
[ "$output" -gt 0 ] [ "$output" -gt 0 ]
} }
@test "install_monitor_launchdaemon references unleash binary" { @test "install_monitor_launchdaemon references runaway binary" {
SCRIPT_DIR="$TEST_DIR" SCRIPT_DIR="$TEST_DIR"
mkdir -p "$TEST_DIR" mkdir -p "$TEST_DIR"
run install_monitor_launchdaemon "$TEST_DIR" 2>/dev/null || true run install_monitor_launchdaemon "$TEST_DIR" 2>/dev/null || true
run grep -c "unleash" "$TEST_DIR/Library/LaunchDaemons/com.unleash.monitor.plist" run grep -c "runaway" "$TEST_DIR/Library/LaunchDaemons/com.runaway.monitor.plist"
[ "$output" -gt 0 ] [ "$output" -gt 0 ]
} }
@test "uninstall_monitor_launchdaemon removes plist" { @test "uninstall_monitor_launchdaemon removes plist" {
mkdir -p "$TEST_DIR/Library/LaunchDaemons" mkdir -p "$TEST_DIR/Library/LaunchDaemons"
touch "$TEST_DIR/Library/LaunchDaemons/com.unleash.monitor.plist" touch "$TEST_DIR/Library/LaunchDaemons/com.runaway.monitor.plist"
run uninstall_monitor_launchdaemon "$TEST_DIR" 2>/dev/null || true run uninstall_monitor_launchdaemon "$TEST_DIR" 2>/dev/null || true
[ ! -f "$TEST_DIR/Library/LaunchDaemons/com.unleash.monitor.plist" ] [ ! -f "$TEST_DIR/Library/LaunchDaemons/com.runaway.monitor.plist" ]
} }
@test "monitor_mdm requires root" { @test "monitor_mdm requires root" {
+4 -4
View File
@@ -4,7 +4,7 @@ run_network_state() {
local script="$1" mode="$2" local script="$1" mode="$2"
local definitions="$BATS_TEST_TMPDIR/network.functions" local definitions="$BATS_TEST_TMPDIR/network.functions"
sed '/^main "\$@"$/d' "$script" > "$definitions" sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -u -c ' run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1" source "$1"
mode="$2" mode="$2"
load_config() { :; } load_config() { :; }
@@ -41,7 +41,7 @@ run_network_state() {
@test "network doctor distinguishes query failure from absent hardware" { @test "network doctor distinguishes query failure from absent hardware" {
local entrypoint mode local entrypoint mode
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
for mode in missing portsfail powerfail linkfail; do for mode in missing portsfail powerfail linkfail; do
run_network_state "$BATS_TEST_DIRNAME/../$entrypoint" "$mode" run_network_state "$BATS_TEST_DIRNAME/../$entrypoint" "$mode"
[ "$status" -ne 0 ] [ "$status" -ne 0 ]
@@ -53,7 +53,7 @@ run_network_state() {
@test "network doctor classifies IPv4 state without exposing addresses" { @test "network doctor classifies IPv4 state without exposing addresses" {
local entrypoint mode expected local entrypoint mode expected
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
for mode in configured linklocal none; do for mode in configured linklocal none; do
expected="$mode"; [ "$mode" != linklocal ] || expected=link-local expected="$mode"; [ "$mode" != linklocal ] || expected=link-local
run_network_state "$BATS_TEST_DIRNAME/../$entrypoint" "$mode" run_network_state "$BATS_TEST_DIRNAME/../$entrypoint" "$mode"
@@ -68,7 +68,7 @@ run_network_state() {
@test "network doctor reports absent Wi-Fi after a successful hardware query" { @test "network doctor reports absent Wi-Fi after a successful hardware query" {
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
run_network_state "$BATS_TEST_DIRNAME/../$entrypoint" absent run_network_state "$BATS_TEST_DIRNAME/../$entrypoint" absent
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[[ "$output" == *"No Wi-Fi hardware port reported"* ]] [[ "$output" == *"No Wi-Fi hardware port reported"* ]]
+5 -5
View File
@@ -3,18 +3,18 @@
check_daemon_path() { check_daemon_path() {
local installer="$1" action="$2" label="$3" local installer="$1" action="$2" label="$3"
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
local folder="$BATS_TEST_TMPDIR/$entrypoint/Tool Folder & <profile> \"quoted\"" local folder="$BATS_TEST_TMPDIR/$entrypoint/Tool Folder & <profile> \"quoted\""
local target="$BATS_TEST_TMPDIR/$entrypoint/Target" local target="$BATS_TEST_TMPDIR/$entrypoint/Target"
local script="$folder/renamed standalone.sh" local script="$folder/renamed standalone.sh"
local definitions="$BATS_TEST_TMPDIR/$entrypoint.functions" local definitions="$BATS_TEST_TMPDIR/$entrypoint.functions"
mkdir -p "$folder" "$target/Library" mkdir -p "$folder" "$target/Library"
printf '#!/bin/bash\nprintf "ACTION=%%s\\n" "$1"\n' > "$script" printf '#!/bin/bash\nprintf "ACTION=%%s\\n" "$1"\n' > "$script"
if [ "$entrypoint" = unleash ]; then if [ "$entrypoint" = runaway ]; then
ln -s "$BATS_TEST_DIRNAME/../lib" "$folder/lib" ln -s "$BATS_TEST_DIRNAME/../lib" "$folder/lib"
fi fi
sed '/^main "\$@"$/d' "$BATS_TEST_DIRNAME/../$entrypoint" > "$definitions" sed '/^main "\$@"$/d' "$BATS_TEST_DIRNAME/../$entrypoint" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -u -c ' run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
unset SCRIPT_DIR SCRIPT_PATH unset SCRIPT_DIR SCRIPT_PATH
source "$1" source "$1"
expected="$2/Library/LaunchDaemons" expected="$2/Library/LaunchDaemons"
@@ -40,9 +40,9 @@ PY
} }
@test "persistence invokes renamed scripts with spaces and XML text literally" { @test "persistence invokes renamed scripts with spaces and XML text literally" {
check_daemon_path install_persist_launchdaemon heal com.unleash.heal check_daemon_path install_persist_launchdaemon heal com.runaway.heal
} }
@test "monitor invokes renamed scripts with spaces and XML text literally" { @test "monitor invokes renamed scripts with spaces and XML text literally" {
check_daemon_path install_monitor_launchdaemon monitor com.unleash.monitor check_daemon_path install_monitor_launchdaemon monitor com.runaway.monitor
} }
+4 -4
View File
@@ -2,12 +2,12 @@
@test "Recovery download runs without a library directory" { @test "Recovery download runs without a library directory" {
local repo="$BATS_TEST_DIRNAME/.." artifact target="$BATS_TEST_TMPDIR/recovery" local repo="$BATS_TEST_DIRNAME/.." artifact target="$BATS_TEST_TMPDIR/recovery"
artifact=$(sed -n 's|^curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/\([^ ]*\) -o /tmp/unleash$|\1|p' "$repo/README.md") artifact=$(sed -n 's|^curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/\([^ ]*\) -o /tmp/runaway$|\1|p' "$repo/README.md")
[ -n "$artifact" ] [ -n "$artifact" ]
mkdir -p "$target" mkdir -p "$target"
cp "$repo/$artifact" "$target/unleash" cp "$repo/$artifact" "$target/runaway"
run env HOME="$target" XDG_CONFIG_HOME="$target/config" bash "$target/unleash" version run env HOME="$target" XDG_CONFIG_HOME="$target/config" bash "$target/runaway" version
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[[ "$output" == *"unleash"* ]] [[ "$output" == *"runaway"* ]]
[ ! -d "$target/lib" ] [ ! -d "$target/lib" ]
} }
+3 -3
View File
@@ -4,7 +4,7 @@ run_preview() {
local script="$1" command="$2" recovery="$3" local script="$1" command="$2" recovery="$3"
local definitions="$BATS_TEST_TMPDIR/preview.functions" local definitions="$BATS_TEST_TMPDIR/preview.functions"
sed '/^main "\$@"$/d' "$script" > "$definitions" sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -u -c ' run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1" source "$1"
action="$2" recovery="$3" action="$2" recovery="$3"
load_config() { :; } load_config() { :; }
@@ -16,7 +16,7 @@ run_preview() {
@test "suppress and bypass dry runs return before target resolution" { @test "suppress and bypass dry runs return before target resolution" {
local entrypoint action local entrypoint action
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
for action in suppress bypass; do for action in suppress bypass; do
run_preview "$BATS_TEST_DIRNAME/../$entrypoint" "$action" 0 run_preview "$BATS_TEST_DIRNAME/../$entrypoint" "$action" 0
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
@@ -28,7 +28,7 @@ run_preview() {
@test "bypass dry run still rejects a booted OS" { @test "bypass dry run still rejects a booted OS" {
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
run_preview "$BATS_TEST_DIRNAME/../$entrypoint" bypass 1 run_preview "$BATS_TEST_DIRNAME/../$entrypoint" bypass 1
[ "$status" -ne 0 ] [ "$status" -ne 0 ]
[[ "$output" == *"Full bypass must run from Recovery mode"* ]] [[ "$output" == *"Full bypass must run from Recovery mode"* ]]
+10 -10
View File
@@ -13,7 +13,7 @@ suppress_fixture() {
@test "heal repairs old Rosetta blocks even when suppression is otherwise intact" { @test "heal repairs old Rosetta blocks even when suppression is otherwise intact" {
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
local script="$BATS_TEST_DIRNAME/../$entrypoint" local script="$BATS_TEST_DIRNAME/../$entrypoint"
local target="$BATS_TEST_TMPDIR/$entrypoint" hosts local target="$BATS_TEST_TMPDIR/$entrypoint" hosts
hosts="$target/private/etc/hosts" hosts="$target/private/etc/hosts"
@@ -27,7 +27,7 @@ suppress_fixture() {
@test "heal dry run preserves old Rosetta entries" { @test "heal dry run preserves old Rosetta entries" {
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
local script="$BATS_TEST_DIRNAME/../$entrypoint" local script="$BATS_TEST_DIRNAME/../$entrypoint"
local target="$BATS_TEST_TMPDIR/$entrypoint" hosts local target="$BATS_TEST_TMPDIR/$entrypoint" hosts
hosts="$target/private/etc/hosts" hosts="$target/private/etc/hosts"
@@ -36,13 +36,13 @@ suppress_fixture() {
cp "$hosts" "$target/original" cp "$hosts" "$target/original"
suppress_fixture "$script" "$target" heal_suppress true suppress_fixture "$script" "$target" heal_suppress true
cmp "$target/original" "$hosts" cmp "$target/original" "$hosts"
[ ! -e "$hosts.unleash-rosetta.bak" ] [ ! -e "$hosts.runaway-rosetta.bak" ]
done done
} }
@test "suppression does not add hosts blocks for Rosetta configuration" { @test "suppression does not add hosts blocks for Rosetta configuration" {
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
local script="$BATS_TEST_DIRNAME/../$entrypoint" local script="$BATS_TEST_DIRNAME/../$entrypoint"
local target="$BATS_TEST_TMPDIR/$entrypoint" local target="$BATS_TEST_TMPDIR/$entrypoint"
mkdir -p "$target/private/etc" mkdir -p "$target/private/etc"
@@ -56,27 +56,27 @@ suppress_fixture() {
@test "suppression repairs its old Rosetta blocks with an unchanged backup on rerun" { @test "suppression repairs its old Rosetta blocks with an unchanged backup on rerun" {
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
local script="$BATS_TEST_DIRNAME/../$entrypoint" local script="$BATS_TEST_DIRNAME/../$entrypoint"
local target="$BATS_TEST_TMPDIR/$entrypoint" hosts local target="$BATS_TEST_TMPDIR/$entrypoint" hosts
hosts="$target/private/etc/hosts" hosts="$target/private/etc/hosts"
mkdir -p "$(dirname "$hosts")" mkdir -p "$(dirname "$hosts")"
printf '127.0.0.1 localhost\n# Added by unleash — DEP enrollment block\n0.0.0.0 configuration.apple.com\n:: configuration.apple.com\n' > "$hosts" printf '127.0.0.1 localhost\n# Added by runaway — DEP enrollment block\n0.0.0.0 configuration.apple.com\n:: configuration.apple.com\n' > "$hosts"
cp "$hosts" "$target/original" cp "$hosts" "$target/original"
suppress_fixture "$script" "$target" suppress_fixture "$script" "$target"
run grep -q 'configuration[.]apple[.]com' "$hosts" run grep -q 'configuration[.]apple[.]com' "$hosts"
[ "$status" -eq 1 ] [ "$status" -eq 1 ]
cmp "$target/original" "$hosts.unleash-rosetta.bak" cmp "$target/original" "$hosts.runaway-rosetta.bak"
cp "$hosts" "$target/repaired" cp "$hosts" "$target/repaired"
suppress_fixture "$script" "$target" suppress_fixture "$script" "$target"
cmp "$target/repaired" "$hosts" cmp "$target/repaired" "$hosts"
cmp "$target/original" "$hosts.unleash-rosetta.bak" cmp "$target/original" "$hosts.runaway-rosetta.bak"
done done
} }
@test "suppression preserves Rosetta blocks outside its generated section" { @test "suppression preserves Rosetta blocks outside its generated section" {
local entrypoint local entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
local script="$BATS_TEST_DIRNAME/../$entrypoint" local script="$BATS_TEST_DIRNAME/../$entrypoint"
local target="$BATS_TEST_TMPDIR/$entrypoint" hosts local target="$BATS_TEST_TMPDIR/$entrypoint" hosts
hosts="$target/private/etc/hosts" hosts="$target/private/etc/hosts"
@@ -85,6 +85,6 @@ suppress_fixture() {
suppress_fixture "$script" "$target" suppress_fixture "$script" "$target"
grep -Fxq '0.0.0.0 configuration.apple.com' "$hosts" grep -Fxq '0.0.0.0 configuration.apple.com' "$hosts"
grep -Fxq ':: configuration.apple.com manual.alias' "$hosts" grep -Fxq ':: configuration.apple.com manual.alias' "$hosts"
[ ! -e "$hosts.unleash-rosetta.bak" ] [ ! -e "$hosts.runaway-rosetta.bak" ]
done done
} }
+2 -2
View File
@@ -41,7 +41,7 @@ teardown() {
} }
@test "text audit completes with zero profiles under nounset" { @test "text audit completes with zero profiles under nounset" {
run "${UNLEASH_TEST_SHELL:-bash}" -u -c ' run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1/lib/colors.sh" source "$1/lib/colors.sh"
source "$1/lib/status.sh" source "$1/lib/status.sh"
pf_status() { :; } pf_status() { :; }
@@ -57,7 +57,7 @@ teardown() {
for module in status report; do for module in status report; do
if [ "$module" = status ]; then function_name=deep_status_json; field=profile_count; if [ "$module" = status ]; then function_name=deep_status_json; field=profile_count;
else function_name=generate_report_json; field=installed_profiles; fi else function_name=generate_report_json; field=installed_profiles; fi
run "${UNLEASH_TEST_SHELL:-bash}" -u -c ' run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1/lib/colors.sh" source "$1/lib/colors.sh"
source "$1/lib/$2.sh" source "$1/lib/$2.sh"
grep() { grep() {
+2 -2
View File
@@ -2,7 +2,7 @@
check_optional_record() { check_optional_record() {
local kind="$1" entrypoint local kind="$1" entrypoint
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
local script="$BATS_TEST_DIRNAME/../$entrypoint" local script="$BATS_TEST_DIRNAME/../$entrypoint"
local definitions="$BATS_TEST_TMPDIR/$entrypoint.functions" local definitions="$BATS_TEST_TMPDIR/$entrypoint.functions"
local target="$BATS_TEST_TMPDIR/$entrypoint-volume" local target="$BATS_TEST_TMPDIR/$entrypoint-volume"
@@ -18,7 +18,7 @@ records = {
} }
(settings / ".cloudConfigRecordFound").write_bytes(plistlib.dumps(records[sys.argv[2]])) (settings / ".cloudConfigRecordFound").write_bytes(plistlib.dumps(records[sys.argv[2]]))
PY PY
run "${UNLEASH_TEST_SHELL:-bash}" -eu -o pipefail -c ' run "${RUNAWAY_TEST_SHELL:-bash}" -eu -o pipefail -c '
source "$1" source "$1"
target="$2" target="$2"
load_config() { :; } load_config() { :; }
+1 -1
View File
@@ -3,7 +3,7 @@
check_volume_output() { check_volume_output() {
local mode="$1" entrypoint local mode="$1" entrypoint
bats_require_minimum_version 1.5.0 bats_require_minimum_version 1.5.0
for entrypoint in unleash unleash-standalone.sh; do for entrypoint in runaway runaway-standalone.sh; do
local script="$BATS_TEST_DIRNAME/../$entrypoint" local script="$BATS_TEST_DIRNAME/../$entrypoint"
local target="$BATS_TEST_TMPDIR/$entrypoint/Data volume" local target="$BATS_TEST_TMPDIR/$entrypoint/Data volume"
mkdir -p "$target/private/var/db/dslocal/nodes/Default" mkdir -p "$target/private/var/db/dslocal/nodes/Default"
+1 -1
View File
@@ -4,7 +4,7 @@ setup() {
load '../lib/colors.sh' load '../lib/colors.sh'
load '../lib/vpn.sh' load '../lib/vpn.sh'
TEST_DIR=$(mktemp -d) TEST_DIR=$(mktemp -d)
mkdir -p "$TEST_DIR/etc/pf.anchors/com.unleash" mkdir -p "$TEST_DIR/etc/pf.anchors/com.runaway"
} }
teardown() { teardown() {
+1 -1
View File
@@ -13,7 +13,7 @@ teardown() {
@test "install_selective_block creates anchor" { @test "install_selective_block creates anchor" {
run install_selective_block "$TEST_DIR" 2>/dev/null || true run install_selective_block "$TEST_DIR" 2>/dev/null || true
[ -f "$TEST_DIR/etc/pf.anchors/com.unleash.selective" ] [ -f "$TEST_DIR/etc/pf.anchors/com.runaway.selective" ]
} }
@test "install_selective_block creates pf.conf" { @test "install_selective_block creates pf.conf" {