Inject-Dylib
ObjC Code to Programmatically Perform Dylib Injection. Code leveraged from Wojciech Regula's FirefoxStealer project (https://github.com/r3ggi/FirefoxStealer).
Steps:
- Build your injection dylib to do whatever function you desire (ex: pop calc, print text to stdout, etc.)
- In the Inject-Dylib main file, edit the binpath variable value and enter the path to the application you want to inject into
- In the Inject-Dylib main file, edit the maliciousDylibPath variable value and enter the name of the injection dylib you want to use
- Build the Inject-Dylib project (by default Xcode will drop the binary to ~/Library/Developer/Xcode/DerivedData/Inject-Dylib-[random]/Build/Products/Debug)
- Place your injection dylib in the same folder as the Inject-Dylib binary
-
./Inject-Dylib
I included a sample dylib that opens calc if the injection is successful.