Reflective code loading is a powerful technique often (ab)used by sophisticated malware to execute payloads directly from memory, bypassing detection. On macOS, this was once trivial due to loader APIs that natively supported this capability—until Apple quietly reworked these APIs to enforce file-based loading, a change that seems to have gone unnoticed by many malware authors.
In this talk, we'll first revisit traditional methods for reflective code loading on macOS and examine specific examples of malware that have leveraged, and in some cases continue to leverage, these now-obsolete and ineffective approaches.
We'll then explore methods to restore reflective loading, culminating in a surprisingly simple approach that leverages Apple's own loader, ensuring that reflective code loading remains possible even on macOS 15!
And while this undeniably poses significant challenges for defenders, the talk will conclude with strategies that aim to both detect and mitigate this capability.