
Discover DYLD_INSERT_LIBRARIES hijacks on macOS

pip3 install -r requirements.txtgcc -dynamiclib DylibHijackTest.c -o DylibHijackTest.dylib⚠️ This will spawn many processes on your machine, run this in a VM: Be very careful here!
MH_EXECUTE headerDYLD_INSERT_LIBRARIES environment variable pointed at our malicious dylibinject.py to see what Mach-Os ary injectable and use codesign to check for useful entitlements$ python3 inject.py /Applications/iMovie.app /Users/slyd0g/DylibHijackTest.dylib > imovie.txt 2> /dev/null
$ python3 inspect.py /Users/slyd0g/Projects/DylibHijackTest/imovie.txt