rename project to runaway

This commit is contained in:
2026-11-09 10:13:51 +08:00
parent 20946dd445
commit 205f2faf02
95 changed files with 1034 additions and 1034 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ jobs:
name: ShellCheck
command: |
apk add bash
for f in unleash lib/*.sh examples/*.sh; do
for f in runaway lib/*.sh examples/*.sh; do
[ -f "$f" ] || continue
echo "Checking: $f"
shellcheck -S warning "$f" || exit 1
@@ -25,7 +25,7 @@ jobs:
name: Bash Syntax Check
command: |
apk add bash
for f in unleash lib/*.sh examples/*.sh; do
for f in runaway lib/*.sh examples/*.sh; do
[ -f "$f" ] || continue
echo "Checking: $f"
bash -n "$f" || exit 1
+2 -2
View File
@@ -11,7 +11,7 @@ assignees: ''
A clear description of what is not working.
**To reproduce**
1. Run `./unleash <command>` from Recovery / booted system
1. Run `./runaway <command>` from Recovery / booted system
2. See error: ...
**Expected behavior**
@@ -24,7 +24,7 @@ What should have happened instead.
- FileVault: (Enabled / Disabled)
**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**
Anything else relevant.
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: Feature request
about: Suggest an idea for unleash
about: Suggest an idea for runaway
title: ''
labels: enhancement
assignees: ''
+2 -2
View File
@@ -16,7 +16,7 @@ jobs:
run: sudo apt-get update -qq && sudo apt-get install -y -qq shellcheck
- name: Run ShellCheck
run: |
for f in unleash lib/*.sh examples/*.sh; do
for f in runaway lib/*.sh examples/*.sh; do
[ -f "$f" ] || continue
echo "Checking: $f"
shellcheck -S warning "$f" || exit 1
@@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@v7
- name: Check syntax
run: |
for f in unleash lib/*.sh examples/*.sh; do
for f in runaway lib/*.sh examples/*.sh; do
[ -f "$f" ] || continue
echo "Checking: $f"
bash -n "$f" || exit 1
+8 -8
View File
@@ -6,20 +6,20 @@ on:
jobs:
update-homebrew:
name: Update homebrew-unleash formula
name: Update homebrew-runaway formula
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
repository: mateussiqueira/homebrew-unleash
repository: mateussiqueira/homebrew-runaway
token: ${{ secrets.GH_PAT || github.token }}
- name: Download release artifact and compute SHA
id: sha
run: |
TAG="${{ github.event.release.tag_name }}"
curl -sL "https://github.com/mateussiqueira/unleash/releases/download/${TAG}/unleash-standalone.sh" -o /tmp/unleash-standalone.sh
SHA=$(shasum -a 256 /tmp/unleash-standalone.sh | cut -d' ' -f1)
curl -sL "https://github.com/mateussiqueira/runaway/releases/download/${TAG}/runaway-standalone.sh" -o /tmp/runaway-standalone.sh
SHA=$(shasum -a 256 /tmp/runaway-standalone.sh | cut -d' ' -f1)
echo "sha=${SHA}" >> $GITHUB_OUTPUT
echo "tag=${TAG}" >> $GITHUB_OUTPUT
@@ -30,14 +30,14 @@ jobs:
SHA="${{ steps.sha.outputs.sha }}"
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|version \".*\"|version \"${VERSION}\"|" Formula/unleash.rb
sed -i "s|sha256 \".*\"|sha256 \"${SHA}\"|" 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/runaway.rb
sed -i "s|sha256 \".*\"|sha256 \"${SHA}\"|" Formula/runaway.rb
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
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 push
+1 -1
View File
@@ -1,4 +1,4 @@
.unleash-backup/
.runaway-backup/
*.swp
*.swo
.DS_Store
+5 -5
View File
@@ -25,7 +25,7 @@
## [1.6.1] — 2026-06-20
### 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)
- LICENSE added to standalone binary header
@@ -37,8 +37,8 @@
## [1.6.0] — 2026-06-20
### Added
- **Homebrew tap**: `brew install mateussiqueira/unleash/unleash`
- **GitHub Pages**: full command reference at https://mateussiqueira.github.io/unleash/
- **Homebrew tap**: `brew install mateussiqueira/runaway/runaway`
- **GitHub Pages**: full command reference at https://mateussiqueira.github.io/runaway/
- **README.pt-BR.md**: Brazilian Portuguese translation
- **Bats tests**: doctor, whitelist, config, check, history, uninstall modules
- **docs/index.md**: landing page for GitHub Pages
@@ -69,7 +69,7 @@
## [1.3.0] — 2026-06-20
### Added
- **config**: Persistent settings in ~/.unleash.conf
- **config**: Persistent settings in ~/.runaway.conf
- **test** command / `--dry-run` global flag
- **history / history-clear**: Event log viewer
- Structured logging (levels, timestamps, color, file output)
@@ -102,7 +102,7 @@
## [1.0.0] — 2026-06-20
### 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)
- **suppress**: Suppress MDM enrollment without creating a user
- **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
@@ -20,8 +20,8 @@ This project follows a [Code of Conduct](CODE_OF_CONDUCT.md). By participating,
2. Create a feature branch from `main`
3. Follow the existing code style (ShellCheck compliant)
4. Test your changes:
- Syntax check: `bash -n lib/*.sh unleash`
- ShellCheck: `shellcheck lib/*.sh unleash` (install via `brew install shellcheck`)
- Syntax check: `bash -n lib/*.sh runaway`
- ShellCheck: `shellcheck lib/*.sh runaway` (install via `brew install shellcheck`)
5. Update documentation (README.md) if adding features
6. Open a PR against `main`
+6 -6
View File
@@ -1,14 +1,14 @@
FROM alpine:latest AS builder
RUN apk add bash curl
WORKDIR /build
COPY unleash /build/
COPY runaway /build/
COPY lib/ /build/lib/
RUN bash -n unleash lib/*.sh
RUN bash -n runaway lib/*.sh
FROM alpine:latest
RUN apk add --no-cache bash curl
COPY --from=builder /build/ /opt/unleash/
RUN ln -s /opt/unleash/unleash /usr/local/bin/unleash
WORKDIR /opt/unleash
ENTRYPOINT ["/opt/unleash/unleash"]
COPY --from=builder /build/ /opt/runaway/
RUN ln -s /opt/runaway/runaway /usr/local/bin/runaway
WORKDIR /opt/runaway
ENTRYPOINT ["/opt/runaway/runaway"]
CMD ["--help"]
+1 -1
View File
@@ -10,7 +10,7 @@ build:
./examples/build-standalone.sh
clean:
rm -f unleash-standalone.sh
rm -f runaway-standalone.sh
ci: lint test
@echo "=== Markdown ==="
+13 -13
View File
@@ -1,28 +1,28 @@
# unleash — Quick Reference
# runaway — Quick Reference
Keep this on your SSD alongside the script.
## First time
1. Boot to Recovery (Apple Silicon: hold Power, Intel: Cmd+R)
2. Open Terminal → `chmod +x "/Volumes/YourSSD/unleash/unleash"`
3. Run → `"/Volumes/YourSSD/unleash/unleash"`
2. Open Terminal → `chmod +x "/Volumes/YourSSD/runaway/runaway"`
3. Run → `"/Volumes/YourSSD/runaway/runaway"`
4. Pick "Full bypass" from the menu
## Common scenarios
| Você quer... | Comando |
|---|---|
| Bypass completo (cria usuário admin) | `./unleash bypass` |
| Só silenciar o MDM (sem criar usuário) | `./unleash suppress` |
| Consertar depois de atualizar macOS | `sudo ./unleash heal` |
| Nunca mais pensar nisso | `sudo ./unleash persist` + `sudo ./unleash whitelist` |
| Saber se vai travar após formatar | `sudo ./unleash check` |
| Vigiar MDM em tempo real | `sudo ./unleash monitor` |
| Instalar monitor para sempre | `sudo ./unleash monitor-install` |
| Limpeza pós-bypass (já logado) | `sudo ./unleash harden` |
| Varredura completa | `sudo ./unleash audit` |
| Voltar ao normal | `./unleash restore` |
| Bypass completo (cria usuário admin) | `./runaway bypass` |
| Só silenciar o MDM (sem criar usuário) | `./runaway suppress` |
| Consertar depois de atualizar macOS | `sudo ./runaway heal` |
| Nunca mais pensar nisso | `sudo ./runaway persist` + `sudo ./runaway whitelist` |
| Saber se vai travar após formatar | `sudo ./runaway check` |
| Vigiar MDM em tempo real | `sudo ./runaway monitor` |
| Instalar monitor para sempre | `sudo ./runaway monitor-install` |
| Limpeza pós-bypass (já logado) | `sudo ./runaway harden` |
| Varredura completa | `sudo ./runaway audit` |
| Voltar ao normal | `./runaway restore` |
## Aliases
+62 -62
View File
@@ -1,8 +1,8 @@
<p align="center">
<img src="docs/icon.svg" width="120" alt="unleash logo">
<img src="docs/icon.svg" width="120" alt="runaway logo">
</p>
# unleash
# runaway
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
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:
- **Apple Silicon**: hold the power button until you see "Loading Startup Options", then click Options → Continue
- **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:
```bash
chmod +x "/Volumes/YourSSD/unleash/unleash"
"/Volumes/YourSSD/unleash/unleash"
chmod +x "/Volumes/YourSSD/runaway/runaway"
"/Volumes/YourSSD/runaway/runaway"
```
Pick "Full bypass" from the menu. Or if you know what you want:
```bash
"/Volumes/YourSSD/unleash/unleash" bypass
"/Volumes/YourSSD/runaway/runaway" bypass
```
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:
```bash
curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash-standalone.sh -o /tmp/unleash
chmod +x /tmp/unleash && /tmp/unleash bypass
curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/runaway-standalone.sh -o /tmp/runaway
chmod +x /tmp/runaway && /tmp/runaway bypass
```
---
@@ -44,7 +44,7 @@ chmod +x /tmp/unleash && /tmp/unleash bypass
### bypass — Full MDM bypass (Recovery only)
```bash
./unleash bypass
./runaway bypass
```
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
```bash
./unleash suppress
./runaway suppress
```
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)
```bash
./unleash admin
./runaway admin
```
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
```bash
sudo ./unleash heal # from booted system
./unleash heal # from Recovery
sudo ./runaway heal # from booted system
./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.
@@ -93,17 +93,17 @@ Checks if suppression is still intact. If any piece (DEP markers, hosts block, d
### persist — Boot-time auto-heal
```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.
### unpersist — Remove auto-heal
```bash
sudo ./unleash unpersist
sudo ./runaway unpersist
```
Removes the LaunchDaemon and unloads it.
@@ -111,7 +111,7 @@ Removes the LaunchDaemon and unloads it.
### firewall — Kernel-level MDM block
```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.
@@ -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
```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
```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.
@@ -137,7 +137,7 @@ Alternative to `firewall` that resolves only the essential MDM domains (mdmenrol
### harden — Live cleanup from booted system
```bash
sudo ./unleash harden
sudo ./runaway harden
```
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
```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).
@@ -161,7 +161,7 @@ Comprehensive scan that checks: installed profiles, enrollment state, keychain c
### status — MDM health check (Recovery only)
```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.
@@ -169,7 +169,7 @@ Shows DEP markers, hosts block, daemon overrides, profile enrollment, and backup
### check — Pre-format / pre-upgrade assessment
```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.
@@ -182,31 +182,31 @@ Returns one of two verdicts:
### monitor — Background MDM watcher
```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.
```bash
sudo ./unleash monitor-stop # stop it
sudo ./unleash monitor-status # check if it's running
sudo ./runaway monitor-stop # stop it
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
```bash
./unleash backup
./unleash restore
./runaway backup
./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
```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.
@@ -214,8 +214,8 @@ Same as bypass but lets you pick which volume to target (for external macOS inst
### version / help
```bash
./unleash version
./unleash help
./runaway version
./runaway help
```
---
@@ -249,14 +249,14 @@ Global options that can go before any command:
Example:
```bash
sudo ./unleash --verbose --log-file /tmp/unleash.log heal
sudo ./runaway --verbose --log-file /tmp/runaway.log heal
```
---
## 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
@@ -269,13 +269,13 @@ When an organization assigns a device in Apple Business Manager, macOS creates m
.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
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
- `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.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
@@ -321,11 +321,11 @@ Home directories carry MDM artifacts that trigger re-enrollment after login:
~/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)
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
- **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
**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
@@ -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)
5. Wait 10-30 minutes for restore to finish
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).
@@ -398,7 +398,7 @@ All commands now log with timestamps and levels:
[INF] Data volume: /Volumes/Macintosh HD - Data
[ OK] Admin 'apple' created (UID 501)
[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...
[DBG] Checking pfctl availability
```
@@ -408,8 +408,8 @@ Use `--verbose` to see debug messages and `--log-file <path>` to write everythin
## Files
```
unleash/
├── unleash # Main script (entry point)
runaway/
├── runaway # Main script (entry point)
├── lib/
│ ├── colors.sh # Logging, colors, prompts
│ ├── detect.sh # Recovery detection, volume mounting
@@ -432,7 +432,7 @@ unleash/
└── 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
@@ -444,7 +444,7 @@ The standalone variant (`unleash-standalone.sh`) bundles everything into one fil
## Safety
Unleash is designed to be safe:
Runaway is designed to be safe:
- **No SSV writes** — all changes target the Data volume
- **Reversible** — `backup` saves state, `restore` reverts
@@ -455,26 +455,26 @@ Unleash is designed to be safe:
## Troubleshooting
### 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
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
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"
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
[#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:
- The [original reporter](https://github.com/mateussiqueira/unleash/issues/22#issuecomment-6522921874)
reports Unleash 2.0.0 working on an M1 Pro after upgrading an existing Sequoia
- The [original reporter](https://github.com/mateussiqueira/runaway/issues/22#issuecomment-6522921874)
reports Runaway 2.0.0 working on an M1 Pro after upgrading an existing Sequoia
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).
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
[#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:
```bash
./unleash doctor --network
./runaway doctor --network
```
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,
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.
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.
### 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
@@ -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.
**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
+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.
@@ -8,30 +8,30 @@ Ferramenta única para bypass/supressão de MDM no macOS. Funciona do Modo de Re
```bash
# Homebrew (mais fácil)
brew install mateussiqueira/unleash/unleash
brew install mateussiqueira/runaway/runaway
# Download direto
curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash-standalone.sh -o unleash
chmod +x unleash && sudo ./unleash
curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/runaway-standalone.sh -o runaway
chmod +x runaway && sudo ./runaway
```
## 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:
- **Apple Silicon**: segure o botão de energia → Opções → Continuar
- **Intel**: Cmd+R na inicialização
3. Abra o Terminal (Utilitários) e execute:
```bash
chmod +x "/Volumes/SeuSSD/unleash/unleash"
"/Volumes/SeuSSD/unleash/unleash"
chmod +x "/Volumes/SeuSSD/runaway/runaway"
"/Volumes/SeuSSD/runaway/runaway"
```
Escolha "Full bypass" no menu. Ou use a linha de comando:
```bash
"/Volumes/SeuSSD/unleash/unleash" bypass
"/Volumes/SeuSSD/runaway/runaway" bypass
```
## 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?
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
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
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
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
**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.
**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
+5 -5
View File
@@ -5,7 +5,7 @@
### July — v1.7.0 "Solidify"
- [ ] **Resolve GitHub Actions billing** — re-enable CI/CD
- [ ] **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
- [ ] **Add `--help` flag** per command (currently only global `-h`)
@@ -19,7 +19,7 @@
### September — v2.0.0 "Foundation"
- [ ] **Homebrew core** — submit PR to official Homebrew/homebrew-core
- [ ] **`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
- [ ] **Self-update with GPG verification**
@@ -35,7 +35,7 @@
### November — v2.2.0 "Intelligence"
- [ ] **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)
- [ ] **Discord bot** — monitor MDM status via Discord DM
@@ -50,7 +50,7 @@
## Stretch goals (if time/budget allows)
- **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
- **Localization** — Spanish, French, German command output
- **CI/CD with `act`** — documented local CI workflow for offline development
@@ -59,4 +59,4 @@
## 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:
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
## Safety Guarantees
- **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 ABM modification**: Does not touch Apple Business Manager records
## Known Limitations
- 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)
+5 -5
View File
@@ -1,22 +1,22 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.stdenv.mkDerivation rec {
pname = "unleash";
pname = "runaway";
version = "1.6.1";
src = ./.;
installPhase = ''
mkdir -p $out/bin
cp unleash $out/bin/
chmod +x $out/bin/unleash
cp runaway $out/bin/
chmod +x $out/bin/runaway
cp -r lib $out/lib/
cp -r examples $out/share/unleash/
cp -r examples $out/share/runaway/
'';
meta = with pkgs.lib; {
description = "Single-script MDM bypass for macOS";
homepage = "https://github.com/mateussiqueira/unleash";
homepage = "https://github.com/mateussiqueira/runaway";
license = licenses.mit;
platforms = platforms.darwin;
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
url: "https://unleash-nine.vercel.app"
url: "https://runaway-nine.vercel.app"
baseurl: ""
theme: jekyll-theme-cayman
markdown: kramdown
+3 -3
View File
@@ -19,7 +19,7 @@
<a id="skip-to-content" href="#content">Skip to the content.</a>
<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">
<input type="text" id="search-input" placeholder="Search docs..." autocomplete="off">
@@ -41,8 +41,8 @@
<a href="/security" data-pt="/pt/security">Security</a>
<h3>External</h3>
<a href="https://github.com/mateussiqueira/unleash" 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" target="_blank">GitHub</a>
<a href="https://github.com/mateussiqueira/runaway/blob/main/CHANGELOG.md" target="_blank">Changelog</a>
</nav>
<header class="page-header" role="banner">
+48 -48
View File
@@ -1,6 +1,6 @@
---
layout: default
title: Commands Reference — unleash
title: Commands Reference — runaway
---
# Commands Reference
@@ -19,34 +19,34 @@ title: Commands Reference — unleash
Creates a temporary admin account and suppresses all 5 layers of MDM.
**Must run from Recovery.**
```bash
./unleash bypass
./runaway bypass
```
### `suppress`
Silences MDM enrollment without creating a new user.
Works from both Recovery and booted systems.
```bash
sudo ./unleash suppress
sudo ./runaway suppress
```
### `heal`
Re-applies suppression after macOS updates re-enable enrollment daemons.
On booted systems, needs sudo. With `persist`, runs automatically on each boot.
```bash
sudo ./unleash heal
sudo ./runaway heal
```
### `persist`
Installs a LaunchDaemon that runs `heal` automatically on every boot.
Survives macOS updates.
```bash
sudo ./unleash persist
sudo ./runaway persist
```
### `unpersist`
Removes the persistence LaunchDaemon.
```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.
**Warning:** Breaks iCloud, App Store, and system updates.
```bash
sudo ./unleash firewall
sudo ./runaway firewall
```
### `firewall-off`
Removes pf firewall rules added by `firewall`.
```bash
sudo ./unleash firewall-off
sudo ./runaway firewall-off
```
### `whitelist`
Resolves only MDM domains to IPs and blocks those specifically.
Keeps iCloud and App Store working while blocking MDM enrollment.
```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.
Useful when MDM is actively enrolling on a booted system.
```bash
sudo ./unleash harden
sudo ./runaway harden
```
### `audit`
@@ -104,7 +104,7 @@ Performs a deep MDM scan:
- Searches for MDM certificates
- Generates a risk score (0–100)
```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).
Also checks upgrade safety for macOS updates.
```bash
sudo ./unleash check
sudo ./runaway check
```
### `monitor`
@@ -134,14 +134,14 @@ Background daemon that checks MDM state every 5 minutes.
Sends a macOS notification if MDM tries to re-enroll.
Supports optional `--webhook` for Discord alerts.
```bash
sudo ./unleash monitor
sudo ./unleash monitor --webhook https://discord.com/api/webhooks/...
sudo ./runaway monitor
sudo ./runaway monitor --webhook https://discord.com/api/webhooks/...
```
### `history`
Shows the event log from previous monitor and heal runs.
```bash
sudo ./unleash history
sudo ./runaway history
```
---
@@ -155,21 +155,21 @@ sudo ./unleash history
| `dualboot` | Target an external macOS install |
### `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
sudo ./unleash backup
sudo ./runaway backup
```
### `restore`
Reverts the system to a previously saved state.
```bash
sudo ./unleash restore
sudo ./runaway restore
```
### `dualboot`
Creates an admin account and applies suppression to an external/bootcamp volume.
```bash
sudo ./unleash dualboot
sudo ./runaway dualboot
```
---
@@ -188,35 +188,35 @@ sudo ./unleash dualboot
Interactive wizard that runs the full setup:
firewall → monitor → persist → backup → audit.
```bash
sudo ./unleash init
sudo ./runaway init
```
### `suggest`
Analyzes your system and provides risk-based recommendations.
```bash
sudo ./unleash suggest
sudo ./runaway suggest
```
### `remediate`
Per-org MDM cleanup. Supports: JAMF, Mosyle, Addigy, Kandji, VMware.
Auto-detects the org from your DEP record.
```bash
sudo ./unleash remediate
sudo ./runaway remediate
```
### `predict`
Reads the serial number prefix and checks against known MDM org prefixes.
Useful before buying a used Mac.
```bash
./unleash predict ABC12345678
./runaway predict ABC12345678
```
### `telemetry`
Manages anonymous usage stats (opt-in, OFF by default).
```bash
./unleash telemetry on
./unleash telemetry off
./unleash telemetry status
./runaway telemetry on
./runaway telemetry off
./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.
Blocks MDM IPs when the device is NOT connected to your VPN tunnel.
```bash
sudo ./unleash vpn-kill
sudo ./unleash vpn-kill-status
sudo ./unleash vpn-kill-remove
sudo ./runaway vpn-kill
sudo ./runaway vpn-kill-status
sudo ./runaway vpn-kill-remove
```
---
@@ -254,40 +254,40 @@ sudo ./unleash vpn-kill-remove
### `update`
Downloads the latest release from GitHub. GPG-verifies the signature.
```bash
sudo ./unleash update
sudo ./runaway update
```
### `uninstall`
Removes all Unleash traces. Prompts for confirmation.
Removes all Runaway traces. Prompts for confirmation.
```bash
sudo ./unleash uninstall
sudo ./runaway uninstall
```
### `reinstall`
Uninstalls then re-applies persist + whitelist + monitor.
```bash
sudo ./unleash reinstall
sudo ./runaway reinstall
```
### `config`
View or edit persistent settings in `~/.unleash.conf`.
View or edit persistent settings in `~/.runaway.conf`.
```bash
./unleash config
./unleash config show
./unleash config set key value
./runaway config
./runaway config show
./runaway config set key value
```
### `report`
Generates a full status report. Supports `--json` for machine-readable output.
```bash
sudo ./unleash report
sudo ./unleash report --json
sudo ./runaway report
sudo ./runaway report --json
```
### `demo`
Runs a simulated bypass flow. No real changes are made.
```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.
```bash
sudo ./unleash discord-bot <token> <userId>
sudo ./unleash discord-bot-status
sudo ./unleash discord-bot-stop
sudo ./runaway discord-bot <token> <userId>
sudo ./runaway discord-bot-status
sudo ./runaway discord-bot-stop
```
---
@@ -321,22 +321,22 @@ sudo ./unleash discord-bot-stop
Checks: root privileges, Recovery mode detection, bash version,
disk/volume availability required libraries, and internet connectivity.
```bash
./unleash doctor
./runaway doctor
```
### `status`
Shows DEP marker state, hosts file, daemon overrides.
Only works from Recovery. Use `check` or `audit` on booted systems.
```bash
./unleash status
./unleash status -d
./runaway status
./runaway status -d
```
### `test`
Dry-run mode. Simulates a command without making real changes.
```bash
./unleash test bypass
./unleash test all
./runaway test bypass
./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
unleash v1.6.0
$ sudo ./runaway --version
runaway v1.6.0
$ sudo ./unleash check
$ sudo ./runaway check
[DRY-RUN] System Assessment
✓ Recovery mode: yes
✓ Data volume: /Volumes/Data (123.4 GB free)
@@ -13,7 +13,7 @@ $ sudo ./unleash check
⚠ Previous bypass: detected
VP>: SAFE TO FORMAT (no active MDM record)
$ sudo ./unleash audit
$ sudo ./runaway audit
[AUDIT] Deep MDM Scan
Active profiles: 0
DEP enrollment: clean
@@ -21,14 +21,14 @@ $ sudo ./unleash audit
Daemon overrides: 4/4 active
Risk score: 0 (LOW)
$ sudo ./unleash status -d
$ sudo ./runaway status -d
[ OK] System: clean
[ OK] Profiles: 0
[INF] MDM: no enrollment found
[INF] User artifacts: none
[ OK] Last check: 30s ago
$ sudo ./unleash report --json
$ sudo ./runaway report --json
{
"version": "1.6.0",
"platform": "darwin",
+7 -7
View File
@@ -4,13 +4,13 @@
<circle cx="18" cy="16" r="6" fill="#f38ba8"/>
<circle cx="36" cy="16" r="6" fill="#fab387"/>
<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="80" fill="#cdd6f4" xml:space="preserve">unleash v1.6.0</text>
<text x="16" y="100" fill="#89b4fa" xml:space="preserve">$ sudo ./unleash doctor</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">runaway v1.6.0</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="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="32" y="134" fill="#cdd6f4">Library files: 22/22 modules loaded</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="16" y="182" fill="#a6e3a1">✓</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="32" y="220" fill="#cdd6f4">Recovery mode: yes</text>
<text x="16" y="236" fill="#a6e3a1">✓</text>
@@ -29,7 +29,7 @@
<text x="16" y="268" fill="#a6e3a1">✓</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="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="346" fill="#cdd6f4"> "version": "1.6.0", "arch": "arm64",</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
title: FAQ — unleash
title: FAQ — runaway
---
# FAQ
@@ -13,7 +13,7 @@ title: FAQ — unleash
### 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)
- 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?
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?
@@ -50,13 +50,13 @@ Yes. Use `whitelist` instead of `firewall` or the basic `suppress`. It resolves
### 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?
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.
@@ -65,7 +65,7 @@ MIT. Free to use, modify, and distribute.
### How do I know if my Mac is enrolled in MDM?
```bash
sudo ./unleash check
sudo ./runaway check
```
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?
```bash
sudo ./unleash status -d
sudo ./runaway status -d
```
Checks DEP markers, hosts file, daemon overrides, and profile enrollment state.
### `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`?
@@ -104,12 +104,12 @@ It reads the serial number prefix and checks it against known MDM org prefixes (
Run from Recovery:
```bash
sudo ./unleash suppress
sudo ./runaway suppress
```
Or from a booted system:
```bash
sudo ./unleash harden
sudo ./runaway harden
```
### "Not a known DirStatus" error
@@ -118,7 +118,7 @@ Volume auto-detection failed. Find your Data volume:
```bash
diskutil list
diskutil mount /dev/diskXsY
./unleash bypass
./runaway bypass
```
### 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"
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
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
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
title: Architecture Guide — unleash
title: Architecture Guide — runaway
---
# Architecture Guide
## 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 2: Hosts block ─── /etc/hosts → 0.0.0.0 deviceenrollment.apple.com
Layer 3: Daemons ─── launchd disabled → ManagedClient.enroll, activationd
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
@@ -100,8 +100,8 @@ pf (packet filter) operates at the kernel networking layer, below DNS resolution
## Script Architecture
```
unleash/
├── unleash # Main entry point — loads libs, dispatches commands
runaway/
├── runaway # Main entry point — loads libs, dispatches commands
├── lib/
│ ├── colors.sh # Logging, colors, prompts, show_cmd_help()
│ ├── detect.sh # Recovery detection, volume mounting
@@ -138,28 +138,28 @@ unleash/
### Dispatch Flow
1. `unleash` loads all `lib/*.sh` modules
2. `load_config()` reads `~/.unleash.conf` (if exists)
1. `runaway` loads all `lib/*.sh` modules
2. `load_config()` reads `~/.runaway.conf` (if exists)
3. Command argument is matched against the `case` dispatch in main
4. Handler function is called (e.g., `cmd_bypass`, `cmd_firewall`)
5. Each handler calls lib functions that do the actual work
### 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
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
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
5. **Release**: GitHub release with standalone + signature + checksums
## Security Design
### 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
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"/>
<!-- 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>

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

+49 -49
View File
@@ -1,13 +1,13 @@
---
layout: default
title: unleash
title: runaway
description: Single-script MDM bypass for macOS — covers all 5 layers of Apple MDM enrollment
---
<p align="center">
<img src="icon.svg" width="100" alt="unleash logo">
<img src="icon.svg" width="100" alt="runaway logo">
<br>
<strong>unleash</strong>
<strong>runaway</strong>
<br>
<em>Single-script MDM bypass for macOS</em>
</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.
- **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.
- **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.
@@ -40,19 +40,19 @@ unleash replaces the original five bypass-mdm scripts with a single file that ha
**Homebrew (easiest)**
```bash
brew install mateussiqueira/unleash/unleash
brew install mateussiqueira/runaway/runaway
```
**Direct download**
```bash
curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash-standalone.sh -o unleash
chmod +x unleash
curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/runaway-standalone.sh -o runaway
chmod +x runaway
```
**From a USB drive (for Recovery mode)**
1. Format a USB/SSD as FAT32, APFS, or exFAT
2. Copy the `unleash` folder (or just `unleash-standalone.sh`) to the drive
3. Boot to Recovery and run from `/Volumes/YourDrive/unleash`
2. Copy the `runaway` folder (or just `runaway-standalone.sh`) to the drive
3. Boot to Recovery and run from `/Volumes/YourDrive/runaway`
---
@@ -68,7 +68,7 @@ chmod +x unleash
3. Run:
```bash
"/Volumes/YourDrive/unleash" bypass
"/Volumes/YourDrive/runaway" bypass
```
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:
```bash
sudo ./unleash heal
sudo ./runaway heal
```
Or to check your current status:
```bash
sudo ./unleash status -d
sudo ./runaway status -d
```
### One-command setup (new Mac)
```bash
sudo ./unleash init
sudo ./runaway init
```
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) |
| `uninstall` | Complete removal with safety prompts |
| `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 |
| `restore` | Restore from a previous backup |
| `demo` | Simulated bypass flow — no real changes |
@@ -205,8 +205,8 @@ dbs = discord-bot-stop dbs2 = discord-bot-status
### Before buying a used Mac
```bash
./unleash predict ABC12345678 # check serial against known org prefixes
./unleash check # is this Mac safe to wipe?
./runaway predict ABC12345678 # check serial against known org prefixes
./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.
@@ -217,14 +217,14 @@ dbs = discord-bot-stop dbs2 = discord-bot-status
2. Migration Assistant copies your old data
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
1. System update restores enrollment daemons automatically
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
@@ -233,23 +233,23 @@ dbs = discord-bot-stop dbs2 = discord-bot-status
**Strategy**:
- Boot to Recovery without connecting to Wi-Fi
- Run `unleash bypass` before the device ever phones home
- Run `unleash persist` and `unleash whitelist` so it stays clean
- Run `runaway bypass` before the device ever phones home
- 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
### Used Mac that already has a user logged in
```bash
sudo ./unleash audit # check current state
sudo ./unleash harden # kill MDM processes immediately
sudo ./unleash whitelist # block MDM while keeping iCloud
sudo ./unleash persist # survive future updates
sudo ./runaway audit # check current state
sudo ./runaway harden # kill MDM processes immediately
sudo ./runaway whitelist # block MDM while keeping iCloud
sudo ./runaway persist # survive future updates
```
### Setting up a new Mac before first boot
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
4. Reboot, set up normally, MDM never bothers you
@@ -257,7 +257,7 @@ sudo ./unleash persist # survive future updates
## 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**
@@ -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.
**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
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.
- **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.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
@@ -322,7 +322,7 @@ Migration Assistant and login caches leave MDM enrollment data in home directori
~/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)
@@ -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:
```bash
sudo ./unleash suppress
sudo ./runaway suppress
```
Or from a booted system:
```bash
sudo ./unleash harden
sudo ./runaway harden
```
### "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:
1. Run `diskutil list` to find your Data volume
2. Mount it: `diskutil mount /dev/diskXsY`
3. Re-run unleash
3. Re-run runaway
### 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:
```bash
sudo ./unleash status -d
sudo ./runaway status -d
```
### 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
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?
@@ -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
3. In Configurator: right-click the DFU device → Advanced → Restore
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).
@@ -430,7 +430,7 @@ All commands log with timestamps and levels:
[INF] Data volume: /Volumes/Macintosh HD - Data
[ OK] Admin 'apple' created (UID 501)
[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...
[DBG] Checking pfctl availability
```
@@ -451,14 +451,14 @@ Use `--verbose` for debug messages and `--log-file <path>` to write everything t
## Links
- [GitHub Repository](https://github.com/mateussiqueira/unleash)
- [Full README](https://github.com/mateussiqueira/unleash/blob/main/README.md)
- [GitHub Repository](https://github.com/mateussiqueira/runaway)
- [Full README](https://github.com/mateussiqueira/runaway/blob/main/README.md)
- [Architecture Guide](guide)
- [FAQ](faq)
- [Quick Reference (QUICKSTART.md)](https://github.com/mateussiqueira/unleash/blob/main/QUICKSTART.md)
- [Changelog](https://github.com/mateussiqueira/unleash/blob/main/CHANGELOG.md)
- [Contributing](https://github.com/mateussiqueira/unleash/blob/main/CONTRIBUTING.md)
- [Code of Conduct](https://github.com/mateussiqueira/unleash/blob/main/CODE_OF_CONDUCT.md)
- [Security Policy](https://github.com/mateussiqueira/unleash/blob/main/SECURITY.md)
- [Discussions](https://github.com/mateussiqueira/unleash/discussions)
- [Report a Bug](https://github.com/mateussiqueira/unleash/issues/new?template=bug_report.md)
- [Quick Reference (QUICKSTART.md)](https://github.com/mateussiqueira/runaway/blob/main/QUICKSTART.md)
- [Changelog](https://github.com/mateussiqueira/runaway/blob/main/CHANGELOG.md)
- [Contributing](https://github.com/mateussiqueira/runaway/blob/main/CONTRIBUTING.md)
- [Code of Conduct](https://github.com/mateussiqueira/runaway/blob/main/CODE_OF_CONDUCT.md)
- [Security Policy](https://github.com/mateussiqueira/runaway/blob/main/SECURITY.md)
- [Discussions](https://github.com/mateussiqueira/runaway/discussions)
- [Report a Bug](https://github.com/mateussiqueira/runaway/issues/new?template=bug_report.md)
+17 -17
View File
@@ -1,6 +1,6 @@
---
layout: default
title: Installation — unleash
title: Installation — runaway
---
# Installation
@@ -8,51 +8,51 @@ title: Installation — unleash
## Homebrew (easiest)
```bash
brew tap mateussiqueira/unleash
brew install unleash
brew tap mateussiqueira/runaway
brew install runaway
```
Or in one step:
```bash
brew install mateussiqueira/unleash/unleash
brew install mateussiqueira/runaway/runaway
```
## Direct download
```bash
curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash-standalone.sh -o unleash
chmod +x unleash
sudo ./unleash init
curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/runaway-standalone.sh -o runaway
chmod +x runaway
sudo ./runaway init
```
## From a USB drive (for Recovery mode)
1. Format a USB/SSD as **FAT32**, **APFS**, or **exFAT**
2. Copy the `unleash` folder (or just `unleash-standalone.sh`) to the drive
3. Boot to Recovery and run from `/Volumes/YourDrive/unleash`
2. Copy the `runaway` folder (or just `runaway-standalone.sh`) to the drive
3. Boot to Recovery and run from `/Volumes/YourDrive/runaway`
## Via curl in Recovery (needs internet)
```bash
curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash -o /tmp/unleash
chmod +x /tmp/unleash && /tmp/unleash bypass
curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/runaway -o /tmp/runaway
chmod +x /tmp/runaway && /tmp/runaway bypass
```
## Building from source
```bash
git clone https://github.com/mateussiqueira/unleash.git
cd unleash
git clone https://github.com/mateussiqueira/runaway.git
cd runaway
bash examples/build-standalone.sh
# Output: unleash-standalone.sh (~3200 lines)
# Output: runaway-standalone.sh (~3200 lines)
```
## Verifying the installation
```bash
./unleash version
# → unleash v2.0.0
./runaway version
# → runaway v2.0.0
./unleash doctor
./runaway doctor
# Runs pre-flight diagnostics
```
+2 -2
View File
@@ -18,10 +18,10 @@
<circle cx="78" cy="80" r="6" fill="#f38ba8"/>
<circle cx="96" cy="80" r="6" fill="#fab387"/>
<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 -->
<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 -->
<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
title: Referência de Comandos — unleash
title: Referência de Comandos — runaway
---
# 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.
**Deve executar do Recovery.**
```bash
./unleash bypass
./runaway bypass
```
### `suppress`
Silencia o registro MDM sem criar um novo usuário.
Funciona tanto do Recovery quanto do sistema já iniciado.
```bash
sudo ./unleash suppress
sudo ./runaway suppress
```
### `heal`
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.
```bash
sudo ./unleash heal
sudo ./runaway heal
```
### `persist`
Instala um LaunchDaemon que executa `heal` automaticamente em cada inicialização.
Sobrevive a atualizações do macOS.
```bash
sudo ./unleash persist
sudo ./runaway persist
```
### `unpersist`
Remove o LaunchDaemon de persistência.
```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.
**Aviso:** Quebra iCloud, App Store e atualizações do sistema.
```bash
sudo ./unleash firewall
sudo ./runaway firewall
```
### `firewall-off`
Remove as regras pf adicionadas por `firewall`.
```bash
sudo ./unleash firewall-off
sudo ./runaway firewall-off
```
### `whitelist`
Resolve apenas domínios MDM para IPs e bloqueia especificamente aqueles.
Mantém iCloud e App Store funcionando enquanto bloqueia o registro MDM.
```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.
Útil quando o MDM está registrando ativamente em um sistema já iniciado.
```bash
sudo ./unleash harden
sudo ./runaway harden
```
### `audit`
@@ -104,7 +104,7 @@ Executa uma varredura MDM profunda:
- Procura certificados MDM
- Gera um score de risco (0–100)
```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).
Também verifica segurança para atualizações do macOS.
```bash
sudo ./unleash check
sudo ./runaway check
```
### `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.
Suporta `--webhook` opcional para alertas no Discord.
```bash
sudo ./unleash monitor
sudo ./unleash monitor --webhook https://discord.com/api/webhooks/...
sudo ./runaway monitor
sudo ./runaway monitor --webhook https://discord.com/api/webhooks/...
```
### `history`
Mostra o log de eventos de execuções anteriores do monitor e heal.
```bash
sudo ./unleash history
sudo ./runaway history
```
---
@@ -155,21 +155,21 @@ sudo ./unleash history
| `dualboot` | Mira uma instalação macOS externa |
### `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
sudo ./unleash backup
sudo ./runaway backup
```
### `restore`
Reverte o sistema para um estado salvo anteriormente.
```bash
sudo ./unleash restore
sudo ./runaway restore
```
### `dualboot`
Cria uma conta admin e aplica supressão em um volume externo/bootcamp.
```bash
sudo ./unleash dualboot
sudo ./runaway dualboot
```
---
@@ -188,35 +188,35 @@ sudo ./unleash dualboot
Assistente interativo que executa a configuração completa:
firewall → monitor → persist → backup → audit.
```bash
sudo ./unleash init
sudo ./runaway init
```
### `suggest`
Analisa seu sistema e fornece recomendações baseadas em risco.
```bash
sudo ./unleash suggest
sudo ./runaway suggest
```
### `remediate`
Limpeza MDM por organização. Suporta: JAMF, Mosyle, Addigy, Kandji, VMware.
Detecta automaticamente a organização a partir do registro DEP.
```bash
sudo ./unleash remediate
sudo ./runaway remediate
```
### `predict`
Lê o prefixo do número serial e verifica contra prefixos conhecidos de organizações MDM.
Útil antes de comprar um Mac usado.
```bash
./unleash predict ABC12345678
./runaway predict ABC12345678
```
### `telemetry`
Gerencia estatísticas anônimas de uso (opt-in, DESLIGADO por padrão).
```bash
./unleash telemetry on
./unleash telemetry off
./unleash telemetry status
./runaway telemetry on
./runaway telemetry off
./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.
Bloqueia IPs MDM quando o dispositivo NÃO está conectado ao túnel VPN.
```bash
sudo ./unleash vpn-kill
sudo ./unleash vpn-kill-status
sudo ./unleash vpn-kill-remove
sudo ./runaway vpn-kill
sudo ./runaway vpn-kill-status
sudo ./runaway vpn-kill-remove
```
---
@@ -254,40 +254,40 @@ sudo ./unleash vpn-kill-remove
### `update`
Baixa o último release do GitHub. Verifica a assinatura GPG.
```bash
sudo ./unleash update
sudo ./runaway update
```
### `uninstall`
Remove todos os vestígios do Unleash. Pede confirmação.
Remove todos os vestígios do Runaway. Pede confirmação.
```bash
sudo ./unleash uninstall
sudo ./runaway uninstall
```
### `reinstall`
Desinstala e então reaplica persist + whitelist + monitor.
```bash
sudo ./unleash reinstall
sudo ./runaway reinstall
```
### `config`
Ver ou editar configurações persistentes em `~/.unleash.conf`.
Ver ou editar configurações persistentes em `~/.runaway.conf`.
```bash
./unleash config
./unleash config show
./unleash config set key value
./runaway config
./runaway config show
./runaway config set key value
```
### `report`
Gera um relatório completo de status. Suporta `--json` para saída legível por máquina.
```bash
sudo ./unleash report
sudo ./unleash report --json
sudo ./runaway report
sudo ./runaway report --json
```
### `demo`
Executa um fluxo de bypass simulado. Nenhuma alteração real é feita.
```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.
```bash
sudo ./unleash discord-bot <token> <userId>
sudo ./unleash discord-bot-status
sudo ./unleash discord-bot-stop
sudo ./runaway discord-bot <token> <userId>
sudo ./runaway discord-bot-status
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,
disco/volume, bibliotecas necessárias e conectividade com a internet.
```bash
./unleash doctor
./runaway doctor
```
### `status`
Mostra estado dos marcadores DEP, arquivo hosts, overrides de daemon.
Só funciona do Recovery. Use `check` ou `audit` em sistemas já iniciados.
```bash
./unleash status
./unleash status -d
./runaway status
./runaway status -d
```
### `test`
Modo dry-run. Simula um comando sem fazer alterações reais.
```bash
./unleash test bypass
./unleash test all
./runaway test bypass
./runaway test all
```
---
+14 -14
View File
@@ -1,6 +1,6 @@
---
layout: default
title: FAQ — unleash
title: FAQ — runaway
---
# FAQ
@@ -13,7 +13,7 @@ title: FAQ — unleash
### É 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)
- 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?
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?
@@ -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?
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?
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?
@@ -65,7 +65,7 @@ MIT. Gratuito para usar, modificar e distribuir.
### Como saber se meu Mac está registrado no MDM?
```bash
sudo ./unleash check
sudo ./runaway check
```
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?
```bash
sudo ./unleash status -d
sudo ./runaway status -d
```
Verifica marcadores DEP, arquivo hosts, overrides de daemon e estado dos perfis.
### `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`?
@@ -104,12 +104,12 @@ Ele lê o prefixo do número serial e verifica contra prefixos conhecidos de org
Execute do Recovery:
```bash
sudo ./unleash suppress
sudo ./runaway suppress
```
Ou de um sistema já iniciado:
```bash
sudo ./unleash harden
sudo ./runaway harden
```
### Erro "Not a known DirStatus"
@@ -118,7 +118,7 @@ A detecção automática de volume falhou. Encontre seu volume de Dados:
```bash
diskutil list
diskutil mount /dev/diskXsY
./unleash bypass
./runaway bypass
```
### 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"
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
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
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
title: Guia de Arquitetura — unleash
title: Guia de Arquitetura — runaway
---
# Guia de Arquitetura
## 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 2: Bloqueio hosts ─── /etc/hosts → 0.0.0.0 deviceenrollment.apple.com
Camada 3: Daemons ─── launchd desabilitado → ManagedClient.enroll, activationd
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
@@ -100,8 +100,8 @@ pf (packet filter) opera na camada de rede do kernel, abaixo da resolução DNS.
## Arquitetura do Script
```
unleash/
├── unleash # Ponto de entrada principal
runaway/
├── runaway # Ponto de entrada principal
├── lib/
│ ├── colors.sh # Logging, cores, prompts, show_cmd_help()
│ ├── detect.sh # Detecção de Recovery, montagem de volume
@@ -138,28 +138,28 @@ unleash/
### Fluxo de Dispatch
1. `unleash` carrega todos os módulos `lib/*.sh`
2. `load_config()` lê `~/.unleash.conf` (se existir)
1. `runaway` carrega todos os módulos `lib/*.sh`
2. `load_config()` lê `~/.runaway.conf` (se existir)
3. O argumento do comando é casado com o `case` dispatch no main
4. A função handler é chamada (ex.: `cmd_bypass`, `cmd_firewall`)
5. Cada handler chama funções lib que fazem o trabalho real
### 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
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
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
5. **Release**: Release GitHub com standalone + assinatura + checksums
## Design de Segurança
### 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 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
title: unleash
title: runaway
description: Bypass MDM em um único script para macOS — cobre todas as 5 camadas do MDM da Apple
---
<p align="center">
<img src="../icon.svg" width="100" alt="unleash logo">
<img src="../icon.svg" width="100" alt="runaway logo">
<br>
<strong>unleash</strong>
<strong>runaway</strong>
<br>
<em>unleash</em>
<em>runaway</em>
</p>
<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.
- **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.
- **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.
@@ -40,19 +40,19 @@ unleash substitui os cinco scripts originais do bypass-mdm em um único arquivo
**Homebrew (mais fácil)**
```bash
brew install mateussiqueira/unleash/unleash
brew install mateussiqueira/runaway/runaway
```
**Download direto**
```bash
curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash-standalone.sh -o unleash
chmod +x unleash
curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/runaway-standalone.sh -o runaway
chmod +x runaway
```
**De um pendrive USB (para o modo Recovery)**
1. Formate um USB/SSD como FAT32, APFS ou exFAT
2. Copie a pasta `unleash` (ou apenas `unleash-standalone.sh`) para o drive
3. Inicialize no Recovery e execute de `/Volumes/SeuDrive/unleash`
2. Copie a pasta `runaway` (ou apenas `runaway-standalone.sh`) para o drive
3. Inicialize no Recovery e execute de `/Volumes/SeuDrive/runaway`
---
@@ -68,7 +68,7 @@ chmod +x unleash
3. Execute:
```bash
"/Volumes/SeuDrive/unleash" bypass
"/Volumes/SeuDrive/runaway" bypass
```
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:
```bash
sudo ./unleash heal
sudo ./runaway heal
```
Ou para verificar o status atual:
```bash
sudo ./unleash status -d
sudo ./runaway status -d
```
### Configuração com um comando (Mac novo)
```bash
sudo ./unleash init
sudo ./runaway init
```
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) |
| `uninstall` | Remoção completa com confirmações de segurança |
| `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 |
| `restore` | Restaura a partir de um backup anterior |
| `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
```bash
./unleash predict ABC12345678 # verifica serial contra organizações conhecidas
./unleash check # este Mac é seguro para formatar?
./runaway predict ABC12345678 # verifica serial contra organizações conhecidas
./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.
@@ -217,19 +217,19 @@ dbs = discord-bot-stop dbs2 = discord-bot-status
2. O Migration Assistant copia seus dados antigos
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
1. A atualização do sistema restaura os daemons de registro automaticamente
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
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
4. Reinicie, configure normalmente, o MDM nunca incomoda
@@ -237,7 +237,7 @@ dbs = discord-bot-stop dbs2 = discord-bot-status
## 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**
@@ -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.
**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
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 (::).
- **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.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
@@ -303,7 +303,7 @@ O Migration Assistant e caches de login deixam dados de registro MDM nos diretó
~/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)
@@ -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:
```bash
sudo ./unleash suppress
sudo ./runaway suppress
```
Ou de um sistema já iniciado:
```bash
sudo ./unleash harden
sudo ./runaway harden
```
### 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:
1. Execute `diskutil list` para encontrar seu volume de Dados
2. Monte: `diskutil mount /dev/diskXsY`
3. Execute unleash novamente
3. Execute runaway novamente
### Perfis ainda mostram registro
Isso é cosmético. O macOS armazena estado de perfis no SSV (Volume Selado do Sistema). Verifique os marcadores DEP reais:
```bash
sudo ./unleash status -d
sudo ./runaway status -d
```
### 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
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?
@@ -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
3. No Configurator: clique com direito no dispositivo DFU → Advanced → Restore
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).
@@ -410,7 +410,7 @@ Todos os comandos registram com timestamps e níveis:
[INF] Data volume: /Volumes/Macintosh HD - Data
[ OK] Admin 'apple' created (UID 501)
[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...
[DBG] Checking pfctl availability
```
@@ -431,13 +431,13 @@ Use `--verbose` para mensagens de debug e `--log-file <caminho>` para escrever t
## Links
- [Repositório GitHub](https://github.com/mateussiqueira/unleash)
- [README completo](https://github.com/mateussiqueira/unleash/blob/main/README.md)
- [Repositório GitHub](https://github.com/mateussiqueira/runaway)
- [README completo](https://github.com/mateussiqueira/runaway/blob/main/README.md)
- [Guia de Arquitetura](guide)
- [FAQ](faq)
- [Changelog](https://github.com/mateussiqueira/unleash/blob/main/CHANGELOG.md)
- [Contribuindo](https://github.com/mateussiqueira/unleash/blob/main/CONTRIBUTING.md)
- [Código de Conduta](https://github.com/mateussiqueira/unleash/blob/main/CODE_OF_CONDUCT.md)
- [Política de Segurança](https://github.com/mateussiqueira/unleash/blob/main/SECURITY.md)
- [Discussões](https://github.com/mateussiqueira/unleash/discussions)
- [Reportar Bug](https://github.com/mateussiqueira/unleash/issues/new?template=bug_report.md)
- [Changelog](https://github.com/mateussiqueira/runaway/blob/main/CHANGELOG.md)
- [Contribuindo](https://github.com/mateussiqueira/runaway/blob/main/CONTRIBUTING.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/runaway/blob/main/SECURITY.md)
- [Discussões](https://github.com/mateussiqueira/runaway/discussions)
- [Reportar Bug](https://github.com/mateussiqueira/runaway/issues/new?template=bug_report.md)
+17 -17
View File
@@ -1,6 +1,6 @@
---
layout: default
title: Instalação — unleash
title: Instalação — runaway
---
# Instalação
@@ -8,51 +8,51 @@ title: Instalação — unleash
## Homebrew (mais fácil)
```bash
brew tap mateussiqueira/unleash
brew install unleash
brew tap mateussiqueira/runaway
brew install runaway
```
Ou em um passo:
```bash
brew install mateussiqueira/unleash/unleash
brew install mateussiqueira/runaway/runaway
```
## Download direto
```bash
curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash-standalone.sh -o unleash
chmod +x unleash
sudo ./unleash init
curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/runaway-standalone.sh -o runaway
chmod +x runaway
sudo ./runaway init
```
## De um pendrive USB (para o modo Recovery)
1. Formate um USB/SSD como **FAT32**, **APFS** ou **exFAT**
2. Copie a pasta `unleash` (ou apenas `unleash-standalone.sh`) para o drive
3. Inicialize no Recovery e execute de `/Volumes/SeuDrive/unleash`
2. Copie a pasta `runaway` (ou apenas `runaway-standalone.sh`) para o drive
3. Inicialize no Recovery e execute de `/Volumes/SeuDrive/runaway`
## Via curl no Recovery (precisa de internet)
```bash
curl -L https://raw.githubusercontent.com/mateussiqueira/unleash/main/unleash -o /tmp/unleash
chmod +x /tmp/unleash && /tmp/unleash bypass
curl -L https://raw.githubusercontent.com/mateussiqueira/runaway/main/runaway -o /tmp/runaway
chmod +x /tmp/runaway && /tmp/runaway bypass
```
## Compilando a partir do código-fonte
```bash
git clone https://github.com/mateussiqueira/unleash.git
cd unleash
git clone https://github.com/mateussiqueira/runaway.git
cd runaway
bash examples/build-standalone.sh
# Saída: unleash-standalone.sh (~3200 linhas)
# Saída: runaway-standalone.sh (~3200 linhas)
```
## Verificando a instalação
```bash
./unleash version
# → unleash v2.0.0
./runaway version
# → runaway v2.0.0
./unleash doctor
./runaway doctor
# Executa diagnósticos pré-voo
```
+21 -21
View File
@@ -1,6 +1,6 @@
---
layout: default
title: Cenários — unleash
title: Cenários — runaway
---
# Cenários
@@ -10,8 +10,8 @@ title: Cenários — unleash
Verifique o número serial antes de comprar:
```bash
./unleash predict ABC12345678 # verifica serial contra prefixos conhecidos
./unleash check # este Mac é seguro para limpar?
./runaway predict ABC12345678 # verifica serial contra prefixos conhecidos
./runaway check # este Mac é seguro para limpar?
```
`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:
```bash
./unleash suppress
./runaway suppress
```
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.
*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:**
```bash
sudo ./unleash heal
sudo ./runaway heal
```
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:**
1. Inicialize no Recovery **sem conectar ao Wi-Fi**
2. Execute `unleash bypass` antes do dispositivo contatar a Apple
3. Execute `unleash persist` e `unleash whitelist` para mantê-lo limpo
2. Execute `runaway bypass` antes do dispositivo contatar a Apple
3. Execute `runaway persist` e `runaway whitelist` para mantê-lo limpo
4. Só então conecte-se à internet
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
```bash
sudo ./unleash audit # verifica o estado atual
sudo ./unleash harden # mata processos MDM imediatamente
sudo ./unleash whitelist # bloqueia MDM mantendo iCloud
sudo ./unleash persist # sobrevive a atualizações futuras
sudo ./runaway audit # verifica o estado atual
sudo ./runaway harden # mata processos MDM imediatamente
sudo ./runaway whitelist # bloqueia MDM mantendo iCloud
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
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
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.
```bash
sudo ./unleash vpn-kill
sudo ./runaway vpn-kill
```
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
2. **Não conecte ao Wi-Fi**
3. Inicialize no Recovery
4. Execute `unleash bypass`
5. Execute `unleash persist && unleash whitelist`
4. Execute `runaway bypass`
5. Execute `runaway persist && runaway whitelist`
6. Reinicie e conecte-se à internet com segurança
---
@@ -120,15 +120,15 @@ Para implantar em múltiplas máquinas:
```bash
# Bypass via script
./unleash suppress --log-file /var/log/unleash-deploy.log
./runaway suppress --log-file /var/log/runaway-deploy.log
# Com persist + monitor
sudo ./unleash persist
sudo ./unleash monitor
sudo ./runaway persist
sudo ./runaway monitor
# Relatório de auditoria em JSON
sudo ./unleash report --json
sudo ./runaway report --json
# 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
title: Segurança — unleash
title: Segurança — runaway
---
# Segurança & Proteção
@@ -8,7 +8,7 @@ title: Segurança — unleash
## Princípios de Design
### 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**
apenas e são totalmente reversíveis.
@@ -58,4 +58,4 @@ precisam de acesso à rede.
## Divulgação Responsável
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
title: Solução de Problemas — unleash
title: Solução de Problemas — runaway
---
# Solução de Problemas
@@ -16,7 +16,7 @@ A detecção automática de volume falhou.
**Solução:**
1. Execute `diskutil list` para encontrar seu volume de Dados
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:
```
[ERR] Firewall needs sudo: sudo ./unleash firewall
[ERR] Heal needs sudo: sudo ./unleash heal
[ERR] Hardening needs sudo: sudo ./unleash harden
[ERR] Audit needs sudo: sudo ./unleash audit
[ERR] Check needs sudo: sudo ./unleash check
[ERR] Firewall needs sudo: sudo ./runaway firewall
[ERR] Heal needs sudo: sudo ./runaway heal
[ERR] Hardening needs sudo: sudo ./runaway harden
[ERR] Audit needs sudo: sudo ./runaway audit
[ERR] Check needs sudo: sudo ./runaway check
```
**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:**
```bash
sudo ./unleash suppress
sudo ./runaway suppress
```
**Solução do sistema já iniciado:**
```bash
sudo ./unleash harden
sudo ./runaway harden
```
Se continuar voltando:
```bash
sudo ./unleash persist # auto-recuperação em cada inicialização
sudo ./unleash monitor # vigia re-registro
sudo ./runaway persist # auto-recuperação em cada inicialização
sudo ./runaway monitor # vigia re-registro
```
---
@@ -73,7 +73,7 @@ Atualizações do sistema restauram os daemons de registro automaticamente.
**Solução:**
```bash
sudo ./unleash heal
sudo ./runaway heal
```
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.
**Não confie** em `profiles status -v`.
**Confie** em `unleash status -d`.
**Confie** em `runaway status -d`.
---
### 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:
1. Vá para o Utilitário de Disco no Recovery
2. Selecione o volume de Dados
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:
```bash
sudo ./unleash whitelist
sudo ./runaway whitelist
```
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
**Verifique:**
1. Já está rodando? `sudo ./unleash monitor-status`
1. Já está rodando? `sudo ./runaway monitor-status`
2. Permissões: precisa de root
3. Logs: `/var/log/unleash-monitor.log`
3. Logs: `/var/log/runaway-monitor.log`
**Solução:**
```bash
sudo ./unleash monitor-stop
sudo ./unleash monitor
sudo ./runaway monitor-stop
sudo ./runaway monitor
```
---
@@ -150,7 +150,7 @@ sudo ./unleash monitor
O modo Recovery não tem internet por padrã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)
---
@@ -161,10 +161,10 @@ O modo Recovery não tem internet por padrão.
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:**
- 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 instale via Homebrew
@@ -176,8 +176,8 @@ pf pode ter regras existentes que conflitam.
**Solução:**
```bash
sudo ./unleash firewall-off # limpa regras existentes
sudo ./unleash firewall # reaplica
sudo ./runaway firewall-off # limpa regras existentes
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:**
1. Após restaurar, **não conecte ao Wi-Fi**
2. Inicialize no Recovery
3. Execute `unleash bypass` antes do dispositivo contatar a Apple
4. Execute `unleash persist` e `unleash whitelist`
3. Execute `runaway bypass` antes do dispositivo contatar a Apple
4. Execute `runaway persist` e `runaway whitelist`
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.
@@ -206,8 +206,8 @@ O serial fica no ABM para sempre — mas se o dispositivo nunca conectar sem pro
**Solução:**
1. Certifique-se de ter `gpg` instalado
2. Importe a chave de assinatura: `gpg --keyserver keys.openpgp.org --recv-key <KEY_ID>`
3. Tente `sudo ./unleash update` novamente
4. Ou baixe manualmente de [GitHub Releases](https://github.com/mateussiqueira/unleash/releases)
3. Tente `sudo ./runaway update` novamente
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:
```bash
brew untap mateussiqueira/unleash
brew tap mateussiqueira/unleash
brew install unleash
brew untap mateussiqueira/runaway
brew tap mateussiqueira/runaway
brew install runaway
```
---
@@ -234,7 +234,7 @@ Todos os comandos produzem logs estruturados:
[INF] Data volume: /Volumes/Macintosh HD - Data
[ OK] Admin 'apple' created (UID 501)
[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...
[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:
```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
# Verificação rápida de saúde
sudo ./unleash doctor
sudo ./runaway doctor
# Auditoria completa do sistema
sudo ./unleash audit
sudo ./runaway audit
# Gerar relatório
sudo ./unleash report
sudo ./runaway report
# Simular um bypass
sudo ./unleash demo
sudo ./runaway demo
```
---
## Obtendo Ajuda
- [GitHub Issues](https://github.com/mateussiqueira/unleash/issues)
- [Discussões](https://github.com/mateussiqueira/unleash/discussions)
- [Política de Segurança](https://github.com/mateussiqueira/unleash/blob/main/SECURITY.md)
- [GitHub Issues](https://github.com/mateussiqueira/runaway/issues)
- [Discussões](https://github.com/mateussiqueira/runaway/discussions)
- [Política de Segurança](https://github.com/mateussiqueira/runaway/blob/main/SECURITY.md)
+21 -21
View File
@@ -1,6 +1,6 @@
---
layout: default
title: Scenarios — unleash
title: Scenarios — runaway
---
# Scenarios
@@ -10,8 +10,8 @@ title: Scenarios — unleash
Check the serial number before you buy:
```bash
./unleash predict ABC12345678 # check serial against known org prefixes
./unleash check # is this Mac safe to wipe?
./runaway predict ABC12345678 # check serial against known org prefixes
./runaway check # is this Mac safe to wipe?
```
`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:
```bash
./unleash suppress
./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.
*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:**
```bash
sudo ./unleash heal
sudo ./runaway heal
```
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:**
1. Boot to Recovery **without connecting to Wi-Fi**
2. Run `unleash bypass` before the device ever phones home
3. Run `unleash persist` and `unleash whitelist` so it stays clean
2. Run `runaway bypass` before the device ever phones home
3. Run `runaway persist` and `runaway whitelist` so it stays clean
4. Only then connect to the internet
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
```bash
sudo ./unleash audit # check current state
sudo ./unleash harden # kill MDM processes immediately
sudo ./unleash whitelist # block MDM while keeping iCloud
sudo ./unleash persist # survive future updates
sudo ./runaway audit # check current state
sudo ./runaway harden # kill MDM processes immediately
sudo ./runaway whitelist # block MDM while keeping iCloud
sudo ./runaway persist # survive future updates
```
---
@@ -81,7 +81,7 @@ sudo ./unleash persist # survive future updates
## Setting up a new Mac before first boot
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
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.
```bash
sudo ./unleash vpn-kill
sudo ./runaway vpn-kill
```
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
2. **Do not connect to Wi-Fi**
3. Boot to Recovery
4. Run `unleash bypass`
5. Run `unleash persist && unleash whitelist`
4. Run `runaway bypass`
5. Run `runaway persist && runaway whitelist`
6. Reboot and connect to the internet safely
---
@@ -120,15 +120,15 @@ For deploying across multiple machines:
```bash
# Scripted bypass
./unleash suppress --log-file /var/log/unleash-deploy.log
./runaway suppress --log-file /var/log/runaway-deploy.log
# With persist + monitor
sudo ./unleash persist
sudo ./unleash monitor
sudo ./runaway persist
sudo ./runaway monitor
# Audit report in JSON
sudo ./unleash report --json
sudo ./runaway report --json
# Discord alerts
sudo ./unleash discord-bot <token> <userId>
sudo ./runaway discord-bot <token> <userId>
```
+3 -3
View File
@@ -1,6 +1,6 @@
---
layout: default
title: Security — unleash
title: Security — runaway
---
# Security & Safety
@@ -8,7 +8,7 @@ title: Security — unleash
## Design Principles
### 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
fully reversible.
@@ -58,4 +58,4 @@ network access.
## Responsible Disclosure
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="152" cy="164" r="8" fill="#fab387"/>
<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 -->
<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="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>
<!-- 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 -->
<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
title: Troubleshooting — unleash
title: Troubleshooting — runaway
---
# Troubleshooting
@@ -16,7 +16,7 @@ Volume auto-detection failed.
**Fix:**
1. Run `diskutil list` to find your Data volume
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:
```
[ERR] Firewall needs sudo: sudo ./unleash firewall
[ERR] Heal needs sudo: sudo ./unleash heal
[ERR] Hardening needs sudo: sudo ./unleash harden
[ERR] Audit needs sudo: sudo ./unleash audit
[ERR] Check needs sudo: sudo ./unleash check
[ERR] Firewall needs sudo: sudo ./runaway firewall
[ERR] Heal needs sudo: sudo ./runaway heal
[ERR] Hardening needs sudo: sudo ./runaway harden
[ERR] Audit needs sudo: sudo ./runaway audit
[ERR] Check needs sudo: sudo ./runaway check
```
**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:**
```bash
sudo ./unleash suppress
sudo ./runaway suppress
```
**Fix from booted system:**
```bash
sudo ./unleash harden
sudo ./runaway harden
```
If it keeps returning:
```bash
sudo ./unleash persist # auto-heal on every boot
sudo ./unleash monitor # watch for re-enrollment
sudo ./runaway persist # auto-heal on every boot
sudo ./runaway monitor # watch for re-enrollment
```
---
@@ -73,7 +73,7 @@ System updates restore enrollment daemons automatically.
**Fix:**
```bash
sudo ./unleash heal
sudo ./runaway heal
```
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).
**Don't trust** `profiles status -v`.
**Trust** `unleash status -d` instead.
**Trust** `runaway status -d` instead.
---
### 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:
1. Go to Disk Utility in Recovery
2. Select the Data volume
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:
```bash
sudo ./unleash whitelist
sudo ./runaway whitelist
```
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
**Check:**
1. Is it already running? `sudo ./unleash monitor-status`
1. Is it already running? `sudo ./runaway monitor-status`
2. Permissions: needs root
3. Check logs: `/var/log/unleash-monitor.log`
3. Check logs: `/var/log/runaway-monitor.log`
**Fix:**
```bash
sudo ./unleash monitor-stop
sudo ./unleash monitor
sudo ./runaway monitor-stop
sudo ./runaway monitor
```
---
@@ -150,7 +150,7 @@ sudo ./unleash monitor
Recovery mode has no internet by default.
**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)
---
@@ -161,10 +161,10 @@ Recovery mode has no internet by default.
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:**
- 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 install via Homebrew
@@ -176,8 +176,8 @@ pf might have existing rules that conflict.
**Fix:**
```bash
sudo ./unleash firewall-off # clear existing rules
sudo ./unleash firewall # re-apply
sudo ./runaway firewall-off # clear existing rules
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:**
1. After restore, **do not connect to Wi-Fi**
2. Boot to Recovery
3. Run `unleash bypass` before the device ever phones home
4. Run `unleash persist` and `unleash whitelist`
3. Run `runaway bypass` before the device ever phones home
4. Run `runaway persist` and `runaway whitelist`
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.
@@ -206,8 +206,8 @@ The serial stays in ABM forever — but if the device never connects without pro
**Fix:**
1. Make sure you have `gpg` installed
2. Import the signing key: `gpg --keyserver keys.openpgp.org --recv-key <KEY_ID>`
3. Try `sudo ./unleash update` again
4. Or download manually from [GitHub Releases](https://github.com/mateussiqueira/unleash/releases)
3. Try `sudo ./runaway update` again
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:
```bash
brew untap mateussiqueira/unleash
brew tap mateussiqueira/unleash
brew install unleash
brew untap mateussiqueira/runaway
brew tap mateussiqueira/runaway
brew install runaway
```
---
@@ -234,7 +234,7 @@ All commands produce structured logs:
[INF] Data volume: /Volumes/Macintosh HD - Data
[ OK] Admin 'apple' created (UID 501)
[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...
[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:
```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
# Quick health check
sudo ./unleash doctor
sudo ./runaway doctor
# Full system audit
sudo ./unleash audit
sudo ./runaway audit
# Generate report
sudo ./unleash report
sudo ./runaway report
# Dry-run a bypass
sudo ./unleash demo
sudo ./runaway demo
```
---
## Getting Help
- [GitHub Issues](https://github.com/mateussiqueira/unleash/issues)
- [Discussions](https://github.com/mateussiqueira/unleash/discussions)
- [Security Policy](https://github.com/mateussiqueira/unleash/blob/main/SECURITY.md)
- [GitHub Issues](https://github.com/mateussiqueira/runaway/issues)
- [Discussions](https://github.com/mateussiqueira/runaway/discussions)
- [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"
# "/Volumes/YourSSD/auto-bypass-usb.sh"
UNLEASH_DIR="$(cd "$(dirname "$0")" && pwd)"
UNLEASH="$UNLEASH_DIR/unleash"
RUNAWAY_DIR="$(cd "$(dirname "$0")" && pwd)"
RUNAWAY="$RUNAWAY_DIR/runaway"
if [ ! -f "$UNLEASH" ]; then
echo "unleash not found at $UNLEASH"
echo "Copy the entire unleash/ folder alongside this script."
if [ ! -f "$RUNAWAY" ]; then
echo "runaway not found at $RUNAWAY"
echo "Copy the entire runaway/ folder alongside this script."
exit 1
fi
"$UNLEASH" bypass
"$RUNAWAY" bypass
+3 -3
View File
@@ -1,8 +1,8 @@
#!/bin/bash
OUT="unleash-standalone.sh"
OUT="runaway-standalone.sh"
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"
cat > "$OUT" << HEADER
@@ -19,7 +19,7 @@ for lib in colors config detect validate dscl suppress backup status launchd hea
echo "" >> "$OUT"
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"
echo "Created: $OUT (v$VERSION, $(wc -c < "$OUT") bytes, $(wc -l < "$OUT") lines)"
+4 -4
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# 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.
#
# Usage:
@@ -12,10 +12,10 @@ SSD="${1:-}"
SRC="$(cd "$(dirname "$0")/.." && pwd)"
echo "Copying unleash to $SSD..."
cp -R "$SRC" "$SSD/unleash"
echo "Copying runaway to $SSD..."
cp -R "$SRC" "$SSD/runaway"
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 "✅ SSD ready at $SSD"
+12 -12
View File
@@ -1,20 +1,20 @@
#!/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 "From Recovery (external SSD):"
echo ' "/Volumes/YourSSD/unleash/unleash" bypass'
echo ' "/Volumes/YourSSD/runaway/runaway" bypass'
echo ""
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 "From booted system (sudo needed):"
echo " sudo ./unleash heal # fix after update"
echo " sudo ./unleash harden # cleanup live MDM artifacts"
echo " sudo ./unleash audit # deep scan"
echo " sudo ./unleash check # pre-format report"
echo " sudo ./unleash monitor # watch MDM in background"
echo " sudo ./unleash persist # auto-heal on every boot"
echo " sudo ./unleash firewall # pf kernel block"
echo " sudo ./unleash whitelist # block MDM only, keep iCloud"
echo " sudo ./runaway heal # fix after update"
echo " sudo ./runaway harden # cleanup live MDM artifacts"
echo " sudo ./runaway audit # deep scan"
echo " sudo ./runaway check # pre-format report"
echo " sudo ./runaway monitor # watch MDM in background"
echo " sudo ./runaway persist # auto-heal on every boot"
echo " sudo ./runaway firewall # pf kernel block"
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.
# Run: bash record-demo.sh > demo-output.txt
echo "$ ./unleash --version"
./unleash --version
echo "$ ./runaway --version"
./runaway --version
echo ""
echo "$ sudo ./unleash doctor"
echo "$ sudo ./runaway doctor"
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 " ✓ Root privileges"
echo " ⚠ Recovery mode: no (limited to booted commands)"
@@ -20,16 +20,16 @@ echo " ✓ launchctl available"
echo " ⚠ Third-party firewall: Little Snitch detected"
echo ""
echo "$ sudo ./unleash check"
sudo ./unleash check 2>/dev/null || echo "[DEMO] Would show pre-format assessment"
echo "$ sudo ./runaway check"
sudo ./runaway check 2>/dev/null || echo "[DEMO] Would show pre-format assessment"
echo ""
echo "$ sudo ./unleash audit"
echo "$ sudo ./runaway audit"
echo "[DEMO] Audit scan complete:"
echo " Profiles: 0"
echo " DEP record: clean"
echo " Risk: LOW"
echo ""
echo "$ ./unleash --version"
./unleash --version
echo "$ ./runaway --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() {
local data_mount="$1"
@@ -80,7 +80,7 @@ restore_state() {
success "launchd override restored"
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"
success "Restore complete"
+13 -13
View File
@@ -56,20 +56,20 @@ run_preformat_check() {
step "Checking pf firewall status..."
if command -v pfctl &>/dev/null; then
if pfctl -a "com.unleash/mdm" -s rules 2>/dev/null | grep -q "block"; then
echo -e " ${GRN}Unleash pf firewall active${NC}"
if pfctl -a "com.runaway/mdm" -s rules 2>/dev/null | grep -q "block"; then
echo -e " ${GRN}Runaway pf firewall active${NC}"
else
echo -e " ${YEL}No Unleash pf firewall rules${NC}"
echo -e " ${YEL}No Runaway pf firewall rules${NC}"
fi
else
echo -e " ${YEL}pfctl not available${NC}"
fi
step "Checking persistence LaunchDaemon..."
if [ -f "/Library/LaunchDaemons/com.unleash.heal.plist" ]; then
echo -e " ${GRN}Unleash LaunchDaemon installed (auto-heal on boot)${NC}"
if [ -f "/Library/LaunchDaemons/com.runaway.heal.plist" ]; then
echo -e " ${GRN}Runaway LaunchDaemon installed (auto-heal on boot)${NC}"
else
echo -e " ${YEL}No Unleash LaunchDaemon${NC}"
echo -e " ${YEL}No Runaway LaunchDaemon${NC}"
fi
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} 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} ${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
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} ${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
echo -e "${CYAN}╚══════════════════════════════════════════════════════════════╝${NC}"
}
@@ -94,19 +94,19 @@ check_upgrade_safety() {
step "Checking if suppression will survive upgrade..."
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}"
else
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))
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}"
else
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))
fi
+8 -8
View File
@@ -1,4 +1,4 @@
CONFIG_FILE="$HOME/.unleash.conf"
CONFIG_FILE="$HOME/.runaway.conf"
load_config() {
[ -f "$CONFIG_FILE" ] || return 0
@@ -20,10 +20,10 @@ _rewrite_config() {
local tmp
[ -f "$CONFIG_FILE" ] || touch "$CONFIG_FILE"
tmp=$(mktemp "${CONFIG_FILE}.XXXXXX") || return 1
if ! UNLEASH_CONFIG_KEY="$key" UNLEASH_CONFIG_VALUE="$value" \
UNLEASH_CONFIG_OPERATION="${3:-set}" awk '
BEGIN { key=ENVIRON["UNLEASH_CONFIG_KEY"]; value=ENVIRON["UNLEASH_CONFIG_VALUE"];
operation=ENVIRON["UNLEASH_CONFIG_OPERATION"] }
if ! RUNAWAY_CONFIG_KEY="$key" RUNAWAY_CONFIG_VALUE="$value" \
RUNAWAY_CONFIG_OPERATION="${3:-set}" awk '
BEGIN { key=ENVIRON["RUNAWAY_CONFIG_KEY"]; value=ENVIRON["RUNAWAY_CONFIG_VALUE"];
operation=ENVIRON["RUNAWAY_CONFIG_OPERATION"] }
index($0, key "=")==1 { if (!found++ && operation=="set") print key "=" value; next }
{ print }
END { if (!found && operation=="set") print key "=" value }
@@ -56,7 +56,7 @@ cmd_config() {
local key="${3:-}"
local value="${4:-}"
[ -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"
return 1
}
@@ -64,14 +64,14 @@ cmd_config() {
;;
unset)
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
_rewrite_config "$key" "" unset || return 1
success "Removed $key from config"
fi
;;
*)
info "Usage: ./unleash config {show|set KEY VALUE|unset KEY}"
info "Usage: ./runaway config {show|set KEY VALUE|unset KEY}"
;;
esac
}
+2 -2
View File
@@ -1,5 +1,5 @@
run_demo() {
header "Unleash Demo — Simulated MDM Bypass"
header "Runaway Demo — Simulated MDM Bypass"
local demo_dir
demo_dir=$(mktemp -d)
@@ -79,6 +79,6 @@ run_demo() {
echo -e "${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} 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}"
}
+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_PID="${DISCORD_BOT_DIR}/bot.pid"
@@ -22,7 +22,7 @@ cmd_discord_bot_install() {
cat > "$DISCORD_BOT_SCRIPT" <<- BOT
#!/bin/bash
# Unleash Discord Bot — monitors MDM and sends alerts
# Runaway Discord Bot — monitors MDM and sends alerts
TOKEN="$token"
CHANNEL_ID="$channel_id"
LAST_STATE=""
@@ -35,7 +35,7 @@ while true; do
curl -s -X POST "https://discord.com/api/v10/channels/\$CHANNEL_ID/messages" \
-H "Authorization: Bot \$TOKEN" \
-H "Content-Type: application/json" \
-d '{"content":"🚨 **Unleash Alert** — MDM enrollment detected on '"$(hostname)"'"}'
-d '{"content":"🚨 **Runaway Alert** — MDM enrollment detected on '"$(hostname)"'"}'
fi
LAST_STATE="\$STATE"
sleep 300
@@ -47,7 +47,7 @@ BOT
local pid=$!
echo "$pid" > "$DISCORD_BOT_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() {
+5 -5
View File
@@ -47,7 +47,7 @@ _network_diagnostics() {
run_doctor() {
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
@@ -150,22 +150,22 @@ run_doctor() {
echo ""
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"
else
echo " heal LaunchDaemon: not installed"
fi
if [ -f "/Library/LaunchDaemons/com.unleash.monitor.plist" ]; then
if [ -f "/Library/LaunchDaemons/com.runaway.monitor.plist" ]; then
echo " monitor LaunchDaemon: installed"
else
echo " monitor LaunchDaemon: not installed"
fi
if [ -f "/etc/pf.anchors/com.unleash/mdm" ]; then
if [ -f "/etc/pf.anchors/com.runaway/mdm" ]; then
echo " pf firewall anchor: installed"
else
echo " pf firewall anchor: not installed"
fi
if [ -f "/etc/pf.anchors/com.unleash.selective" ]; then
if [ -f "/etc/pf.anchors/com.runaway.selective" ]; then
echo " pf selective anchor: installed"
else
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_ANCHOR_DIR="/etc/pf.anchors"
@@ -36,7 +36,7 @@ install_pf_mdm_block() {
mkdir -p "$anchor_dir"
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.
# Blocking at pf level is immune to DNS-over-HTTPS bypass.
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}\""
if [ -f "$pf_conf" ]; then
if grep -q "com.unleash" "$pf_conf" 2>/dev/null; then
info "pf.conf already has Unleash anchor"
if grep -q "com.runaway" "$pf_conf" 2>/dev/null; then
info "pf.conf already has Runaway anchor"
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"
fi
else
cat > "$pf_conf" <<- EOF
# pf.conf — restored by unleash
# pf.conf — restored by runaway
#
# Default macOS pf.conf
scrub-anchor "com.apple/*"
@@ -69,11 +69,11 @@ ANCHOR
anchor "com.apple/*"
load anchor "com.apple" from "/etc/pf.anchors/com.apple"
# Added by unleash — MDM block
# Added by runaway — MDM block
${anchor_line}
${load_line}
EOF
success "pf.conf created with Unleash anchor"
success "pf.conf created with Runaway anchor"
fi
step "Loading pf rules..."
@@ -96,7 +96,7 @@ remove_pf_mdm_block() {
local root=""
[ -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}"
if [ -f "$anchor_file" ]; then
@@ -110,7 +110,7 @@ remove_pf_mdm_block() {
local tmp_conf
tmp_conf=$(mktemp "${pf_conf}.XXXXXX") || return 1
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
rm -f "$tmp_conf"
return 1
@@ -133,9 +133,9 @@ pf_status() {
pfctl -si 2>/dev/null | grep -E "Status|Enabled" || echo " pf not enabled"
echo ""
if pfctl -a "$FIREWALL_ANCHOR" -s rules 2>/dev/null; then
info "Unleash MDM anchor rules:"
info "Runaway MDM anchor rules:"
else
info "No Unleash MDM anchor loaded"
info "No Runaway MDM anchor loaded"
fi
else
warn "pfctl not available"
+10 -10
View File
@@ -73,13 +73,13 @@ install_persist_launchdaemon() {
local root
root="$(_persist_mount_root "$data_mount")"
local unleash_src
unleash_src=$(_launchd_script_path)
local runaway_src
runaway_src=$(_launchd_script_path)
step "Installing LaunchDaemon for boot-time persistence..."
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"
@@ -89,11 +89,11 @@ install_persist_launchdaemon() {
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.unleash.heal</string>
<string>com.runaway.heal</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>${unleash_src}</string>
<string>${runaway_src}</string>
<string>heal</string>
</array>
<key>RunAtLoad</key>
@@ -105,9 +105,9 @@ install_persist_launchdaemon() {
<key>KeepAlive</key>
<false/>
<key>StandardOutPath</key>
<string>/var/log/unleash-heal.log</string>
<string>/var/log/runaway-heal.log</string>
<key>StandardErrorPath</key>
<string>/var/log/unleash-heal.err</string>
<string>/var/log/runaway-heal.err</string>
</dict>
</plist>
PLIST
@@ -131,16 +131,16 @@ remove_persist_launchdaemon() {
local data_mount="$1"
local root
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
step "Removing Unleash LaunchDaemon..."
step "Removing Runaway LaunchDaemon..."
if command -v launchctl &>/dev/null; then
launchctl unload "$plist_path" 2>/dev/null || true
fi
rm -f "$plist_path"
success "LaunchDaemon removed"
else
info "No Unleash LaunchDaemon installed"
info "No Runaway LaunchDaemon installed"
fi
}
+5 -5
View File
@@ -1,8 +1,8 @@
show_history() {
header "Unleash Event History"
header "Runaway Event History"
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
for logfile in "${logs[@]}"; do
@@ -20,11 +20,11 @@ show_history() {
if [ "$found" = false ]; then
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
step "Backup records"
local backup_dir=".unleash-backup"
local backup_dir=".runaway-backup"
if [ -d "$backup_dir" ] && [ -f "$backup_dir/timestamp" ]; then
local ts
ts=$(cat "$backup_dir/timestamp")
@@ -36,7 +36,7 @@ show_history() {
clear_history() {
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
if [ -f "$logfile" ]; then
: > "$logfile"
+9 -9
View File
@@ -1,8 +1,8 @@
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 ""
@@ -46,7 +46,7 @@ cmd_init() {
if $root_ok; then
install_pf_mdm_block ""
else
info "Skipping firewall (needs root). Run: sudo ./unleash firewall"
info "Skipping firewall (needs root). Run: sudo ./runaway firewall"
fi
fi
@@ -57,7 +57,7 @@ cmd_init() {
if $root_ok; then
install_monitor_launchdaemon ""
else
info "Skipping monitor (needs root). Run: sudo ./unleash monitor-install"
info "Skipping monitor (needs root). Run: sudo ./runaway monitor-install"
fi
fi
@@ -68,9 +68,9 @@ cmd_init() {
if $root_ok && ! is_recovery; then
install_persist_launchdaemon ""
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
info "Skipping persist (needs root). Run: sudo ./unleash persist"
info "Skipping persist (needs root). Run: sudo ./runaway persist"
fi
fi
@@ -86,7 +86,7 @@ cmd_init() {
echo ""
success "Setup complete!"
info "Recommended next steps:"
info " - From Recovery: ./unleash bypass (full bypass)"
info " - From Recovery: ./unleash check (pre-format check)"
info " - After login: sudo ./unleash harden"
info " - From Recovery: ./runaway bypass (full bypass)"
info " - From Recovery: ./runaway check (pre-format check)"
info " - After login: sudo ./runaway harden"
}
+2 -2
View File
@@ -56,7 +56,7 @@ detect_configurator_enrollment() {
return 0
else
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
fi
}
@@ -144,7 +144,7 @@ detect_migration_assistant() {
echo -e "$details" | sed '/^$/d'
echo ""
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
else
echo -e "${GRN}✓ No Migration Assistant artifacts found${NC}"
+19 -19
View File
@@ -3,13 +3,13 @@ install_monitor_launchdaemon() {
local root=""
[ -n "$data_mount" ] && root="$data_mount"
local unleash_src
unleash_src=$(_launchd_script_path)
local runaway_src
runaway_src=$(_launchd_script_path)
step "Installing monitor LaunchDaemon..."
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"
cat > "$plist_path" <<- PLIST
@@ -18,11 +18,11 @@ install_monitor_launchdaemon() {
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.unleash.monitor</string>
<string>com.runaway.monitor</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>${unleash_src}</string>
<string>${runaway_src}</string>
<string>monitor</string>
</array>
<key>RunAtLoad</key>
@@ -32,9 +32,9 @@ install_monitor_launchdaemon() {
<key>Nice</key>
<integer>1</integer>
<key>StandardOutPath</key>
<string>/var/log/unleash-monitor.log</string>
<string>/var/log/runaway-monitor.log</string>
<key>StandardErrorPath</key>
<string>/var/log/unleash-monitor.err</string>
<string>/var/log/runaway-monitor.err</string>
</dict>
</plist>
PLIST
@@ -55,7 +55,7 @@ uninstall_monitor_launchdaemon() {
local data_mount="$1"
local root=""
[ -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
step "Removing monitor LaunchDaemon..."
@@ -73,16 +73,16 @@ monitor_mdm() {
header "MDM Monitor (continuous)"
if ! is_root; then
error_exit "Monitor requires sudo: sudo ./unleash monitor"
error_exit "Monitor requires sudo: sudo ./runaway monitor"
fi
local logfile="/var/log/unleash-monitor.log"
local pidfile="/tmp/unleash-monitor.pid"
local logfile="/var/log/runaway-monitor.log"
local pidfile="/tmp/runaway-monitor.pid"
local webhook="${DISCORD_WEBHOOK:-}"
if [ -f "$pidfile" ] && kill -0 "$(cat "$pidfile")" 2>/dev/null; then
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
fi
@@ -132,11 +132,11 @@ monitor_mdm() {
if [ "$state" = "dirty" ] && [ $((now - last_notification)) -gt 3600 ]; then
last_notification=$now
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
if [ -n "$webhook" ]; then
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"
fi
heal_suppress ""
@@ -152,11 +152,11 @@ monitor_mdm() {
if [ "$consecutive_failures" -ge 12 ]; then
echo "$(date) CRITICAL: 12 consecutive dirty checks" >> "$logfile"
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
if [ -n "$webhook" ]; then
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
fi
consecutive_failures=0
@@ -168,7 +168,7 @@ monitor_mdm() {
}
stop_monitor() {
local pidfile="${1:-/tmp/unleash-monitor.pid}"
local pidfile="${1:-/tmp/runaway-monitor.pid}"
if [ -f "$pidfile" ]; then
local pid
pid=$(cat "$pidfile")
@@ -185,10 +185,10 @@ stop_monitor() {
}
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
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
echo -e "${YEL}Monitor not running${NC}"
fi
+3 -3
View File
@@ -1,6 +1,6 @@
cmd_predict() {
header "unleash predict — Serial Number Lookup"
header "runaway predict — Serial Number Lookup"
local serial=""
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
fi
if [ -z "$serial" ]; then
info "No serial provided. Run: ./unleash predict <serial>"
info "No serial provided. Run: ./runaway predict <serial>"
return 0
fi
@@ -44,7 +44,7 @@ ORGS
org_name=$(echo "$match" | cut -d: -f2)
echo -e "${YEL}⚠ Predicted enrollment: $org_name${NC}"
info "This serial prefix is commonly associated with $org_name-managed devices."
info "Remediation: sudo ./unleash remediate"
info "Remediation: sudo ./runaway remediate"
else
info "No known association for this serial prefix."
info "The device may be from a smaller org or not organizationally enrolled."
+1 -1
View File
@@ -14,7 +14,7 @@ ORGS
}
cmd_remediate() {
header "unleash remediate — Per-Org MDM Cleanup"
header "runaway remediate — Per-Org MDM Cleanup"
local org="${1:-auto}"
+16 -16
View File
@@ -3,7 +3,7 @@ generate_report() {
generate_report_json
return
fi
header "Unleash System Report"
header "Runaway System Report"
local ts
ts=$(date '+%Y-%m-%d %H:%M:%S')
@@ -46,29 +46,29 @@ generate_report() {
if command -v pfctl &>/dev/null; then
pfctl -si 2>/dev/null | grep -E "Status|Enabled" || echo " pf not enabled"
echo ""
pfctl -a "com.unleash/mdm" -s rules 2>/dev/null \
&& echo " Unleash MDM anchor: active" \
|| echo " Unleash MDM anchor: not loaded"
pfctl -a "com.unleash.selective" -s rules 2>/dev/null \
&& echo " Unleash selective anchor: active" \
|| echo " Unleash selective anchor: not loaded"
pfctl -a "com.runaway/mdm" -s rules 2>/dev/null \
&& echo " Runaway MDM anchor: active" \
|| echo " Runaway MDM anchor: not loaded"
pfctl -a "com.runaway.selective" -s rules 2>/dev/null \
&& echo " Runaway selective anchor: active" \
|| echo " Runaway selective anchor: not loaded"
fi
echo ""
step "Persistence"
[ -f "/Library/LaunchDaemons/com.unleash.heal.plist" ] \
[ -f "/Library/LaunchDaemons/com.runaway.heal.plist" ] \
&& echo " heal LaunchDaemon: 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: not installed"
[ -f "/tmp/unleash-monitor.pid" ] \
[ -f "/tmp/runaway-monitor.pid" ] \
&& echo " monitor process: running" \
|| echo " monitor process: not running"
echo ""
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
echo " From $(basename "$logfile"):"
tail -3 "$logfile" | sed 's/^/ /'
@@ -125,11 +125,11 @@ generate_report_json() {
report="${report} \"installed_profiles\": $profile_count,\n"
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"
[ -f "/Library/LaunchDaemons/com.unleash.monitor.plist" ] && monitor_installed="true"
[ -f "/Library/LaunchDaemons/com.runaway.monitor.plist" ] && monitor_installed="true"
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} \"heal_launchdaemon\": $heal_installed,\n"
report="${report} \"monitor_launchdaemon\": $monitor_installed,\n"
@@ -137,11 +137,11 @@ generate_report_json() {
report="${report} },\n"
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"
fi
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"
fi
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() {
local tmp_key
@@ -30,13 +30,13 @@ verify_gpg_signature() {
}
do_self_update() {
header "Unleash Update"
header "Runaway Update"
if ! command -v curl &>/dev/null; then
error_exit "curl required for update"
fi
local repo="mateussiqueira/unleash"
local repo="mateussiqueira/runaway"
local api_url="https://api.github.com/repos/${repo}/releases/latest"
local tmp_dir
tmp_dir=$(mktemp -d)
@@ -62,11 +62,11 @@ do_self_update() {
info "Updating from v$VERSION to v$latest_tag..."
begin "Downloading latest unleash"
local dl_url="https://raw.githubusercontent.com/${repo}/main/unleash"
begin "Downloading latest runaway"
local dl_url="https://raw.githubusercontent.com/${repo}/main/runaway"
local sig_url="${dl_url}.sig"
local tmp="$tmp_dir/unleash"
local sig_tmp="$tmp_dir/unleash.sig"
local tmp="$tmp_dir/runaway"
local sig_tmp="$tmp_dir/runaway.sig"
if curl -sL "$dl_url" -o "$tmp" && [ -s "$tmp" ]; then
curl -sL "$sig_url" -o "$sig_tmp" 2>/dev/null || true
end_ok
@@ -87,7 +87,7 @@ do_self_update() {
end_fail; error_exit "Downloaded script has syntax errors"
fi
local target="${0:-unleash}"
local target="${0:-runaway}"
if [ ! -w "$target" ]; then
info "$target not writable, trying sudo..."
cp "$tmp" "$target" 2>/dev/null || sudo cp "$tmp" "$target" 2>/dev/null || {
+6 -6
View File
@@ -1,6 +1,6 @@
cmd_suggest() {
header "unleash suggest — Risk-Based Recommendations"
header "runaway suggest — Risk-Based Recommendations"
local score=0
local recommendations=""
@@ -14,8 +14,8 @@ cmd_suggest() {
recommendations="$recommendations\n - Run 'check' for pre-format safety report"
else
info "System is booted normally"
recommendations="$recommendations\n - Run 'sudo ./unleash heal' to check MDM state"
recommendations="$recommendations\n - Run 'sudo ./unleash audit' for deep scan"
recommendations="$recommendations\n - Run 'sudo ./runaway heal' to check MDM state"
recommendations="$recommendations\n - Run 'sudo ./runaway audit' for deep scan"
fi
local cfg_dir="/private/var/db/ConfigurationProfiles/Settings"
@@ -33,11 +33,11 @@ cmd_suggest() {
else
echo -e "${YEL}⚠ MDM domains not blocked${NC}"
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
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}"
fi
fi
@@ -46,7 +46,7 @@ cmd_suggest() {
local ma_result=$?
if [ "$ma_result" -ne 0 ]; then
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
detect_configurator_enrollment
+6 -6
View File
@@ -6,7 +6,7 @@ _restore_rosetta_hosts() {
local hosts="$1" tmp_hosts
tmp_hosts=$(mktemp "${hosts}.XXXXXX") || return 1
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[.]0|::)[[:space:]]+[[:alnum:]_.-]+[[:space:]]*$/ { owned=0 }
{ print }
@@ -18,11 +18,11 @@ _restore_rosetta_hosts() {
rm -f "$tmp_hosts"
return 0
fi
if [ ! -e "$hosts.unleash-rosetta.bak" ]; then
cp -p "$hosts" "$hosts.unleash-rosetta.bak" || { rm -f "$tmp_hosts"; return 1; }
if [ ! -e "$hosts.runaway-rosetta.bak" ]; then
cp -p "$hosts" "$hosts.runaway-rosetta.bak" || { rm -f "$tmp_hosts"; return 1; }
fi
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() {
@@ -59,9 +59,9 @@ suppress_enrollment() {
step "Blocking enrollment domains (Data volume hosts)..."
[ -f "$hosts" ] || { mkdir -p "$(dirname "$hosts")"; touch "$hosts"; }
_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 "# Added by unleash — DEP enrollment block" >>"$hosts"
echo "# Added by runaway — DEP enrollment block" >>"$hosts"
}
local domains=(
+3 -3
View File
@@ -1,5 +1,5 @@
TELEMETRY_FILE="$HOME/.unleash-telemetry"
TELEMETRY_FILE="$HOME/.runaway-telemetry"
telemetry_opt_in() {
local val="${1:-}"
@@ -13,7 +13,7 @@ telemetry_opt_in() {
local current="disabled"
[ -f "$TELEMETRY_FILE" ] && current="enabled"
info "Telemetry: $current"
info "Usage: sudo ./unleash telemetry on|off"
info "Usage: sudo ./runaway telemetry on|off"
fi
}
@@ -26,7 +26,7 @@ telemetry_send() {
telemetry_is_enabled || return 0
local event="$1"
local data="${2:-{}}"
local url="https://unleash-telemetry.mateussiqueira.workers.dev/event"
local url="https://runaway-telemetry.mateussiqueira.workers.dev/event"
local payload
payload=$(printf '{"event":"%s","version":"%s","arch":"%s","os":"%s","data":%s}' \
"$event" "$VERSION" "$(uname -m)" "$(uname -s)" "$data")
+14 -14
View File
@@ -1,12 +1,12 @@
do_uninstall() {
header "Unleash — Full Uninstall"
header "Runaway — Full Uninstall"
if ! is_root; then
error_exit "Uninstall needs sudo: sudo ./unleash uninstall"
error_exit "Uninstall needs sudo: sudo ./runaway uninstall"
fi
begin "Removing heal LaunchDaemon"
local plist="/Library/LaunchDaemons/com.unleash.heal.plist"
local plist="/Library/LaunchDaemons/com.runaway.heal.plist"
if [ -f "$plist" ]; then
launchctl unload "$plist" 2>/dev/null || true
rm -f "$plist"
@@ -16,7 +16,7 @@ do_uninstall() {
fi
begin "Removing monitor LaunchDaemon"
plist="/Library/LaunchDaemons/com.unleash.monitor.plist"
plist="/Library/LaunchDaemons/com.runaway.monitor.plist"
if [ -f "$plist" ]; then
launchctl unload "$plist" 2>/dev/null || true
rm -f "$plist"
@@ -26,17 +26,17 @@ do_uninstall() {
fi
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
[ -f "$a" ] && rm -f "$a"
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
done
local pf_conf="/etc/pf.conf"
if [ -f "$pf_conf" ]; then
sed -i '' '/# Added by unleash/d' "$pf_conf" 2>/dev/null || true
sed -i '' '/com\.unleash/d' "$pf_conf" 2>/dev/null || true
sed -i '' '/# Added by runaway/d' "$pf_conf" 2>/dev/null || true
sed -i '' '/com\.runaway/d' "$pf_conf" 2>/dev/null || true
fi
pfctl -f /etc/pf.conf 2>/dev/null || true
end_ok
@@ -44,7 +44,7 @@ do_uninstall() {
begin "Cleaning hosts entries"
local hosts="/private/etc/hosts"
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")
for d in "${domains[@]}"; do
sed -i '' "/[[:space:]]$d/d" "$hosts" 2>/dev/null || true
@@ -68,7 +68,7 @@ do_uninstall() {
fi
begin "Removing backup directory"
local backup=".unleash-backup"
local backup=".runaway-backup"
if [ -d "$backup" ]; then
rm -rf "$backup" 2>/dev/null || true
end_ok
@@ -77,15 +77,15 @@ do_uninstall() {
fi
begin "Removing config file"
if [ -f "$HOME/.unleash.conf" ]; then
rm -f "$HOME/.unleash.conf"
if [ -f "$HOME/.runaway.conf" ]; then
rm -f "$HOME/.runaway.conf"
end_ok
else
end_fail; echo " Not found"
fi
begin "Stopping monitor if running"
local pidfile="/tmp/unleash-monitor.pid"
local pidfile="/tmp/runaway-monitor.pid"
if [ -f "$pidfile" ]; then
kill "$(cat "$pidfile")" 2>/dev/null || true
rm -f "$pidfile"
@@ -97,5 +97,5 @@ do_uninstall() {
echo ""
success "Uninstall complete"
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_FILE="/etc/pf.anchors/com.unleash/vpn-kill"
VPN_RULES_ANCHOR="com.runaway/vpn-kill"
VPN_RULES_FILE="/etc/pf.anchors/com.runaway/vpn-kill"
vpn_kill_install() {
header "VPN Kill-Switch — MDM Leak Protection"
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
local vpn_if=""
@@ -15,7 +15,7 @@ vpn_kill_install() {
interfaces=$(ifconfig 2>/dev/null | grep -E "^utun[0-9]+:" | sed 's/:.*//' || true)
if [ -z "$interfaces" ]; then
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)"
else
for iface in $interfaces; do
@@ -33,16 +33,16 @@ vpn_kill_install() {
if [ -z "$vpn_if" ]; then
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
fi
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"
cat > "$VPN_RULES_FILE" << RULES
# Unleash VPN kill-switch
# Runaway VPN kill-switch
# 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}
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
info "pf.conf already has VPN kill-switch anchor"
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
if pfctl -e -f "$pf_conf" 2>/dev/null; then
@@ -81,7 +81,7 @@ vpn_kill_remove() {
header "Remove VPN Kill-Switch"
if ! is_root; then
error_exit "Needs sudo: sudo ./unleash vpn-kill-remove"
error_exit "Needs sudo: sudo ./runaway vpn-kill-remove"
fi
if [ -f "$VPN_RULES_FILE" ]; then
@@ -91,7 +91,7 @@ vpn_kill_remove() {
local pf_conf="/etc/pf.conf"
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
success "pf.conf cleaned"
fi
+8 -8
View File
@@ -8,7 +8,7 @@ install_selective_block() {
step "Installing selective pf rules (block MDM only, allow Apple services)..."
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"
: > "$anchor_file"
@@ -26,14 +26,14 @@ install_selective_block() {
success "Selective anchor written: $anchor_file"
local pf_conf="${root}/etc/pf.conf"
local anchor_line="anchor \"com.unleash.selective\""
local load_line="load anchor \"com.unleash.selective\" from \"${anchor_file}\""
local anchor_line="anchor \"com.runaway.selective\""
local load_line="load anchor \"com.runaway.selective\" from \"${anchor_file}\""
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"
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"
fi
else
@@ -45,7 +45,7 @@ dummynet-anchor "com.apple/*"
fwd-anchor "com.apple/*"
anchor "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}
${load_line}
EOF
@@ -67,7 +67,7 @@ restore_hosts_based_block() {
[ -n "$data_mount" ] && root="$data_mount"
local hosts="${root}/private/etc/hosts"
if [ -f "$hosts" ] && grep -q "Added by unleash" "$hosts" 2>/dev/null; then
info "unleash hosts entries intact"
if [ -f "$hosts" ] && grep -q "Added by runaway" "$hosts" 2>/dev/null; then
info "runaway hosts entries intact"
fi
}
+20 -20
View File
@@ -54,10 +54,10 @@ show_cmd_help() {
discord-bot-status) echo "Check Discord bot status." ;;
demo) echo "Simulated bypass flow (no changes)." ;;
update) echo "Self-update from GitHub releases." ;;
uninstall) echo "Remove all Unleash traces." ;;
uninstall) echo "Remove all Runaway traces." ;;
reinstall) echo "Uninstall + clean install." ;;
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-remove) echo "Remove VPN kill-switch." ;;
vpn-kill-status) echo "Check VPN kill-switch status." ;;
@@ -69,7 +69,7 @@ show_cmd_help() {
show_help() {
cat <<'HELP'
Usage: ./unleash <command> [options]
Usage: ./runaway <command> [options]
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
Management:
config View/edit persistent settings (~/.unleash.conf)
config View/edit persistent settings (~/.runaway.conf)
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)
discord-bot Start Discord MDM alert bot
discord-bot-stop Stop Discord bot
@@ -172,7 +172,7 @@ HELP
}
cmd_version() {
echo "unleash v$VERSION"
echo "runaway v$VERSION"
exit 0
}
@@ -235,7 +235,7 @@ cmd_dualboot() {
return 0
fi
if ! is_root; then
error_exit "Dual-boot needs sudo: sudo ./unleash dualboot"
error_exit "Dual-boot needs sudo: sudo ./runaway dualboot"
fi
header "Dual-Boot Mode"
@@ -293,7 +293,7 @@ cmd_heal() {
heal_suppress "$data_mount"
else
if ! is_root; then
error_exit "Heal needs sudo: sudo ./unleash heal"
error_exit "Heal needs sudo: sudo ./runaway heal"
fi
heal_suppress ""
fi
@@ -305,7 +305,7 @@ cmd_persist() {
data_mount=$(resolve_data_volume)
else
if ! is_root; then
error_exit "Persistence needs sudo: sudo ./unleash persist"
error_exit "Persistence needs sudo: sudo ./runaway persist"
fi
data_mount=""
fi
@@ -324,7 +324,7 @@ cmd_unpersist() {
cmd_firewall() {
if ! is_root; then
error_exit "Firewall needs sudo: sudo ./unleash firewall"
error_exit "Firewall needs sudo: sudo ./runaway firewall"
fi
if is_recovery; then
local data_mount
@@ -337,7 +337,7 @@ cmd_firewall() {
cmd_firewall_off() {
if ! is_root; then
error_exit "Needs sudo: sudo ./unleash firewall-off"
error_exit "Needs sudo: sudo ./runaway firewall-off"
fi
if is_recovery; then
local data_mount
@@ -350,7 +350,7 @@ cmd_firewall_off() {
cmd_harden() {
if ! is_root; then
error_exit "Hardening needs sudo: sudo ./unleash harden"
error_exit "Hardening needs sudo: sudo ./runaway harden"
fi
if is_recovery; then
info "In Recovery — will skip live-OS checks"
@@ -360,14 +360,14 @@ cmd_harden() {
cmd_audit() {
if ! is_root; then
error_exit "Audit needs sudo: sudo ./unleash audit"
error_exit "Audit needs sudo: sudo ./runaway audit"
fi
deep_status
}
cmd_whitelist() {
if ! is_root; then
error_exit "Whitelist needs sudo: sudo ./unleash whitelist"
error_exit "Whitelist needs sudo: sudo ./runaway whitelist"
fi
if is_recovery; then
local data_mount
@@ -390,7 +390,7 @@ cmd_status() {
cmd_check() {
if ! is_root; then
error_exit "Check needs sudo: sudo ./unleash check"
error_exit "Check needs sudo: sudo ./runaway check"
fi
run_preformat_check
echo ""
@@ -444,12 +444,12 @@ cmd_test() {
info ""
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
}
cmd_interactive_recovery() {
header "unleash"
header "runaway"
local data_mount
data_mount=$(resolve_data_volume)
@@ -530,9 +530,9 @@ cmd_interactive_recovery() {
}
cmd_interactive_normal() {
header "unleash"
header "runaway"
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 ""
PS3="Choose: "
@@ -546,7 +546,7 @@ cmd_interactive_normal() {
case $opt in
"Auto-heal")
if ! is_root; then
error_exit "Heal needs sudo. Run: sudo ./unleash"
error_exit "Heal needs sudo. Run: sudo ./runaway"
fi
heal_suppress ""
;;
+160 -160
View File
@@ -126,7 +126,7 @@ confirm() {
[[ "$response" =~ ^[Yy]$ ]]
}
CONFIG_FILE="$HOME/.unleash.conf"
CONFIG_FILE="$HOME/.runaway.conf"
load_config() {
[ -f "$CONFIG_FILE" ] || return 0
@@ -148,10 +148,10 @@ _rewrite_config() {
local tmp
[ -f "$CONFIG_FILE" ] || touch "$CONFIG_FILE"
tmp=$(mktemp "${CONFIG_FILE}.XXXXXX") || return 1
if ! UNLEASH_CONFIG_KEY="$key" UNLEASH_CONFIG_VALUE="$value" \
UNLEASH_CONFIG_OPERATION="${3:-set}" awk '
BEGIN { key=ENVIRON["UNLEASH_CONFIG_KEY"]; value=ENVIRON["UNLEASH_CONFIG_VALUE"];
operation=ENVIRON["UNLEASH_CONFIG_OPERATION"] }
if ! RUNAWAY_CONFIG_KEY="$key" RUNAWAY_CONFIG_VALUE="$value" \
RUNAWAY_CONFIG_OPERATION="${3:-set}" awk '
BEGIN { key=ENVIRON["RUNAWAY_CONFIG_KEY"]; value=ENVIRON["RUNAWAY_CONFIG_VALUE"];
operation=ENVIRON["RUNAWAY_CONFIG_OPERATION"] }
index($0, key "=")==1 { if (!found++ && operation=="set") print key "=" value; next }
{ print }
END { if (!found && operation=="set") print key "=" value }
@@ -184,7 +184,7 @@ cmd_config() {
local key="${3:-}"
local value="${4:-}"
[ -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"
return 1
}
@@ -192,14 +192,14 @@ cmd_config() {
;;
unset)
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
_rewrite_config "$key" "" unset || return 1
success "Removed $key from config"
fi
;;
*)
info "Usage: ./unleash config {show|set KEY VALUE|unset KEY}"
info "Usage: ./runaway config {show|set KEY VALUE|unset KEY}"
;;
esac
}
@@ -454,7 +454,7 @@ _restore_rosetta_hosts() {
local hosts="$1" tmp_hosts
tmp_hosts=$(mktemp "${hosts}.XXXXXX") || return 1
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[.]0|::)[[:space:]]+[[:alnum:]_.-]+[[:space:]]*$/ { owned=0 }
{ print }
@@ -466,11 +466,11 @@ _restore_rosetta_hosts() {
rm -f "$tmp_hosts"
return 0
fi
if [ ! -e "$hosts.unleash-rosetta.bak" ]; then
cp -p "$hosts" "$hosts.unleash-rosetta.bak" || { rm -f "$tmp_hosts"; return 1; }
if [ ! -e "$hosts.runaway-rosetta.bak" ]; then
cp -p "$hosts" "$hosts.runaway-rosetta.bak" || { rm -f "$tmp_hosts"; return 1; }
fi
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() {
@@ -507,9 +507,9 @@ suppress_enrollment() {
step "Blocking enrollment domains (Data volume hosts)..."
[ -f "$hosts" ] || { mkdir -p "$(dirname "$hosts")"; touch "$hosts"; }
_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 "# Added by unleash — DEP enrollment block" >>"$hosts"
echo "# Added by runaway — DEP enrollment block" >>"$hosts"
}
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() {
local data_mount="$1"
@@ -800,7 +800,7 @@ restore_state() {
success "launchd override restored"
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"
success "Restore complete"
@@ -1136,13 +1136,13 @@ install_persist_launchdaemon() {
local root
root="$(_persist_mount_root "$data_mount")"
local unleash_src
unleash_src=$(_launchd_script_path)
local runaway_src
runaway_src=$(_launchd_script_path)
step "Installing LaunchDaemon for boot-time persistence..."
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"
@@ -1152,11 +1152,11 @@ install_persist_launchdaemon() {
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.unleash.heal</string>
<string>com.runaway.heal</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>${unleash_src}</string>
<string>${runaway_src}</string>
<string>heal</string>
</array>
<key>RunAtLoad</key>
@@ -1168,9 +1168,9 @@ install_persist_launchdaemon() {
<key>KeepAlive</key>
<false/>
<key>StandardOutPath</key>
<string>/var/log/unleash-heal.log</string>
<string>/var/log/runaway-heal.log</string>
<key>StandardErrorPath</key>
<string>/var/log/unleash-heal.err</string>
<string>/var/log/runaway-heal.err</string>
</dict>
</plist>
PLIST
@@ -1194,22 +1194,22 @@ remove_persist_launchdaemon() {
local data_mount="$1"
local root
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
step "Removing Unleash LaunchDaemon..."
step "Removing Runaway LaunchDaemon..."
if command -v launchctl &>/dev/null; then
launchctl unload "$plist_path" 2>/dev/null || true
fi
rm -f "$plist_path"
success "LaunchDaemon removed"
else
info "No Unleash LaunchDaemon installed"
info "No Runaway LaunchDaemon installed"
fi
}
FIREWALL_ANCHOR="com.unleash/mdm"
FIREWALL_ANCHOR="com.runaway/mdm"
FIREWALL_CONF="/etc/pf.conf"
FIREWALL_ANCHOR_DIR="/etc/pf.anchors"
@@ -1246,7 +1246,7 @@ install_pf_mdm_block() {
mkdir -p "$anchor_dir"
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.
# Blocking at pf level is immune to DNS-over-HTTPS bypass.
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}\""
if [ -f "$pf_conf" ]; then
if grep -q "com.unleash" "$pf_conf" 2>/dev/null; then
info "pf.conf already has Unleash anchor"
if grep -q "com.runaway" "$pf_conf" 2>/dev/null; then
info "pf.conf already has Runaway anchor"
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"
fi
else
cat > "$pf_conf" <<- EOF
# pf.conf — restored by unleash
# pf.conf — restored by runaway
#
# Default macOS pf.conf
scrub-anchor "com.apple/*"
@@ -1279,11 +1279,11 @@ ANCHOR
anchor "com.apple/*"
load anchor "com.apple" from "/etc/pf.anchors/com.apple"
# Added by unleash — MDM block
# Added by runaway — MDM block
${anchor_line}
${load_line}
EOF
success "pf.conf created with Unleash anchor"
success "pf.conf created with Runaway anchor"
fi
step "Loading pf rules..."
@@ -1306,7 +1306,7 @@ remove_pf_mdm_block() {
local root=""
[ -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}"
if [ -f "$anchor_file" ]; then
@@ -1320,7 +1320,7 @@ remove_pf_mdm_block() {
local tmp_conf
tmp_conf=$(mktemp "${pf_conf}.XXXXXX") || return 1
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
rm -f "$tmp_conf"
return 1
@@ -1343,9 +1343,9 @@ pf_status() {
pfctl -si 2>/dev/null | grep -E "Status|Enabled" || echo " pf not enabled"
echo ""
if pfctl -a "$FIREWALL_ANCHOR" -s rules 2>/dev/null; then
info "Unleash MDM anchor rules:"
info "Runaway MDM anchor rules:"
else
info "No Unleash MDM anchor loaded"
info "No Runaway MDM anchor loaded"
fi
else
warn "pfctl not available"
@@ -1471,7 +1471,7 @@ install_selective_block() {
step "Installing selective pf rules (block MDM only, allow Apple services)..."
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"
: > "$anchor_file"
@@ -1489,14 +1489,14 @@ install_selective_block() {
success "Selective anchor written: $anchor_file"
local pf_conf="${root}/etc/pf.conf"
local anchor_line="anchor \"com.unleash.selective\""
local load_line="load anchor \"com.unleash.selective\" from \"${anchor_file}\""
local anchor_line="anchor \"com.runaway.selective\""
local load_line="load anchor \"com.runaway.selective\" from \"${anchor_file}\""
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"
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"
fi
else
@@ -1508,7 +1508,7 @@ dummynet-anchor "com.apple/*"
fwd-anchor "com.apple/*"
anchor "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}
${load_line}
EOF
@@ -1530,8 +1530,8 @@ restore_hosts_based_block() {
[ -n "$data_mount" ] && root="$data_mount"
local hosts="${root}/private/etc/hosts"
if [ -f "$hosts" ] && grep -q "Added by unleash" "$hosts" 2>/dev/null; then
info "unleash hosts entries intact"
if [ -f "$hosts" ] && grep -q "Added by runaway" "$hosts" 2>/dev/null; then
info "runaway hosts entries intact"
fi
}
@@ -1593,20 +1593,20 @@ run_preformat_check() {
step "Checking pf firewall status..."
if command -v pfctl &>/dev/null; then
if pfctl -a "com.unleash/mdm" -s rules 2>/dev/null | grep -q "block"; then
echo -e " ${GRN}Unleash pf firewall active${NC}"
if pfctl -a "com.runaway/mdm" -s rules 2>/dev/null | grep -q "block"; then
echo -e " ${GRN}Runaway pf firewall active${NC}"
else
echo -e " ${YEL}No Unleash pf firewall rules${NC}"
echo -e " ${YEL}No Runaway pf firewall rules${NC}"
fi
else
echo -e " ${YEL}pfctl not available${NC}"
fi
step "Checking persistence LaunchDaemon..."
if [ -f "/Library/LaunchDaemons/com.unleash.heal.plist" ]; then
echo -e " ${GRN}Unleash LaunchDaemon installed (auto-heal on boot)${NC}"
if [ -f "/Library/LaunchDaemons/com.runaway.heal.plist" ]; then
echo -e " ${GRN}Runaway LaunchDaemon installed (auto-heal on boot)${NC}"
else
echo -e " ${YEL}No Unleash LaunchDaemon${NC}"
echo -e " ${YEL}No Runaway LaunchDaemon${NC}"
fi
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} 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} ${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
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} ${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
echo -e "${CYAN}╚══════════════════════════════════════════════════════════════╝${NC}"
}
@@ -1631,19 +1631,19 @@ check_upgrade_safety() {
step "Checking if suppression will survive upgrade..."
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}"
else
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))
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}"
else
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))
fi
@@ -1667,13 +1667,13 @@ install_monitor_launchdaemon() {
local root=""
[ -n "$data_mount" ] && root="$data_mount"
local unleash_src
unleash_src=$(_launchd_script_path)
local runaway_src
runaway_src=$(_launchd_script_path)
step "Installing monitor LaunchDaemon..."
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"
cat > "$plist_path" <<- PLIST
@@ -1682,11 +1682,11 @@ install_monitor_launchdaemon() {
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.unleash.monitor</string>
<string>com.runaway.monitor</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>${unleash_src}</string>
<string>${runaway_src}</string>
<string>monitor</string>
</array>
<key>RunAtLoad</key>
@@ -1696,9 +1696,9 @@ install_monitor_launchdaemon() {
<key>Nice</key>
<integer>1</integer>
<key>StandardOutPath</key>
<string>/var/log/unleash-monitor.log</string>
<string>/var/log/runaway-monitor.log</string>
<key>StandardErrorPath</key>
<string>/var/log/unleash-monitor.err</string>
<string>/var/log/runaway-monitor.err</string>
</dict>
</plist>
PLIST
@@ -1719,7 +1719,7 @@ uninstall_monitor_launchdaemon() {
local data_mount="$1"
local root=""
[ -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
step "Removing monitor LaunchDaemon..."
@@ -1737,16 +1737,16 @@ monitor_mdm() {
header "MDM Monitor (continuous)"
if ! is_root; then
error_exit "Monitor requires sudo: sudo ./unleash monitor"
error_exit "Monitor requires sudo: sudo ./runaway monitor"
fi
local logfile="/var/log/unleash-monitor.log"
local pidfile="/tmp/unleash-monitor.pid"
local logfile="/var/log/runaway-monitor.log"
local pidfile="/tmp/runaway-monitor.pid"
local webhook="${DISCORD_WEBHOOK:-}"
if [ -f "$pidfile" ] && kill -0 "$(cat "$pidfile")" 2>/dev/null; then
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
fi
@@ -1796,11 +1796,11 @@ monitor_mdm() {
if [ "$state" = "dirty" ] && [ $((now - last_notification)) -gt 3600 ]; then
last_notification=$now
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
if [ -n "$webhook" ]; then
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"
fi
heal_suppress ""
@@ -1816,11 +1816,11 @@ monitor_mdm() {
if [ "$consecutive_failures" -ge 12 ]; then
echo "$(date) CRITICAL: 12 consecutive dirty checks" >> "$logfile"
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
if [ -n "$webhook" ]; then
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
fi
consecutive_failures=0
@@ -1832,7 +1832,7 @@ monitor_mdm() {
}
stop_monitor() {
local pidfile="${1:-/tmp/unleash-monitor.pid}"
local pidfile="${1:-/tmp/runaway-monitor.pid}"
if [ -f "$pidfile" ]; then
local pid
pid=$(cat "$pidfile")
@@ -1849,20 +1849,20 @@ stop_monitor() {
}
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
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
echo -e "${YEL}Monitor not running${NC}"
fi
}
show_history() {
header "Unleash Event History"
header "Runaway Event History"
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
for logfile in "${logs[@]}"; do
@@ -1880,11 +1880,11 @@ show_history() {
if [ "$found" = false ]; then
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
step "Backup records"
local backup_dir=".unleash-backup"
local backup_dir=".runaway-backup"
if [ -d "$backup_dir" ] && [ -f "$backup_dir/timestamp" ]; then
local ts
ts=$(cat "$backup_dir/timestamp")
@@ -1896,7 +1896,7 @@ show_history() {
clear_history() {
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
if [ -f "$logfile" ]; then
: > "$logfile"
@@ -1954,7 +1954,7 @@ _network_diagnostics() {
run_doctor() {
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
@@ -2057,22 +2057,22 @@ run_doctor() {
echo ""
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"
else
echo " heal LaunchDaemon: not installed"
fi
if [ -f "/Library/LaunchDaemons/com.unleash.monitor.plist" ]; then
if [ -f "/Library/LaunchDaemons/com.runaway.monitor.plist" ]; then
echo " monitor LaunchDaemon: installed"
else
echo " monitor LaunchDaemon: not installed"
fi
if [ -f "/etc/pf.anchors/com.unleash/mdm" ]; then
if [ -f "/etc/pf.anchors/com.runaway/mdm" ]; then
echo " pf firewall anchor: installed"
else
echo " pf firewall anchor: not installed"
fi
if [ -f "/etc/pf.anchors/com.unleash.selective" ]; then
if [ -f "/etc/pf.anchors/com.runaway.selective" ]; then
echo " pf selective anchor: installed"
else
echo " pf selective anchor: not installed"
@@ -2090,7 +2090,7 @@ run_doctor() {
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() {
local tmp_key
@@ -2122,13 +2122,13 @@ verify_gpg_signature() {
}
do_self_update() {
header "Unleash Update"
header "Runaway Update"
if ! command -v curl &>/dev/null; then
error_exit "curl required for update"
fi
local repo="mateussiqueira/unleash"
local repo="mateussiqueira/runaway"
local api_url="https://api.github.com/repos/${repo}/releases/latest"
local tmp_dir
tmp_dir=$(mktemp -d)
@@ -2154,11 +2154,11 @@ do_self_update() {
info "Updating from v$VERSION to v$latest_tag..."
begin "Downloading latest unleash"
local dl_url="https://raw.githubusercontent.com/${repo}/main/unleash"
begin "Downloading latest runaway"
local dl_url="https://raw.githubusercontent.com/${repo}/main/runaway"
local sig_url="${dl_url}.sig"
local tmp="$tmp_dir/unleash"
local sig_tmp="$tmp_dir/unleash.sig"
local tmp="$tmp_dir/runaway"
local sig_tmp="$tmp_dir/runaway.sig"
if curl -sL "$dl_url" -o "$tmp" && [ -s "$tmp" ]; then
curl -sL "$sig_url" -o "$sig_tmp" 2>/dev/null || true
end_ok
@@ -2179,7 +2179,7 @@ do_self_update() {
end_fail; error_exit "Downloaded script has syntax errors"
fi
local target="${0:-unleash}"
local target="${0:-runaway}"
if [ ! -w "$target" ]; then
info "$target not writable, trying sudo..."
cp "$tmp" "$target" 2>/dev/null || sudo cp "$tmp" "$target" 2>/dev/null || {
@@ -2196,14 +2196,14 @@ do_self_update() {
}
do_uninstall() {
header "Unleash — Full Uninstall"
header "Runaway — Full Uninstall"
if ! is_root; then
error_exit "Uninstall needs sudo: sudo ./unleash uninstall"
error_exit "Uninstall needs sudo: sudo ./runaway uninstall"
fi
begin "Removing heal LaunchDaemon"
local plist="/Library/LaunchDaemons/com.unleash.heal.plist"
local plist="/Library/LaunchDaemons/com.runaway.heal.plist"
if [ -f "$plist" ]; then
launchctl unload "$plist" 2>/dev/null || true
rm -f "$plist"
@@ -2213,7 +2213,7 @@ do_uninstall() {
fi
begin "Removing monitor LaunchDaemon"
plist="/Library/LaunchDaemons/com.unleash.monitor.plist"
plist="/Library/LaunchDaemons/com.runaway.monitor.plist"
if [ -f "$plist" ]; then
launchctl unload "$plist" 2>/dev/null || true
rm -f "$plist"
@@ -2223,17 +2223,17 @@ do_uninstall() {
fi
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
[ -f "$a" ] && rm -f "$a"
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
done
local pf_conf="/etc/pf.conf"
if [ -f "$pf_conf" ]; then
sed -i '' '/# Added by unleash/d' "$pf_conf" 2>/dev/null || true
sed -i '' '/com\.unleash/d' "$pf_conf" 2>/dev/null || true
sed -i '' '/# Added by runaway/d' "$pf_conf" 2>/dev/null || true
sed -i '' '/com\.runaway/d' "$pf_conf" 2>/dev/null || true
fi
pfctl -f /etc/pf.conf 2>/dev/null || true
end_ok
@@ -2241,7 +2241,7 @@ do_uninstall() {
begin "Cleaning hosts entries"
local hosts="/private/etc/hosts"
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")
for d in "${domains[@]}"; do
sed -i '' "/[[:space:]]$d/d" "$hosts" 2>/dev/null || true
@@ -2265,7 +2265,7 @@ do_uninstall() {
fi
begin "Removing backup directory"
local backup=".unleash-backup"
local backup=".runaway-backup"
if [ -d "$backup" ]; then
rm -rf "$backup" 2>/dev/null || true
end_ok
@@ -2274,15 +2274,15 @@ do_uninstall() {
fi
begin "Removing config file"
if [ -f "$HOME/.unleash.conf" ]; then
rm -f "$HOME/.unleash.conf"
if [ -f "$HOME/.runaway.conf" ]; then
rm -f "$HOME/.runaway.conf"
end_ok
else
end_fail; echo " Not found"
fi
begin "Stopping monitor if running"
local pidfile="/tmp/unleash-monitor.pid"
local pidfile="/tmp/runaway-monitor.pid"
if [ -f "$pidfile" ]; then
kill "$(cat "$pidfile")" 2>/dev/null || true
rm -f "$pidfile"
@@ -2294,7 +2294,7 @@ do_uninstall() {
echo ""
success "Uninstall complete"
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() {
@@ -2302,7 +2302,7 @@ generate_report() {
generate_report_json
return
fi
header "Unleash System Report"
header "Runaway System Report"
local ts
ts=$(date '+%Y-%m-%d %H:%M:%S')
@@ -2345,29 +2345,29 @@ generate_report() {
if command -v pfctl &>/dev/null; then
pfctl -si 2>/dev/null | grep -E "Status|Enabled" || echo " pf not enabled"
echo ""
pfctl -a "com.unleash/mdm" -s rules 2>/dev/null \
&& echo " Unleash MDM anchor: active" \
|| echo " Unleash MDM anchor: not loaded"
pfctl -a "com.unleash.selective" -s rules 2>/dev/null \
&& echo " Unleash selective anchor: active" \
|| echo " Unleash selective anchor: not loaded"
pfctl -a "com.runaway/mdm" -s rules 2>/dev/null \
&& echo " Runaway MDM anchor: active" \
|| echo " Runaway MDM anchor: not loaded"
pfctl -a "com.runaway.selective" -s rules 2>/dev/null \
&& echo " Runaway selective anchor: active" \
|| echo " Runaway selective anchor: not loaded"
fi
echo ""
step "Persistence"
[ -f "/Library/LaunchDaemons/com.unleash.heal.plist" ] \
[ -f "/Library/LaunchDaemons/com.runaway.heal.plist" ] \
&& echo " heal LaunchDaemon: 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: not installed"
[ -f "/tmp/unleash-monitor.pid" ] \
[ -f "/tmp/runaway-monitor.pid" ] \
&& echo " monitor process: running" \
|| echo " monitor process: not running"
echo ""
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
echo " From $(basename "$logfile"):"
tail -3 "$logfile" | sed 's/^/ /'
@@ -2424,11 +2424,11 @@ generate_report_json() {
report="${report} \"installed_profiles\": $profile_count,\n"
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"
[ -f "/Library/LaunchDaemons/com.unleash.monitor.plist" ] && monitor_installed="true"
[ -f "/Library/LaunchDaemons/com.runaway.monitor.plist" ] && monitor_installed="true"
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} \"heal_launchdaemon\": $heal_installed,\n"
report="${report} \"monitor_launchdaemon\": $monitor_installed,\n"
@@ -2436,11 +2436,11 @@ generate_report_json() {
report="${report} },\n"
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"
fi
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"
fi
report="${report} \"firewall\": {\n"
@@ -2516,7 +2516,7 @@ detect_configurator_enrollment() {
return 0
else
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
fi
}
@@ -2604,7 +2604,7 @@ detect_migration_assistant() {
echo -e "$details" | sed '/^$/d'
echo ""
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
else
echo -e "${GRN}✓ No Migration Assistant artifacts found${NC}"
@@ -2636,7 +2636,7 @@ clean_ma_artifacts() {
}
run_demo() {
header "Unleash Demo — Simulated MDM Bypass"
header "Runaway Demo — Simulated MDM Bypass"
local demo_dir
demo_dir=$(mktemp -d)
@@ -2716,18 +2716,18 @@ run_demo() {
echo -e "${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} 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}"
}
VPN_RULES_ANCHOR="com.unleash/vpn-kill"
VPN_RULES_FILE="/etc/pf.anchors/com.unleash/vpn-kill"
VPN_RULES_ANCHOR="com.runaway/vpn-kill"
VPN_RULES_FILE="/etc/pf.anchors/com.runaway/vpn-kill"
vpn_kill_install() {
header "VPN Kill-Switch — MDM Leak Protection"
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
local vpn_if=""
@@ -2737,7 +2737,7 @@ vpn_kill_install() {
interfaces=$(ifconfig 2>/dev/null | grep -E "^utun[0-9]+:" | sed 's/:.*//' || true)
if [ -z "$interfaces" ]; then
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)"
else
for iface in $interfaces; do
@@ -2755,16 +2755,16 @@ vpn_kill_install() {
if [ -z "$vpn_if" ]; then
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
fi
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"
cat > "$VPN_RULES_FILE" << RULES
# Unleash VPN kill-switch
# Runaway VPN kill-switch
# 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}
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
info "pf.conf already has VPN kill-switch anchor"
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
if pfctl -e -f "$pf_conf" 2>/dev/null; then
@@ -2803,7 +2803,7 @@ vpn_kill_remove() {
header "Remove VPN Kill-Switch"
if ! is_root; then
error_exit "Needs sudo: sudo ./unleash vpn-kill-remove"
error_exit "Needs sudo: sudo ./runaway vpn-kill-remove"
fi
if [ -f "$VPN_RULES_FILE" ]; then
@@ -2813,7 +2813,7 @@ vpn_kill_remove() {
local pf_conf="/etc/pf.conf"
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
success "pf.conf cleaned"
fi
@@ -2875,10 +2875,10 @@ show_cmd_help() {
discord-bot-status) echo "Check Discord bot status." ;;
demo) echo "Simulated bypass flow (no changes)." ;;
update) echo "Self-update from GitHub releases." ;;
uninstall) echo "Remove all Unleash traces." ;;
uninstall) echo "Remove all Runaway traces." ;;
reinstall) echo "Uninstall + clean install." ;;
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-remove) echo "Remove VPN kill-switch." ;;
vpn-kill-status) echo "Check VPN kill-switch status." ;;
@@ -2890,7 +2890,7 @@ show_cmd_help() {
show_help() {
cat <<'HELP'
Usage: ./unleash <command> [options]
Usage: ./runaway <command> [options]
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
Management:
config View/edit persistent settings (~/.unleash.conf)
config View/edit persistent settings (~/.runaway.conf)
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)
discord-bot Start Discord MDM alert bot
discord-bot-stop Stop Discord bot
@@ -2993,7 +2993,7 @@ HELP
}
cmd_version() {
echo "unleash v$VERSION"
echo "runaway v$VERSION"
exit 0
}
@@ -3056,7 +3056,7 @@ cmd_dualboot() {
return 0
fi
if ! is_root; then
error_exit "Dual-boot needs sudo: sudo ./unleash dualboot"
error_exit "Dual-boot needs sudo: sudo ./runaway dualboot"
fi
header "Dual-Boot Mode"
@@ -3114,7 +3114,7 @@ cmd_heal() {
heal_suppress "$data_mount"
else
if ! is_root; then
error_exit "Heal needs sudo: sudo ./unleash heal"
error_exit "Heal needs sudo: sudo ./runaway heal"
fi
heal_suppress ""
fi
@@ -3126,7 +3126,7 @@ cmd_persist() {
data_mount=$(resolve_data_volume)
else
if ! is_root; then
error_exit "Persistence needs sudo: sudo ./unleash persist"
error_exit "Persistence needs sudo: sudo ./runaway persist"
fi
data_mount=""
fi
@@ -3145,7 +3145,7 @@ cmd_unpersist() {
cmd_firewall() {
if ! is_root; then
error_exit "Firewall needs sudo: sudo ./unleash firewall"
error_exit "Firewall needs sudo: sudo ./runaway firewall"
fi
if is_recovery; then
local data_mount
@@ -3158,7 +3158,7 @@ cmd_firewall() {
cmd_firewall_off() {
if ! is_root; then
error_exit "Needs sudo: sudo ./unleash firewall-off"
error_exit "Needs sudo: sudo ./runaway firewall-off"
fi
if is_recovery; then
local data_mount
@@ -3171,7 +3171,7 @@ cmd_firewall_off() {
cmd_harden() {
if ! is_root; then
error_exit "Hardening needs sudo: sudo ./unleash harden"
error_exit "Hardening needs sudo: sudo ./runaway harden"
fi
if is_recovery; then
info "In Recovery — will skip live-OS checks"
@@ -3181,14 +3181,14 @@ cmd_harden() {
cmd_audit() {
if ! is_root; then
error_exit "Audit needs sudo: sudo ./unleash audit"
error_exit "Audit needs sudo: sudo ./runaway audit"
fi
deep_status
}
cmd_whitelist() {
if ! is_root; then
error_exit "Whitelist needs sudo: sudo ./unleash whitelist"
error_exit "Whitelist needs sudo: sudo ./runaway whitelist"
fi
if is_recovery; then
local data_mount
@@ -3211,7 +3211,7 @@ cmd_status() {
cmd_check() {
if ! is_root; then
error_exit "Check needs sudo: sudo ./unleash check"
error_exit "Check needs sudo: sudo ./runaway check"
fi
run_preformat_check
echo ""
@@ -3265,12 +3265,12 @@ cmd_test() {
info ""
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
}
cmd_interactive_recovery() {
header "unleash"
header "runaway"
local data_mount
data_mount=$(resolve_data_volume)
@@ -3351,9 +3351,9 @@ cmd_interactive_recovery() {
}
cmd_interactive_normal() {
header "unleash"
header "runaway"
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 ""
PS3="Choose: "
@@ -3367,7 +3367,7 @@ cmd_interactive_normal() {
case $opt in
"Auto-heal")
if ! is_root; then
error_exit "Heal needs sudo. Run: sudo ./unleash"
error_exit "Heal needs sudo. Run: sudo ./runaway"
fi
heal_suppress ""
;;
+4 -4
View File
@@ -14,11 +14,11 @@ for tool in ("bash", "shellcheck"):
if not shutil.which(tool):
sys.exit(f"{tool} is required; install it before running make lint")
entrypoint = root / "unleash"
entrypoint = root / "runaway"
source = entrypoint.read_text()
loader = re.search(r"^for _lib in ([a-z_ ]+); do\n.*?^done$", source, re.M | re.S)
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()]
if set(modules) != set((root / "lib").glob("*.sh")):
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():]
examples = sorted((root / "examples").glob("*.sh"))
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)
failed |= result.returncode != 0
@@ -39,7 +39,7 @@ with tempfile.NamedTemporaryFile(mode="w", suffix=".sh") as temporary:
temporary.flush()
result = subprocess.run([
"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)
if result.stderr:
print(result.stderr, file=sys.stderr, end="")
+3 -3
View File
@@ -1,7 +1,7 @@
#!/bin/bash
# scripts/sign-release.sh
# 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
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; }
for file in unleash unleash-standalone.sh; do
for file in runaway runaway-standalone.sh; do
[ -f "$file" ] || continue
echo "Signing $file..."
gpg --detach-sign --armor --default-key "$KEY_ID" "$file"
echo "Created: $file.asc"
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
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:
log.write(json.dumps([name, *args]) + "\n")
+3 -3
View File
@@ -1,9 +1,9 @@
setup_suite() {
local suite_dir
suite_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export UNLEASH_TEST_ROOT="$BATS_SUITE_TMPDIR"
export TMPDIR="$UNLEASH_TEST_ROOT/tmp"
local mock_bin="$UNLEASH_TEST_ROOT/bin"
export RUNAWAY_TEST_ROOT="$BATS_SUITE_TMPDIR"
export TMPDIR="$RUNAWAY_TEST_ROOT/tmp"
local mock_bin="$RUNAWAY_TEST_ROOT/bin"
mkdir -p "$TMPDIR" "$mock_bin"
local tool
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" {
local entrypoint
for entrypoint in unleash unleash-standalone.sh; do
for entrypoint in runaway runaway-standalone.sh; do
local script="$BATS_TEST_DIRNAME/../$entrypoint"
run bash -u -c '
source <(sed '\''/^main "\$@"$/d'\'' "$1")
@@ -20,7 +20,7 @@
@test "admin dry run returns before accessing account or enrollment state" {
local entrypoint
for entrypoint in unleash unleash-standalone.sh; do
for entrypoint in runaway runaway-standalone.sh; do
local script="$BATS_TEST_DIRNAME/../$entrypoint"
run bash -u -c '
source <(sed '\''/^main "\$@"$/d'\'' "$1")
+4 -4
View File
@@ -6,7 +6,7 @@ run_admin_home() {
local target="$BATS_TEST_TMPDIR/External Data"
mkdir -p "$target/private/var/db" "$target/private/etc" "$target/Users"
sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -c '
run "${RUNAWAY_TEST_SHELL:-bash}" -c '
source "$1"
target="$2" mode="$3" calls="$4"
dscl() {
@@ -32,7 +32,7 @@ run_admin_home() {
@test "dualboot assigns the new home to the target UID and staff group" {
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
[ "$status" -eq 0 ]
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" {
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
[ "$status" -ne 0 ]
[[ "$output" != *"Admin 'fixture' created"* ]]
@@ -56,7 +56,7 @@ run_admin_home() {
@test "dualboot preserves existing accounts homes and dangling home symlinks" {
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
local target="$BATS_TEST_TMPDIR/External Data"
mkdir -p "$target/Users"
+10 -10
View File
@@ -4,7 +4,7 @@ run_cli() {
local script="$1"; shift
local definitions="$BATS_TEST_TMPDIR/${script##*/}.functions"
sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -u -c '
run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1"
shift
load_config() { :; }
@@ -19,7 +19,7 @@ run_capture() {
local script="$1"; shift
local definitions="$BATS_TEST_TMPDIR/${script##*/}.functions"
sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -u -c '
run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1"
shift
load_config() { :; }
@@ -33,7 +33,7 @@ run_capture() {
@test "optional CLI arguments reach usage or privilege guards under nounset" {
local entrypoint
for entrypoint in unleash unleash-standalone.sh; do
for entrypoint in runaway runaway-standalone.sh; do
local script="$BATS_TEST_DIRNAME/../$entrypoint"
run_cli "$script" audit
[ "$status" -ne 0 ]; [[ "$output" == *"Audit needs sudo"* ]]
@@ -42,15 +42,15 @@ run_capture() {
run_cli "$script" monitor --webhook
[ "$status" -ne 0 ]; [[ "$output" == *"--webhook requires a URL"* ]]
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
[ "$status" -ne 0 ]; [[ "$output" == *"Usage: ./unleash config unset KEY"* ]]
[ "$status" -ne 0 ]; [[ "$output" == *"Usage: ./runaway config unset KEY"* ]]
done
}
@test "CLI values retain spaces quotes empty strings and literal shell syntax" {
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
run_capture "$BATS_TEST_DIRNAME/../$entrypoint" config set LOG_FILE "$value"
[ "$status" -eq 0 ]
@@ -63,7 +63,7 @@ run_capture() {
@test "global flags around the command persist in the command shell" {
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'
[ "$status" -eq 0 ]
[[ "$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" {
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
[ "$status" -eq 0 ]
[ "$output" = 'interactive verbose=true' ]
@@ -82,7 +82,7 @@ run_capture() {
@test "CLI option terminator preserves values that look like global options" {
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
[ "$status" -eq 0 ]
[[ "$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" {
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
run_cli "$BATS_TEST_DIRNAME/../$entrypoint" --log-file "$value" version
[ "$status" -ne 0 ]
+1 -1
View File
@@ -9,7 +9,7 @@ setup() {
mkdir -p "$TEST_DIR/private/etc"
mkdir -p "$TEST_DIR/private/var/db/ConfigurationProfiles/Settings"
echo "test" > "$TEST_DIR/private/etc/hosts"
BACKUP_DIR="$SCRIPT_DIR/.unleash-backup"
BACKUP_DIR="$SCRIPT_DIR/.runaway-backup"
}
teardown() {
+1 -1
View File
@@ -50,7 +50,7 @@ teardown() {
@test "diagnostics use stderr without contaminating helper return values" {
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 '
source <(sed "/^error_exit()/,\$d" "$1")
volume_path() {
+1 -1
View File
@@ -37,7 +37,7 @@ teardown() {
}
@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 "$value"
LOG_FILE=''
+4 -4
View File
@@ -21,12 +21,12 @@ setup() {
@test "network doctor reports build power and link using only read commands" {
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 definitions="$BATS_TEST_TMPDIR/$entrypoint.functions"
local calls="$BATS_TEST_TMPDIR/$entrypoint.calls"
sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -u -c '
run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1"
calls="$2"
load_config() { :; }
@@ -61,10 +61,10 @@ setup() {
}
@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"
sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -u -c '
run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
unset LIB_DIR
source "$1"
load_config() { :; }
+2 -2
View File
@@ -2,12 +2,12 @@
@test "dualboot dry run returns before target access with or without root" {
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 definitions="$BATS_TEST_TMPDIR/$entrypoint.functions"
sed '/^main "\$@"$/d' "$script" > "$definitions"
for root_status in 0 1; do
run "${UNLEASH_TEST_SHELL:-bash}" -u -c '
run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1"
root_status="$2"
load_config() { :; }
+2 -2
View File
@@ -2,7 +2,7 @@
@test "dualboot keeps passwords out of diagnostics while preserving network preferences" {
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 definitions="$BATS_TEST_TMPDIR/$entrypoint.functions"
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"
cp -R "$target/Library" "$BATS_TEST_TMPDIR/$entrypoint.before"
sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -u -c '
run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1"
target="$2" logfile="$3"
fixture_password="fixture-password-not-for-a-real-account"
+9 -9
View File
@@ -4,7 +4,7 @@ setup() {
load '../lib/colors.sh'
load '../lib/firewall.sh'
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"
}
@@ -14,12 +14,12 @@ teardown() {
@test "install_pf_mdm_block creates anchor" {
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" {
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 ]
}
@@ -30,14 +30,14 @@ teardown() {
@test "install_pf_mdm_block adds anchor to pf.conf" {
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 ]
}
@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 grep -c "com.unleash" "$TEST_DIR/etc/pf.conf"
run grep -c "com.runaway" "$TEST_DIR/etc/pf.conf"
[ "$output" -ge 1 ]
[ "$output" -le 3 ]
}
@@ -45,20 +45,20 @@ teardown() {
@test "remove_pf_mdm_block cleans anchor file" {
run install_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" {
run install_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 ]
}
@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 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" ]
}
+2 -2
View File
@@ -11,8 +11,8 @@ setup() {
}
@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"
[ "$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"
mkdir -p "$PROJECT/scripts" "$PROJECT/lib"
cp "$BATS_TEST_DIRNAME/../scripts/check-shell.py" "$PROJECT/scripts/"
cat > "$PROJECT/unleash" <<'SH'
cat > "$PROJECT/runaway" <<'SH'
#!/bin/bash
for _lib in sample; do
source "lib/$_lib.sh"
@@ -12,7 +12,7 @@ done
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" {
+7 -7
View File
@@ -5,7 +5,7 @@ setup() {
load '../lib/launchd.sh'
load '../lib/monitor.sh'
TEST_DIR=$(mktemp -d)
SCRIPT_PATH="$TEST_DIR/unleash"
SCRIPT_PATH="$TEST_DIR/runaway"
}
teardown() {
@@ -26,30 +26,30 @@ teardown() {
SCRIPT_DIR="$TEST_DIR"
mkdir -p "$TEST_DIR"
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" {
SCRIPT_DIR="$TEST_DIR"
mkdir -p "$TEST_DIR"
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 ]
}
@test "install_monitor_launchdaemon references unleash binary" {
@test "install_monitor_launchdaemon references runaway binary" {
SCRIPT_DIR="$TEST_DIR"
mkdir -p "$TEST_DIR"
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 ]
}
@test "uninstall_monitor_launchdaemon removes plist" {
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
[ ! -f "$TEST_DIR/Library/LaunchDaemons/com.unleash.monitor.plist" ]
[ ! -f "$TEST_DIR/Library/LaunchDaemons/com.runaway.monitor.plist" ]
}
@test "monitor_mdm requires root" {
+4 -4
View File
@@ -4,7 +4,7 @@ run_network_state() {
local script="$1" mode="$2"
local definitions="$BATS_TEST_TMPDIR/network.functions"
sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -u -c '
run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1"
mode="$2"
load_config() { :; }
@@ -41,7 +41,7 @@ run_network_state() {
@test "network doctor distinguishes query failure from absent hardware" {
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
run_network_state "$BATS_TEST_DIRNAME/../$entrypoint" "$mode"
[ "$status" -ne 0 ]
@@ -53,7 +53,7 @@ run_network_state() {
@test "network doctor classifies IPv4 state without exposing addresses" {
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
expected="$mode"; [ "$mode" != linklocal ] || expected=link-local
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" {
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
[ "$status" -eq 0 ]
[[ "$output" == *"No Wi-Fi hardware port reported"* ]]
+5 -5
View File
@@ -3,18 +3,18 @@
check_daemon_path() {
local installer="$1" action="$2" label="$3"
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 target="$BATS_TEST_TMPDIR/$entrypoint/Target"
local script="$folder/renamed standalone.sh"
local definitions="$BATS_TEST_TMPDIR/$entrypoint.functions"
mkdir -p "$folder" "$target/Library"
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"
fi
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
source "$1"
expected="$2/Library/LaunchDaemons"
@@ -40,9 +40,9 @@ PY
}
@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" {
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" {
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" ]
mkdir -p "$target"
cp "$repo/$artifact" "$target/unleash"
run env HOME="$target" XDG_CONFIG_HOME="$target/config" bash "$target/unleash" version
cp "$repo/$artifact" "$target/runaway"
run env HOME="$target" XDG_CONFIG_HOME="$target/config" bash "$target/runaway" version
[ "$status" -eq 0 ]
[[ "$output" == *"unleash"* ]]
[[ "$output" == *"runaway"* ]]
[ ! -d "$target/lib" ]
}
+3 -3
View File
@@ -4,7 +4,7 @@ run_preview() {
local script="$1" command="$2" recovery="$3"
local definitions="$BATS_TEST_TMPDIR/preview.functions"
sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -u -c '
run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1"
action="$2" recovery="$3"
load_config() { :; }
@@ -16,7 +16,7 @@ run_preview() {
@test "suppress and bypass dry runs return before target resolution" {
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
run_preview "$BATS_TEST_DIRNAME/../$entrypoint" "$action" 0
[ "$status" -eq 0 ]
@@ -28,7 +28,7 @@ run_preview() {
@test "bypass dry run still rejects a booted OS" {
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
[ "$status" -ne 0 ]
[[ "$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" {
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 target="$BATS_TEST_TMPDIR/$entrypoint" hosts
hosts="$target/private/etc/hosts"
@@ -27,7 +27,7 @@ suppress_fixture() {
@test "heal dry run preserves old Rosetta entries" {
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 target="$BATS_TEST_TMPDIR/$entrypoint" hosts
hosts="$target/private/etc/hosts"
@@ -36,13 +36,13 @@ suppress_fixture() {
cp "$hosts" "$target/original"
suppress_fixture "$script" "$target" heal_suppress true
cmp "$target/original" "$hosts"
[ ! -e "$hosts.unleash-rosetta.bak" ]
[ ! -e "$hosts.runaway-rosetta.bak" ]
done
}
@test "suppression does not add hosts blocks for Rosetta configuration" {
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 target="$BATS_TEST_TMPDIR/$entrypoint"
mkdir -p "$target/private/etc"
@@ -56,27 +56,27 @@ suppress_fixture() {
@test "suppression repairs its old Rosetta blocks with an unchanged backup on rerun" {
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 target="$BATS_TEST_TMPDIR/$entrypoint" hosts
hosts="$target/private/etc/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"
suppress_fixture "$script" "$target"
run grep -q 'configuration[.]apple[.]com' "$hosts"
[ "$status" -eq 1 ]
cmp "$target/original" "$hosts.unleash-rosetta.bak"
cmp "$target/original" "$hosts.runaway-rosetta.bak"
cp "$hosts" "$target/repaired"
suppress_fixture "$script" "$target"
cmp "$target/repaired" "$hosts"
cmp "$target/original" "$hosts.unleash-rosetta.bak"
cmp "$target/original" "$hosts.runaway-rosetta.bak"
done
}
@test "suppression preserves Rosetta blocks outside its generated section" {
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 target="$BATS_TEST_TMPDIR/$entrypoint" hosts
hosts="$target/private/etc/hosts"
@@ -85,6 +85,6 @@ suppress_fixture() {
suppress_fixture "$script" "$target"
grep -Fxq '0.0.0.0 configuration.apple.com' "$hosts"
grep -Fxq ':: configuration.apple.com manual.alias' "$hosts"
[ ! -e "$hosts.unleash-rosetta.bak" ]
[ ! -e "$hosts.runaway-rosetta.bak" ]
done
}
+2 -2
View File
@@ -41,7 +41,7 @@ teardown() {
}
@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/status.sh"
pf_status() { :; }
@@ -57,7 +57,7 @@ teardown() {
for module in status report; do
if [ "$module" = status ]; then function_name=deep_status_json; field=profile_count;
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/$2.sh"
grep() {
+2 -2
View File
@@ -2,7 +2,7 @@
check_optional_record() {
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 definitions="$BATS_TEST_TMPDIR/$entrypoint.functions"
local target="$BATS_TEST_TMPDIR/$entrypoint-volume"
@@ -18,7 +18,7 @@ records = {
}
(settings / ".cloudConfigRecordFound").write_bytes(plistlib.dumps(records[sys.argv[2]]))
PY
run "${UNLEASH_TEST_SHELL:-bash}" -eu -o pipefail -c '
run "${RUNAWAY_TEST_SHELL:-bash}" -eu -o pipefail -c '
source "$1"
target="$2"
load_config() { :; }
+1 -1
View File
@@ -3,7 +3,7 @@
check_volume_output() {
local mode="$1" entrypoint
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 target="$BATS_TEST_TMPDIR/$entrypoint/Data volume"
mkdir -p "$target/private/var/db/dslocal/nodes/Default"
+1 -1
View File
@@ -4,7 +4,7 @@ setup() {
load '../lib/colors.sh'
load '../lib/vpn.sh'
TEST_DIR=$(mktemp -d)
mkdir -p "$TEST_DIR/etc/pf.anchors/com.unleash"
mkdir -p "$TEST_DIR/etc/pf.anchors/com.runaway"
}
teardown() {
+1 -1
View File
@@ -13,7 +13,7 @@ teardown() {
@test "install_selective_block creates anchor" {
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" {