This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
howto:redherring [2017/07/15 06:39] czokie created |
howto:redherring [2017/08/03 03:39] (current) czokie [6. Start DJI assistant in test_server mode] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== P0V Root Kit for DJI aircraft ====== | ====== P0V Root Kit for DJI aircraft ====== | ||
- | ===== 0. Preliminary ===== | + | This document describes one of the early rootkit approaches for DJI aircraft. The instructions |
- | * These instructions assume OSX on a mac. | + | |
- | * Install Python 3 if you don't already have it. You can get it from [[https:// | + | |
- | * You need something in your firmware cache on your MAC, otherwise you will need to install a version (or reinstall) using DJI assistant before proceeding. | + | |
- | * Install required python modules pycrypto | + | |
- | pip3 install pycrypto | + | ===== 1. Toolchain ===== |
+ | Install your toolchain as per the instructions [[.: | ||
- | * Install required Ruby modules colorise | + | ===== 2. Get firmware ===== |
- | | + | |
- | * Install adb (Android Debugger) for osx | + | ===== 3. Get the RedHerring magic ===== |
- | curl https:// | + | If this is your first time using RedHerring, you will need to checkout |
- | unzip platform-tools-latest-darwin.zip platform-tools/ | + | |
- | mv platform-tools/ | + | |
- | rm -rf platform-tools platform-tools-latest-darwin.zip | + | |
- | sudo mv adb / | + | |
- | + | ||
- | * Get the code using git | + | |
cd ~/ | cd ~/ | ||
Line 27: | Line 18: | ||
cd P0VsRedHerring | cd P0VsRedHerring | ||
- | + | If you have done this before and you want to make sure you have the latest | |
- | ===== 1. Get the code using GIT ===== | + | |
- | Freshen the code each time you want to root kit an aircraft | + | |
cd ~/ | cd ~/ | ||
git pull | git pull | ||
- | ===== 2. Find the firmware file that needs to be tweaked ===== | + | ===== 4. Run the master script |
- | grep start_dji_system / | + | |
- | + | ||
- | Note the path and filename that is returned. You will need it in the next step. The filename that was returned for me was\\ **/ | + | |
- | + | ||
- | ls -l `grep start_dji_system / | + | |
- | + | ||
- | ===== 3. Extract a bin file from that image ===== | + | |
- | python3 image.py **add path and filename here** | + | |
- | + | ||
- | ===== 4. Confirm a bin file was extracted ===== | + | |
- | ls *bin | + | |
- | + | ||
- | You should see your bin filename | + | |
- | + | ||
- | ===== 5. Verify the file type of your bin file ===== | + | |
- | file *.bin | + | |
- | + | ||
- | This should return: **Java archive data (JAR)** | + | |
- | + | ||
- | ===== 6. Extract the startup script from the JAR file ===== | + | |
- | tar xvf *.bin system/ | + | |
- | + | ||
- | ===== 7. Patch the startup script ===== | + | |
- | echo / | + | |
- | + | ||
- | ===== 8. Run the master script | + | |
- | + | ||
- | The next step will connect to your aircraft, so get it powered on and connected via USB... But this is the old one. You can PROBABLY skip this and go straight to the next step. | + | |
- | + | ||
- | sudo ruby RedHerring.rb / | + | |
- | + | ||
- | ===== 8b. Run the master script v2 ===== | + | |
sudo ruby RedHerring.rb / | sudo ruby RedHerring.rb / | ||
- | ===== 9. Start DJI assistant ===== | + | ===== 5. Start DJI assistant ===== |
Open a new window, and start DJI assistant ... connect to your aircraft, and view the list of available firmware updates... and then close DJI assistant. This will set a login cookie that will be re-used for the next command | Open a new window, and start DJI assistant ... connect to your aircraft, and view the list of available firmware updates... and then close DJI assistant. This will set a login cookie that will be re-used for the next command | ||
/ | / | ||
- | ===== 10. Start DJI assistant in test_server mode ===== | + | ===== 6. Start DJI assistant in test_server mode ===== |
/ | / | ||
- | This will take a while - but it will update | + | This sends our fireworks via the NFZ database |
- | + | ===== 7. Get a list of ads devices (see if it all worked) ===== | |
- | ===== 11. Get a list of ads devices (see if it all worked) ===== | + | |
adb devices | adb devices | ||
- | ===== 12. Connect to the adb shell ===== | + | ===== 8. Connect to the adb shell ===== |
adb shell | adb shell | ||
- | ===== Other tidbits | + | ===== 9. Make ADB persistent |
- | ==== Confirm | + | To make it easier to get back into your aircraft |
- | /usr/sbin/system_profiler SPUSBDataType | grep DJI: -A 19 | + | |
+ | | ||
+ | echo /system/bin/ | ||
+ | reboot | ||
===== Credits ===== | ===== Credits ===== | ||
* https:// | * https:// | ||
* with help from opcode at https:// | * with help from opcode at https:// |