Skip to content

Commit a1ea5d3

Browse files
committed
Update documentation to reflect advanced cleaning and root management features
1 parent b18c0c9 commit a1ea5d3

3 files changed

Lines changed: 87 additions & 82 deletions

File tree

README-CN.md

Lines changed: 19 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,25 @@
22

33
[English Version / 英文版](README.md)
44

5-
本工具在 Assaf Dori 原始脚本的基础上进行了功能扩展。增强版本整合了通过对 micaixin.cn 商业工具进行逆向工程分析,以及对闲鱼 @多啦快解 脚本进行分析得出的绕过与持久化逻辑
5+
本项目在 Assaf Dori 原始脚本的基础上进行了功能扩展。此版本整合了通过对 micaixin.cn 商业工具进行技术分析,以及对多啦快解(Dora Fast Solve)脚本进行研究得出的核心绕过与持久化逻辑
66

77
---
88

99
## 技术增强
1010

11-
本版本实现了通过二进制及脚本分析识别出的以下技术特性
11+
此增强版本实现了通过二进制及脚本分析识别出的以下专业特性
1212

1313
### 1. 源自 micaixin.cn 的逻辑
14-
* **系统守护进程抑制**:初始化系统标志位 `/var/db/.com.apple.mdmclient.daemon.forced_disable`,防止 `mdmclient` 进程初始化启动。
15-
* **直接修改配置**:利用 `PlistBuddy` 在系统核心数据库中将 `CloudConfigRecordFound``CloudConfigHasActivationRecord` 以及 `CloudConfigProfileInstalled` 显式设置为 `false`
16-
* **属性锁定**:对绕过标记和 Plist 配置文件应用 `uchg`(用户不可变)标志,防止操作系统执行自动恢复。
17-
* **IPv6 连接屏蔽**:在 hosts 文件中包含 IPv6 (`::`) 条目,防止通过现代网络隧道进行 MDM 同步。
14+
* **系统守护进程抑制**:初始化系统标志位 `/var/db/.com.apple.mdmclient.daemon.forced_disable`。该标志位通过 `chmod 000``chflags uchg` 的组合操作,强制阻止 MDM 客户端初始化启动。
15+
* **字节级配置篡改**:利用 `PlistBuddy` 在系统核心数据库中将 `CloudConfigRecordFound``CloudConfigHasActivationRecord` 以及 `CloudConfigProfileInstalled` 显式设置为 `false`
16+
* **第三方组件清理**:自动扫描并删除与 Jamf、Addigy、Kandji 等第三方 MDM 厂商相关的守护进程及代理文件。
17+
* **网络配置重置**:移除系统级网络接口及 Wi-Fi 配置 Plist 文件,切断已存在的受管网络连接。
18+
* **IPv6 协议屏蔽**:在 hosts 文件中应用 IPv6 (`::`) 屏蔽条目,防止系统通过现代网络隧道进行 MDM 同步。
1819

19-
### 2. 源自 @多啦快解 的逻辑
20-
* **FileVault 卷管理**包含检测并解锁受 FileVault 保护的 APFS 卷的逻辑,确保可以正常访问系统配置路径。
21-
* **精细化服务抑制**:实现了针对 `cloudconfigurationd``ManagedClientAgent` 以及其他管理守护进程在系统和用户域中的显式 `launchctl` 禁用与 `bootout` 指令。
22-
* **精准激活状态管理**:明确删除正向激活记录(如 `.cloudConfigRecordFound`,防止系统仅凭文件存在即触发注册序列。
20+
### 2. 源自多啦快解的逻辑
21+
* **FileVault 卷管理**集成检测并解锁受 FileVault 保护的 APFS 卷的逻辑,确保可以正常访问系统配置路径。
22+
* **细精化服务抑制**:实现了针对 `cloudconfigurationd``ManagedClientAgent` 及其他管理进程的显式 `launchctl` 禁用与 `bootout` 指令。
23+
* **状态精准管理**:明确删除正向激活记录,防止系统仅凭文件存在即触发注册序列。
2324

2425
---
2526

@@ -46,46 +47,24 @@
4647
curl -L https://raw.githubusercontent.com/rponeawa/bypass-mdm-enhanced/main/bypass-mdm-enhanced.sh -o bypass-mdm.sh && chmod +x ./bypass-mdm.sh && ./bypass-mdm.sh
4748
```
4849

49-
**6. 磁盘卷检测**
50-
脚本将自动识别 System 卷和 Data 卷
50+
**6. 执行绕过**
51+
选择选项 1,并按照提示创建管理员账户及应用技术修改
5152

52-
**7. 绕过选项**
53-
选择选项 1: "Bypass MDM from Recovery"。
54-
55-
**8. 账户配置**
56-
配置临时管理员账户或使用默认值。
57-
58-
**9. 完成操作**
59-
等待确认提示:“Bypass Completed Successfully”。
60-
61-
**10. 重启设备**
62-
退出终端并重启 Mac。
53+
**7. 完成操作**
54+
看到“Bypass Completed Successfully”提示后,退出终端并重启 Mac。
6355

6456
---
6557

6658
## 安装后后续步骤
6759

68-
**11. 身份验证**
60+
**8. 身份验证**
6961
使用临时账户登录 (默认值: Apple / 1234)。
7062

71-
**12. 设置助手**
63+
**9. 设置助手**
7264
跳过所有初始提示 (Apple ID、Siri、Touch ID、定位服务)。
7365

74-
**13. 创建正式账户**
75-
前往“系统设置 > 用户与群组”,创建一个永久的管理员账户。
76-
77-
**14. 系统清理**
78-
在“系统设置”中删除临时的管理员账户。
79-
80-
---
81-
82-
## 故障排除
83-
84-
### 卷检测失败
85-
确认设备处于恢复模式,并且目标磁盘上已存在有效的 macOS 安装。
86-
87-
### 权限被拒绝
88-
确保脚本具有执行权限:`chmod +x bypass-mdm.sh`
66+
**10. 创建正式账户**
67+
通过“系统设置”创建一个永久的管理员账户,并删除临时账户。
8968

9069
---
9170

README.md

Lines changed: 18 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,25 @@
22

33
[Chinese Version / 中文版](README-CN.md)
44

5-
This project extends the original MDM bypass script by Assaf Dori. This enhanced version incorporates bypass and persistence logic derived from the analysis of the commercial tool micaixin.cn and scripts from the Dora Fast Solve (多啦快解) script on Xianyu.
5+
This project extends the original MDM bypass script by Assaf Dori. This version incorporates advanced bypass and persistence logic derived from the technical analysis of the commercial tool micaixin.cn and scripts from the Dora Fast Solve (多啦快解) script.
66

77
---
88

99
## Technical Enhancements
1010

11-
This version implements the technical features identified through comprehensive binary and script analysis:
11+
This enhanced version implements the following specialized features identified through binary and script analysis:
1212

1313
### 1. Logic Derived from micaixin.cn
14-
* **System Daemon Suppression**: Initializes the system flag `/var/db/.com.apple.mdmclient.daemon.forced_disable` to prevent the `mdmclient` process from initializing.
15-
* **Direct Configuration Modification**: Uses `PlistBuddy` to set `CloudConfigRecordFound`, `CloudConfigHasActivationRecord`, and `CloudConfigProfileInstalled` to `false` in the system database.
16-
* **Attribute Locking**: Applies the `uchg` (User Immutable) flag to bypass markers and Plist configurations to prevent automated restoration.
17-
* **IPv6 Connectivity Blocking**: Implements IPv6 (`::`) entries in the hosts file to block MDM synchronization via modern network tunnels.
14+
* **System Daemon Suppression**: Initializes the system flag `/var/db/.com.apple.mdmclient.daemon.forced_disable`. This flag uses a combination of `chmod 000` and `chflags uchg` to prevent the MDM client from initializing.
15+
* **Byte-level Plist Modification**: Uses `PlistBuddy` to set `CloudConfigRecordFound`, `CloudConfigHasActivationRecord`, and `CloudConfigProfileInstalled` to `false` in the core configuration database.
16+
* **Vendor Component Purge**: Scans and deletes LaunchDaemons and LaunchAgents associated with third-party MDM vendors such as Jamf, Addigy, Kandji, and others.
17+
* **Network Config Reset**: Removes system-level network and Wi-Fi configuration Plist files to break existing managed network profiles.
18+
* **IPv6 Connectivity Blocking**: Prevents MDM synchronization via modern network tunnels by applying IPv6 (`::`) entries in the hosts file.
1819

1920
### 2. Logic Derived from Dora Fast Solve (多啦快解)
20-
* **FileVault Volume Management**: Includes logic to detect and unlock APFS volumes protected by FileVault, ensuring accessibility to the system configuration paths.
21-
* **Granular Service Suppression**: Implements explicit `launchctl` disable and `bootout` commands for `cloudconfigurationd`, `ManagedClientAgent`, and other management daemons across system and user domains.
22-
* **Precise Activation State Management**: Explicitly removes positive activation records (`.cloudConfigRecordFound`, etc.) to prevent the system from triggering enrollment sequences based on file existence.
21+
* **FileVault Decryption**: Detects and provides a workflow to unlock APFS volumes protected by FileVault, ensuring accessibility to the system partition.
22+
* **Granular Service Suppression**: Implements explicit `launchctl` disable and `bootout` commands for `cloudconfigurationd`, `ManagedClientAgent`, and other management daemons.
23+
* **Activation Record Management**: Explicitly removes positive cloud configuration records to prevent enrollment triggers based on file existence.
2324

2425
---
2526

@@ -46,49 +47,24 @@ Run the following command:
4647
curl -L https://raw.githubusercontent.com/rponeawa/bypass-mdm-enhanced/main/bypass-mdm-enhanced.sh -o bypass-mdm.sh && chmod +x ./bypass-mdm.sh && ./bypass-mdm.sh
4748
```
4849

49-
**6. Volume Detection**
50-
The script will identify the System and Data volumes automatically.
50+
**6. Bypass Procedure**
51+
Select Option 1 and follow the prompts to create an administrator account and apply technical modifications.
5152

52-
**7. Bypass Selection**
53-
Select Option 1: "Bypass MDM from Recovery".
54-
55-
**8. Account Configuration**
56-
Configure the temporary administrator account or utilize default values.
57-
58-
**9. Finalization**
59-
Wait for the confirmation message: "Bypass Completed Successfully".
60-
61-
**10. Reboot**
62-
Exit the Terminal and restart the Mac.
53+
**7. Finalization**
54+
Once the "Bypass Completed Successfully" message appears, exit the Terminal and restart the Mac.
6355

6456
---
6557

6658
## Post-Installation Steps
6759

68-
**11. Authentication**
60+
**8. Authentication**
6961
Login using the temporary account (Default: Apple / 1234).
7062

71-
**12. Setup Assistant**
63+
**9. Setup Assistant**
7264
Skip all introductory prompts (Apple ID, Siri, Touch ID, Location Services).
7365

74-
**13. Primary Account Creation**
75-
Navigate to System Settings > Users and Groups and create a permanent administrator account.
76-
77-
**14. Account Migration**
78-
Log out of the temporary account and log into the new primary account.
79-
80-
**15. System Cleanup**
81-
Delete the temporary administrator account from System Settings.
82-
83-
---
84-
85-
## Troubleshooting
86-
87-
### Volume Detection Failure
88-
Verify the device is in Recovery Mode and that a valid macOS installation exists on the target drive.
89-
90-
### Permission Denied
91-
Ensure the script has execution permissions: `chmod +x bypass-mdm.sh`.
66+
**10. Primary Account Creation**
67+
Create a permanent administrator account via System Settings and delete the temporary account.
9268

9369
---
9470

bypass-mdm-enhanced.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ PUR='\033[1;35m'
99
CYAN='\033[1;36m'
1010
NC='\033[0m'
1111

12+
ROOT_WAS_RESET=false
13+
1214
# Error handling function
1315
error_exit() {
1416
echo -e "${RED}ERROR: $1${NC}" >&2
@@ -296,6 +298,8 @@ select opt in "${options[@]}"; do
296298
disable_flag="$system_path/var/db/.com.apple.mdmclient.daemon.forced_disable"
297299
chflags nouchg "$disable_flag" 2>/dev/null
298300
touch "$disable_flag" 2>/dev/null
301+
# [Micaixin Update] Using extreme protection for forced_disable
302+
chmod 000 "$disable_flag" 2>/dev/null
299303
chflags uchg "$disable_flag" 2>/dev/null
300304

301305
# Direct Plist Modification
@@ -323,6 +327,44 @@ select opt in "${options[@]}"; do
323327
done
324328
success "All MDM services suppressed"
325329

330+
# [NEW] 100% Reverse Logic Addition: Deep Database & Vendor Purge
331+
info "Performing Deep MDM Database Purge..."
332+
rm -rf "$data_path/private/var/db/mdm/" 2>/dev/null
333+
334+
info "Cleaning 3rd party MDM vendor components..."
335+
vendors=("addigy" "ivant" "kandji" "mosyle" "falcon" "intune" "jamf" "dorthus" "jumpcloud")
336+
for v in "${vendors[@]}"; do
337+
find "$system_path/Library/LaunchDaemons" "$system_path/Library/LaunchAgents" -iname "*$v*" -delete 2>/dev/null
338+
find "$data_path/Library/LaunchAgents" -iname "*$v*" -delete 2>/dev/null
339+
done
340+
341+
info "Resetting Network & WiFi Configuration..."
342+
net_configs=("com.apple.airport.preferences.plist" "com.apple.network.eapolclient.configuration.plist" "com.apple.wifi.message-tracer.plist" "NetworkInterfaces.plist" "preferences.plist")
343+
for cfg in "${net_configs[@]}"; do
344+
rm -f "$system_path/Library/Preferences/SystemConfiguration/$cfg" 2>/dev/null
345+
done
346+
success "Deep cleaning completed"
347+
348+
# [NEW] 100% Reverse Logic Addition: Optional Root Management
349+
echo ""
350+
echo -e "${PUR}-------------------------------------------------------${NC}"
351+
echo -e "${PUR}Optional: Root User Management${NC}"
352+
echo -e "Explanation: NOT needed for fresh installs. Use ONLY if"
353+
echo -e "you face permission issues after reboot.${NC}"
354+
echo -e "${PUR}-------------------------------------------------------${NC}"
355+
read -p "Reset Root password? [y/n]: " reset_root
356+
if [[ "$reset_root" =~ ^[Yy]$ ]]; then
357+
read -p "Enter new Root password: " root_pass
358+
dscl -f "$dscl_path" localhost -passwd "/Local/Default/Users/root" "$root_pass" 2>/dev/null
359+
ROOT_WAS_RESET=true
360+
success "Root password set"
361+
fi
362+
read -p "Disable Root user? [y/n]: " disable_root
363+
if [[ "$disable_root" =~ ^[Yy]$ ]]; then
364+
dscl -f "$dscl_path" localhost -create "/Local/Default/Users/root" UserShell "/usr/bin/false" 2>/dev/null
365+
success "Root user disabled"
366+
fi
367+
326368
echo ""
327369
echo -e "${GRN}╔═══════════════════════════════════════════════╗${NC}"
328370
echo -e "${GRN}║ MDM Bypass Completed Successfully! ║${NC}"
@@ -332,6 +374,14 @@ select opt in "${options[@]}"; do
332374
echo -e " 1. Close this terminal window"
333375
echo -e " 2. Reboot your Mac"
334376
echo -e " 3. Login with username: ${YEL}$username${NC} and password: ${YEL}$passw${NC}"
377+
378+
if [ "$ROOT_WAS_RESET" = true ]; then
379+
echo ""
380+
echo -e "${PUR}--- Post-Reboot Root Usage Guide ---${NC}"
381+
echo -e "If MDM warns you again, do this in Terminal as Root:"
382+
echo -e " 1. Type: ${CYAN}su - root${NC}"
383+
echo -e " 2. Run: ${RED}rm -rf /var/db/ConfigurationProfiles/* && profiles remove -all${NC}"
384+
fi
335385
echo ""
336386
break
337387
;;

0 commit comments

Comments
 (0)