Unlocking, rooting, installing a custom recovery, installing Kali and reverting my Nexus 5 back to stock.
1 - Unlocking Bootloader
Download the Android Development Studio, here: https://developer.android.com/studio
Locate the sdk tools, on my mac, they were here: /Users/plisken/library/Android/sdk/platform-tools
Turn the phone off and then boot it into the bootloader/fastboot mode by holding volume down + power. ( I done vol up + vol down + power)
Plug the phone into your computer and then navigate to the platform-tools, then run;
./fastboot devices which should show your device is connected, if not, check cable and you may need drivers (not covered here).
If the device is showing, then do;
./fastboot oem unlock
You then need to confirm on the phone, once complete, do;
./fastboot reboot
This may take some time but phone should boot into Android (eventually).
2 - Installing a Custom Recovery
Download recovery image, I used; https://eu.dl.twrp.me/hammerhead/
and place in the platform-tools directory, rename to recovery.img and run the following;
fastboot flash recovery recovery.img
Note: I'm not so sure it's necessary to rename it to recovery.img, I was just following along to some random YouTube video as I was taking notes for this part. I'm pretty sure you could just use the filename.
If successful, restart bootloader and once the bootloader reloads, scroll to Recovery Mode, this should then launch your new custom recovery.
3 - Rooting
Download Magisk from here: https://github.com/topjohnwu/Magisk?tab=readme-ov-file
and install the apk file, you may need to allow "install from unknown sources" or similar. Once installed, follow instructions. (TBA)
4 - Installing Kali
Download from https://www.kali.org/get-kali/#kali-mobile
Copy onto phone and reboot into recovery, then install the downloaded image.
The first time I done this, it failed saying there was not enough memnory on system, I tried it a second time and it completed ok. Or so I thought. I then found that I had no wifi on the phone, which may or may not have been down to the flashing process as this particular headset previously had an issue with no wifi, but was repaired or replaced back in 2015 after which it sat in my desk drawer unused.
5 - Reverting to stock
Following instructions from here
Download thee image here (TBA)
Unzip and copy directory over to the platform-tools directory.
Run the following (assuming that the files are in the ;
The above seems to finish with a Segmentation fault, but also seems to have fixed the wifi.
2nd attempt at installing Kali
A - Repeat stage 2 from above.
B - Get the boot.img file from the stock image (step 5 above) and copy it onto phone. Install Magisk as per step 3 from above. This time however choose the boot.img file to patch.
C - Once complete, boot into recovery and locate the boot.img file (/sdcard/Downloads or similar) and rename it to boot-old.img.
D - Then choose to Install an Image and choose the newly created file from step B
E - Once complete, reboot and open Magisk where I was instructed to reboot one more time to complete.
F - With Kali zip on my device as per 4 above, I flashed but again got an error that there was not enough space of /system
TBC
https://assume-breach.medium.com/home-grown-red-team-installing-nethunter-on-a-nexus-5-like-its-2013-29c0951eba0
No comments:
Post a Comment
Note: only a member of this blog may post a comment.