
BootStomp: أداة اكتشاف ثغرات أمنية في محمل الإقلاع
BootStomp هي أداة اكتشاف أخطاء محمل الإقلاع. تبحث عن نوعين مختلفين من الأخطاء: تلف الذاكرة وثغرات تخزين الحالة. لمزيد من المعلومات، يُرجى الرجوع إلى ورقة BootStomp على https://seclab.cs.ucsb.edu/academic/publishing/#bootstomp-security-bootloaders-mobile-devices-2017
لتشغيل تحليلات BootStomp، يُرجى قراءة التعليمات التالية. لاحظ أن BootStomp يعمل مع محملات الإقلاع المترجمة لبنى ARM (32 و 64 بت على حد سواء) وأن النتائج قد تختلف قليلاً اعتمادًا على إصدارات angr و Z3. هذا بسبب الوقت الذي تستغرقه angr لتحليل الكتل الأساسية ونتائج تجسيد تعبيرات Z3.
$ pip install angr
أسهل طريقة لاستخدام BootStomp هي تشغيله في حاوية docker.
يحتوي المجلد docker على Dockerfile مناسب.
هذه هي الأوامر لاستخدامه.
cd docker
# build the docker image
docker build -t bootstomp .
# run the docker image (if you need, use proper options to have persistent changes or shared files)
docker run -it bootstomp
# now you are inside a docker container
cd BootStomp
# run BootStomp's taint analysis on one of the examples
# this will take about 30 minutes
python taint_analysis/bootloadertaint.py config/config.huawei
# the last line of the output will be something like:
# INFO | 2017-10-14 01:54:10,617 | _CoreTaint | Results in /tmp/BootloaderTaint_fastboot.img_.out
# you can then "pretty print" the results using:
python taint_analysis/result_pretty_print.py /tmp/BootloaderTaint_fastboot.img_.out
يجب أن يكون الإخراج شيئًا كهذا:
...
17)
===================== Start Info path =====================
Dereference address at: 0x5319cL
Reason: at location 0x5319cL a tainted variable is dereferenced and used as address.
...
Tainted Path
----------------
0x52f3cL -> 0x52f78L -> 0x52f8cL -> 0x52fb8L -> 0x52fc8L -> 0x52fecL -> 0x53000L -> 0x53014L -> 0x5301cL -> 0x53030L -> 0x53044L -> 0x53050L -> 0x5305cL -> 0x53068L
===================== End Info path =====================
# Total sinks related alerts: 5
# Total loop related alerts: 8
# Total dereference related alerts: 4
find_taint.pytaint_source_sink.txt في نفس الدليل الخاص بمُحمل الإقلاع نفسه.قم بإنشاء ملف تكوين JSON لثنائي محمل الإقلاع (انظر الأمثلة في config/)، حيث:
قم بتشغيل:
python bootloadertaint.py config-file-path
سيتم تخزين النتائج في /tmp/BootloaderTaint_[boot-loader].out، حيث [boot-loader] هو اسم محمل الإقلاع المُحلَّل. لاحظ أن المسارات التي تتضمن حلقات قد تظهر أكثر من مرة.
قم بتشغيل:
python unlock_checker.py config-file-path
سيتم تخزين النتائج في /tmp/UnlockChecker_[boot-loader].out، حيث [boot-loader] هو اسم محمل الإقلاع المُحلَّل. لاحظ أن المسارات التي تتضمن حلقات قد تظهر أكثر من مرة.
لفحص نتائج BootStomp، استخدم البرنامج النصي result_pretty_print.py، على النحو التالي:
python result_pretty_print.py results_file