People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!
rootless configuration controls which files are SIP protected and there is an extended attribute for this as well. There is a valid way to bypass this though: using the rootless* entitlements, which are used for upgrades and things. rootless.*
com.apple.rootless.install.heritable entitlement. With this entitlement, any child process of system_installd would be able to bypass SIP filesystem restrictions altogether. Would it be possible to get this binary to run something that we control? system_installd specifically. When installing an Apple-signed package, the package invokes this script and takes charge of the original process. If the package contains any post-install scripts, this is ran via the default shell zsh. zsh is executed, it looks for the file /etc/zshenv. If this is found, then the commands are automatically ran from the file. This allows arbitrary actions to be performed in the context of system_installd; hence, in the context of Microsoft Defender. zsh issue likely exists in other places too, meaning it may be a valid exploit technique going forward.