Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save henrik242/65d26a7deca30bdb9828e183809690bd to your computer and use it in GitHub Desktop.
Save henrik242/65d26a7deca30bdb9828e183809690bd to your computer and use it in GitHub Desktop.
@fmodesto30
Copy link

@OMeryCoN Probably.

@followthemoney1
Copy link

In case someone also interested:

  1. Ive go to login to laptop in safe mode(on startup hold Shift)
  2. Login as a normal used account
  3. Create a new admin account in a settings
  4. Delete old one time account created with MDM

@ehsan58
Copy link

ehsan58 commented Dec 13, 2023

greeting i am on sonoma 14 and don't have any mdm notification
can i direct update to 14.2? is it safe? anyone did that direct?

@jeanswiegers
Copy link

greeting i am on sonoma 14 and don't have any mdm notification can i direct update to 14.2? is it safe? anyone did that direct?

i did, and it still works fine.

@ehsan58
Copy link

ehsan58 commented Dec 16, 2023

greeting i am on sonoma 14 and don't have any mdm notification can i direct update to 14.2? is it safe? anyone did that direct?

i did, and it still works fine.

Is there anything need to do before the upgrade? Or just the skipmdm bypass done before?

@nerykell
Copy link

Hi! I've been struggling with MDM quite a lot and found the easiest, but a little long solution to the problem, but you won't get mdm blocking and profile upload notifications. I have described as much detail as possible for different cases, so find your own and follow the instructions.
I'll tell you the pros and cons at the very end, and now let's move on to the beginning:

Preparatory Stages:

  1. If you are on macOS Ventura or Monterey and you have no problems with MDM, then download this utility https://checkm8.info/bypass-mac-mdm-lock and make a Bypass (this is a precautionary measure, without doing this, I cannot guarantee you a successful system update), if you have already done this before, then immediately proceed to the main stages.

  2. If you are on macOS Ventura or Monterey or Sonoma and you did not turn off the Internet during installation, then the MacBook will download the corporate profile and be blocked. In this case, there are 2 possible scenarios ->

Scenario 1: If your data is not on the computer, then feel free to format the disk and install Monterey/Ventura without the Internet, as soon as you have created a user and configured a MacBook, you can connect to the Internet and bypass MDM using this utility https://checkm8.info/bypass-mac-mdm-lock once you have bypassed MDM with this utility, you can proceed to the main stages.
Scenario 2: If you had Monterey/Ventura and received a lock after upgrading to Sonoma, then the data can still be saved if there was still +-100gb of free space on the disk or if you have an external hard drive

If you still have disk space and you need to restore data from a system blocked by your corporate profile, then follow these steps:

  1. Turn off your MacBook
  2. Reboot into recovery mode by pressing the touch id button
  3. Go to Settings
  4. Disk utility
  5. Divide your disk into 2 independent containers, it is important to note that we do not add a VOLUME for the disk, namely a CONTAINER
  6. Install Monterey/Ventura without internet in a new, empty container and bypass MDM using this utility https://checkm8.info/bypass-mac-mdm-lock
  7. Now in the Finder, find your other user from another container and transfer all the files of interest from the old disk container to the new one
  8. You can proceed to the main stages

If you have an external hard drive and you need to recover data from a locked corporate system profile, then follow these steps:

  1. Install Monterey/Ventura without internet and bypass MDM using this utility https://checkm8.info/bypass-mac-mdm-lock
  2. Now find your other user in the Finder and transfer all the files of interest from the internal drive to the external hard drive
  3. You can proceed to the main stages

The main steps:

  1. So, in order to upgrade to Sonoma without problems, we need an external SSD or HDD (we will save our backup copy of all data via time machine to it)
  2. Using the disk utility, format the external hard drive in APFS and in the settings in the main section select Time Machine, and in it select your external hard drive and then create a backup copy of all data
  3. As soon as the backup is created (you don't have to worry about data security, time machine saves literally everything you can), turn off your MacBook
  4. Enter recovery mode by pressing the touch id button.
  5. Disk utility
  6. Format your internal drive
  7. (Pre-create a bootable USB flash drive with macOS Sonoma) Start installing Sonoma without the Internet, configure your MacBook until you are prompted to transfer data from a time machine backup, select this item
  8. Restore all data from the backup and then complete the installation
  9. That's it, you don't need to do anything else, successful bypass!

The advantages of my method:

  1. Personally tested by me on a macbook pro 13" m1 and has been tested without any problems for a week now
  2. An easy way to bypass the regular macos methods
  3. Do you need more advantages besides reliability and simplicity? :)
    Minuses:
  4. Quite a long time

@amylee-codes
Copy link

amylee-codes commented Feb 18, 2024

(This article got hidden because of a problem with my account, so I try again):

I managed getting rid of spyware and worse w/ Sonoma (14.3.1).

System Info (redacted, personal information filtered)

>sudo sysinfo
Software:

    System Software Overview:

      System Version: macOS 14.3.1 (23D60)
      Kernel Version: Darwin 23.3.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: <>
      User Name: System Administrator (root)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: <>

Hardware:

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: Mac15,9
      Model Number: <>
      Chip: Apple M3 Max
      Total Number of Cores: 16 (12 performance and 4 efficiency)
      Memory: 128 GB
      System Firmware Version: 10151.81.1
      OS Loader Version: 10151.81.1
      Serial Number (system): <>
      Hardware UUID: <>
      Provisioning UDID: <>
      Activation Lock Status: Disabled
>sudo profiles list
There are no configuration profiles installed in the system domain

>sudo profiles show -type enrollment
Error fetching Device Enrollment configuration: We can't determine if this machine is DEP enabled.  Try again later.

Approach: Clean Wipe, Router Filter, skipmdm.com Script

This approach assumes you are able to create a bootable installer and wipe your system disk (be sure to have a backup in place!).

Prerequisites

Block Apple URLs

Before starting at all, make sure you block the following URLs in the internet router. I used a Fritz!Box and here the ("Blocked websites" filter) to block these URLs:

iprofiles.apple.com
mdmenrollment.apple.com
deviceenrollment.apple.com
gdmf.apple.com
acmdm.apple.com
albert.apple.com

Make sure the blocker works (i.e. ping from another device)!

Clean Install

In recovery mode, wipe the hard disk and start a clean install with the bootable installer.

Activate the system

Connect to the internet once to activate the system (I could not proceed without). As the installer fails to connect to the enrollment servers, an error message will be displayed indicating that the status of the enrollment could not be verified.

Run the Script

In recovery mode, open Terminal and e.g. try to delete /var/db/ConfigurationProfiles/Settings - you should get a prompt for the installation user (starting w/ "_m...") - which is a good sign (no other users set up so far)!

Now just run the script from the USB stick. Hint: directly enter the username you'd like to use later (instead going w/ Apple:1234 - saves some time). The script should run without any errors (despite the long previous discussions).

Postwork

Block URLs in /etc/hosts

Before you proceed with the installation, reboot in recovery mode and change /etc/hosts by adding:

0.0.0.0 iprofiles.apple.com
0.0.0.0 mdmenrollment.apple.com
0.0.0.0 deviceenrollment.apple.com
0.0.0.0 gdmf..apple.com
0.0.0.0 acmdm.apple.com
0.0.0.0 albert.apple.com

Disable agents

>sudo launchctl disable system/com.apple.ManagedClientAgent.enrollagent
>sudo launchctl disable system/com.apple.mdmclient.daemon
>sudo launchctl disable system/com.apple.devicemanagementclient.teslad
# You might check other services and disable them - know what you do!
>sudo launchctl print system | sort | grep enabled

Little Snitch

Finally a firewall comes in handy to possibly add even more security: I blocked

/usr/libexec/teslad
/usr/libexec/mdmclient

(for both user + system).

This works well for me and shows that it's possible to stop companies from installing spyware on their employees' devices - even on M3. B.t.w. - in many countries these practices are unlawful, so I see following this approach justified as a way of self-defense.

@icarus2712
Copy link

icarus2712 commented Mar 9, 2024

can any brother here guide me for amazon locked mac book pro 2017 non touch model inel model When i bought it used it was working perfectly, i even upgraded it to ventura, however when i formatted it for selling, it now asks for amaon remote. please help step by step.

@ooduck
Copy link

ooduck commented Mar 16, 2024

Hi even after holding on recovery it still opens up this screen, any way to bypass this? 20230423_125104

I have the same issue. I can't boot to recovery mode because of this. Do you have recommendations to go through this?
I have Macbook Pro M1 2021 14"
@aviloveN @predragcvetkovski @Jbb08 @eternalgod @maclover696 @mikevic18

@haohanw
Copy link

haohanw commented Mar 18, 2024

Hi even after holding on recovery it still opens up this screen, any way to bypass this? 20230423_125104

I have the same issue. I can't boot to recovery mode because of this. Do you have recommendations to go through this? I have Macbook Pro M1 2021 14" @aviloveN @predragcvetkovski @Jbb08 @eternalgod @maclover696 @mikevic18

Seems like it has been locked by administrator after being enrolled in the MDM. you need another device with T2 chip to reinstall this one via DFU mode.
Try this:https://www.youtube.com/watch?v=S8r9w4dduEw

@ooduck
Copy link

ooduck commented Apr 11, 2024

Hi even after holding on recovery it still opens up this screen, any way to bypass this? 20230423_125104

I have the same issue. I can't boot to recovery mode because of this. Do you have recommendations to go through this? I have Macbook Pro M1 2021 14" @aviloveN @predragcvetkovski @Jbb08 @eternalgod @maclover696 @mikevic18

Seems like it has been locked by administrator after being enrolled in the MDM. you need another device with T2 chip to reinstall this one via DFU mode. Try this:https://www.youtube.com/watch?v=S8r9w4dduEw

Worked like a charm with my MDM macbook.

Do you happen to know if this would also work with icloud issue macbook?

@c22dev
Copy link

c22dev commented Apr 14, 2024

If someone's interested, I made a gist with some sh scripts that should allow you to setup a MDM locked Mac as brand new;

https://gist.github.com/c22dev/e3a1223fa63b20f1b4e95a7119277cb9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment