Results 1 to 17 of 17

Thread: How to safely install Nethunter 2.0 on any supported device

  1. #1
    Join Date
    2015-Sep
    Posts
    8

    How to safely install Nethunter 2.0 on any supported device

    So I just spent the last two days trying to get Nethunter installed on my new Nexus 7 (2013) with Android 5.0. I spent a very long time trawling the web and reading guides that are now completely out of date, so i figured I would make this guide as a contribution to the community i'm joining and hopefully save you/future people time trying to get set up. I have only tested this on a Nexus 7 with Android 5.0 but it should work on any supported device.

    The guide is split up into 3 main parts: The first is how to root your device using a PC, the second is how to install nethunter safely with minimum risk to your device going wrong during the flashing and the third section is how to get your device back to a working state if you have tried following the offical guide and its softbricked because of the toolkit. This part is in a second post further down the page due to post word limits.

    The reason this is called a 'safe' guide is that it flashes kali on a copied image, so you will always have your original as a backup.

    Disclaimer: I take no responsibility if you mess up your device, follow these instructions at your own risk.

    So here it is:

    How to root your device:

    Pre-requisites:
    - Back up anything you want to save, this will wipe your device
    - 7Zip or any other unzipper
    - Android SDK Tools Only (https://developer.android.com/sdk/index.html)
    - Install the SDK, when it finishes installing check the Tools option and install the tools. Make a note of the install location at the top of the box.

    Now were going to add the newly installed tools to the system path so it can find them. Right click on 'My Computer' > Properties > Advanced > Enviroment Variables. In 'System Variables find 'Path' and edit it.

    Add a ';' to the end of what is already in there, then copy in the path to the platform-tools folder of the SDK you just installed. For example mine was:

    C:\Users\MyUserName\AppData\Local\Android\android-sdk\platform-tools

    Now we can use the tools anywhere.

    Next before we can root the device we have to turn on USB debugging. Go into 'Settings > About' and tap on the 'Build Number' 7 times so that you unlock developer mode. Now go back into settings and you will have a new option called 'Developer Options'. Scroll down and tap on 'USB debugging' so that it is either checked or toggeled on.

    Next connect the device to the computer you have installed the SDK Tools on. Go to Start and type in 'cmd' to open a command prompt. Type in('>' denotes a cmd prompt):

    > adb reboot-bootloader

    Your device will switch off and go into bootloader mode. Now we unlock the device by typeing:

    > fastboot oem unlock

    Use the volume buttons to change between options and the power button to confirm. Press yes to unlock. Bootloader will restart. Then use the buttons to start/restart the device and boot it normally.

    On your computer download the latest TWRP recovery image(2.8.5.0 at the time of writing) and rename it to 'recovery-twrp.img'. Open a command prompt on the folder where this file is located by shift-rightclicking on the folder and choosing 'open command prompt here'. Now with your device still plugged in run:

    > fastboot flash recovery recovery-twrp.img

    Next go to autoroot.chainfire.eu(https://autoroot.chainfire.eu/) and download the appropriate rooter for your device. There will probally be multiple options for your device, for nexus devices go to googles factory image page(https://developers.google.com/androi...s/images?hl=en) and find your device, its 'name' will have a corresponding option on the autoroot chainfire page.

    Now extract the autoroot zip file into a folder and open a command prompt inside the folder. Type:

    > adb reboot-bootloader

    Once your device has booted back up into bootloader type:

    > root-windows.bat

    There are also options for Linux and Mac so it is possible to follow this tutorial on those operating systems as well, but some of the steps would be slightly different(like installing the tools and setting Path variables).

    Wait for the command to finish running, your device should now be rooted. Reboot the device and download an app off the play store called 'root checker basic'. Open it up and tap on 'Verify Root'. Grant the app permission to run and it will tell you that Root acess is properly installed on your device.

    Congratulations, the first step is complete!

    How to install Kali-Nethunter:

    Pre-requisites:
    (All of the following will already be done if you followed part 1)
    - Rooted Device
    - TWRP Recovery is installed/flashed
    - Bootloader is unlocked

    Open up the play store and search for MultiROM manager. Install and then open it. Check all of the boxes and tap 'Install'. Wait for it to complete. If your device restarts let the auto-boot complete and boot back into the internal Android rom.

    Next download Kali-Linux Nethunter on to your computer(https://www.offensive-security.com/k...nter-download/). Don't unzip it as it needs to be zipped to install.

    Drag the zipped file to your desktop. With your device plugged in open a command prompt and type the following command, but replace the Username with your username and nethunter.zip with the name of your kali linux nethunter downloaded zip file:

    > adb push C:/Users/UserName/Desktop/nethunter.zip /data/local/tmp/nethunter.zip

    The reason you need to put it in /data/local/tmp/AAABBCC is because on some devices other parts of the file system are read only.

    Wait for the command prompt to finish running (it may take a few minuites). Now type:

    > adb reboot-bootloader

    Use the volume buttons to select Recovery/Recovery Mode and press the power button. Inside the MultiROM TWRP menu select 'Advanced > MultiROM > Swap ROMs'. Choose the action 'Copy primary ROM to secondaries'. This will create an exact copy of your Android installation, swipe across the button of the screen where it says 'Swipe to swap ROMs' to confirm.

    Now wait as your ROM is copied. If your device reboots once it is done, follow the previous steps to get back into MultiROM TWRP Recovery mode. Otherwise press back untill you are on the Multirom home screen. Press 'Advanced > MultiROM > List ROMs' and tap on the ROM in the menu.

    On the new screen tap on 'Flash ZIP' and navigate through the file system to '/data/local/tmp/' select the kali nethunter file that you put onto your device earlier and it will begin to flash/install. This may take a long time: ~20 minuites.

    Once it is completed go back to the TWRP home screen and tap 'Reboot > System'.

    Now as it loads up click on cancel so that it doesn't autoboot into your Android ROM. Here on the menu you will see two options, your internal Android ROM and your new Nethunter ROM. Select the Nethunter ROM to load it up.

    Congratulations, you now have Kali-Linux Nethunter installed on your device! It will also already be rooted as it was installed on top of a copy of your rooted Android ROM. You also have a sepperate Android ROM as a backup or if you don't want to use nethunter.
    You can delete the Nethunter ZIP on your device to get some space back by typeing:

    > adb shell
    > cd /data/local/tmp/
    > ls
    > rm -r kalinethunterfilename.zip

    On a 16GB device you will now only have around 4GB of free space. If you want to delete your original Android ROM and only have Nethunter, open up a command prompt and type in:

    > adb reboot-bootloader

    Select recovery and go to 'Advanced > MultiROM > Swap ROMs'. Now choose the 'Swap primary (Internal) ROM with secondary'. This will make Nethunter your primary ROM. Once it is completed, which may take a while, go back and reboot the system/device and once again choose your Nethunter ROM.

    Once the device has loaded. Open up the MultiROM Manager app and in the menu go to 'Manage ROMs'. Now that your old Android ROM isnt the primary any longer you can choose to delete/erase/trash it from the menu.

    Congratulations, you now have 6GB more free space and a working Kali-Linux Nethunter ROM installed.
    Last edited by Greenwolf; 2015-09-17 at 13:10.

  2. #2
    Nicely done! /me tips hat
    This is a Kali-Linux support forum - not general IT/infosec help.

    Useful Commands: OS, Networking, Hardware, Wi-Fi
    Troubleshooting: Kali-Linux Installation, Repository, Wi-Fi Cards (Official Docs)
    Hardware: Recommended 802.11 Wireless Cards

    Documentation: http://docs.kali.org/ (Offline PDF version)
    Bugs Reporting & Tool Requests: https://bugs.kali.org/
    Kali Tool List, Versions & Man Pages: https://tools.kali.org/

  3. #3
    Join Date
    2015-Sep
    Posts
    8
    How to un-(soft)brick your device:

    Now i'm going to show you a way to completely restore your softbricked device, even if it has no ROMs and has errored really badly deleteing (almost) everything. This can be used anytime softbricking happens, not just with Nethunter. This can also be used if you simply want to downgrade your Android device to a lower software version.

    Pre-requisites:
    - 7Zip or any other unzipper
    - The Factory Image of the device from google with the Android version you want installed(https://developers.google.com/androi...s/images?hl=en). This is for Nexus devices, you may need to find the version for your device online.
    - Android SDK Tools Only (https://developer.android.com/sdk/index.html)
    - Install the SDK, when it finishes installing check the Tools option and install the tools. Make a note of the install location at the top of the box.

    Now were going to add the newly installed tools to the system path so it can find them. Right click on 'My Computer' > Properties > Advanced > Enviroment Variables. In 'System Variables find 'Path' and edit it.

    Add a ';' to the end of what is already in there, then copy in the path to the platform-tools folder of the SDK you just installed. For example mine was:

    C:\Users\MyUserName\AppData\Local\Android\android-sdk\platform-tools

    Now we can use the tools anywhere.

    Next go unpack the factory image you downloaded with 7zip and go inside the unzipped folder and download the other zip folder inside.

    Now lets get your device up and running!

    Plug your device into the pc. If your stuck at the teamwin screen and can't reboot, open a command prompt and type:

    > adb reboot-bootloader

    This should turn off the device and boot up your bootloader.

    Now enter the following commands into your command prompt one line at a time:

    >fastboot erase boot
    >fastboot erase cache
    >fastboot erase recovery
    >fastboot erase system
    >fastboot erase userdata
    >fastboot oem unlock

    Now open a command prompt in the unzipped factory image folder, there will be a file called bootloaderXXXXXXXXXXX.img or something similar. Use this instead of bootload.img below. Now type in:

    >fastboot flash bootloader bootloader.img
    >fastboot reboot-bootloader

    Once bootloader has restarted. Open a new command prompt inside the second unzipped folder (inside the unzipped factory image folder) and type in the following, some may take a while to complete:

    >fastboot flash recovery recovery.img
    >fastboot flash boot boot.img
    >fastboot flash system system.img
    >fastboot flash cache cache.img
    >fastboot userdata userdata.img

    If you are just recovering your device and keeping on stock android, lock up your boot loader by typeing into the command prompt:

    >fastboot oem lock

    Otherwise if you are attempting to install Nethunter again or another custom ROM, leave it unlocked. For both you now need to type into the command prompt:

    >fastboot reboot

    You device may take 15 minuites to reboot. as it's unpacking a file that was around 1gig and turning it into your 6gb operating system.

    Now if you want to install Nethunter you can begin the guide in the rooting section, but you wil already have most of the tools installed.

    Wrapping up:
    Thanks for reading, I hope this guide helped you in some way. Good luck, have fun!

  4. #4
    Join Date
    2015-Sep
    Posts
    1
    Hi,

    First - thanks for sharing, that was very helpful and informative.

    I believe that there is a confusion in the next section:

    Quote Originally Posted by Greenwolf View Post
    Use the volume buttons to change between options and the power button to confirm. Press yes to unlock. Bootloader will restart. Then use the buttons to start/restart the device and boot it normally.

    On your computer download the latest TWRP recovery image(2.8.5.0 at the time of writing) and rename it to 'recovery-twrp.img'. Open a command prompt on the folder where this file is located by shift-rightclicking on the folder and choosing 'open command prompt here'. Now with your device still plugged in run:

    > fastboot flash recovery recovery-twrp.img
    After the device is booted normally the fastboot command does not recognize the device, so I had to reboot back into the bootloader and only then issued the fastboot command which worked like a charm.

  5. #5
    Join Date
    2015-Oct
    Posts
    1
    So I am rooted, and in debug mode, but for some reason the phone isnt responding to any cmd prompts. they just return ". . . is not recognized as an internal or external bla bla bla"

    What am I missing?

  6. #6
    Join Date
    2015-Oct
    Posts
    6
    can u edit it so people know where the /data/local.. is multirom/roms/LMY48M/data/local/tmp/nethunter.zip (LMY48M) will be different sometimes

  7. #7
    Join Date
    2015-Oct
    Location
    China
    Posts
    1
    Very helpful and detailed tutorial!

    I'm very new to Android and Nethunter, this was the only place that I found how to install Nethunter 2.0 - straightforward on my new Nexus 5 from Android 5.1.1!

    I was doind something else and missed to install MultiROM manager, so I was stuck because I could not find MultiRom option in TWRP ;(....was wondering what I have missed...

    Thank you for putting this together!

  8. #8
    Join Date
    2015-Oct
    Posts
    3
    In the first post in this thread under the section "How to root your device" where the correct rooter for the device shall be downloaded from the chainfire website, there is yet another way of getting the "name" of the device and that is to ask the device itself. That takes the guessing out of the game and removes the need to check the Google factory image page. Just issue the following command and the device (at least for Nexus) will tell its name:

    adb shell grep ro.product.name system/build.prop

  9. #9
    A few questions for OP:

    Tried this with the latest slim rom for the shamu and can never get it to boot it just loops the boot animation on the secondary rom after I install the nethunter zip. I can boot in to the secondary rom before I flash the nethunter zip but it just loops once I flash it. Checksum is good on the download so not that. I also have the correct recovery, kernel (tried a few) and version of multi rom. Everything flashes correctly but I was wondering @sherzod33 states that /data/local/tmp is actually at /multirom/roms/yourosversion/data/local/tmp/nethunter zip and I have just been copying mine to /data/local/tmp so this is the only part I am unsure of. Also multirom is not compatible with the Nexus 9 so is there any other way to install to this device without multirom?

  10. #10
    Join Date
    2015-Oct
    Posts
    2
    I have the same issue with my new Nexus 9, Multirom is not available. I tried flashing using the Rom Manager from the Play Store and its TWRP functionality. I was able to get the install running. But after the installation I can't do anything else. After booting up the device an endless loop of NFC service, Phone service and Gmail terminated messages starts.

    Anyone got a solution for that?

    UPDATE:
    The problem seems to be that I was running 5.0 and 5.0.1 for my attempts to install it. After some asking on Githun I tried 5.1.1 and got it working. For details on my steps look at the issue on Github.
    Last edited by glynx; 2015-10-27 at 09:15.

  11. #11
    Join Date
    2015-Oct
    Posts
    2
    This is awesome. Worked smooth on Nexus7 2012 Lollipop. but my tplink-722N wireless adapter didnt work. I learnt that it is a known problem.
    I re-imaged the device to stock 4.4.4 and tried to install Nethunter for 4.4. The installation seems to be complete but when I try to launch the Kali terminal I get "bash: [: uid=0(root) gid=0(root): integer expression expected"

    can someone please help?

    regards,
    Prashanth

  12. #12
    Join Date
    2015-Nov
    Posts
    2
    Thanks , nice guide !
    i have one question:
    after all job complete bootloader still is unlocked do you need relock it? with relock maybe lost some data look like root or nethunter?

  13. #13
    Join Date
    2015-Nov
    Posts
    1
    Thanks for this!
    I spent a LOT of time trying to flash directly to my device instead of using MultiRom ;D (Guess I have to wait for 2.1... oh well).

    Anyways,

    When I rebooted my OnePlus One I never saw the "Cancel" option. It simply went Bootloader graphic, blank, Oxygen boot animation.

    Thoughts?

    Banjo

  14. #14
    Join Date
    2015-Dec
    Posts
    2
    Hi!

    1st of all I'd like to thank you for this tutorial. It helped me a lot! Nevertheless I'd like to add some piece of information:

    Quote Originally Posted by Greenwolf View Post
    Now with your device still plugged in run:
    > fastboot flash recovery recovery-twrp.img
    As said on their website TWRP should be startet after installation so that it won't be overwritten when the device reboots to the "normal" Android installation (at first boot TWRP patches it). That is what I did on a 2nd try ;-)

    Quote Originally Posted by Greenwolf View Post
    ...and download an app off the play store called 'root checker basic'. Open it up and tap on 'Verify Root'. Grant the app permission to run and it will tell you that Root acess is properly installed on your device.
    As I need it for some other purposes, I also startet the SU-app and used it's option to convert it to a system process...I do not know whether it is important for Nethunter but on my 1st try I did not convert it and had some issues wiht the installation. So maybe it is helpfull.

    Quote Originally Posted by Greenwolf View Post
    Open up the play store and search for MultiROM manager. Install and then open it. Check all of the boxes and tap 'Install'. Wait for it to complete. If your device restarts let the auto-boot complete and boot back into the internal Android rom.
    And start it again for checking whether it is installed correctly :-) I had to install it twice.

    Quote Originally Posted by Greenwolf View Post
    On the new screen tap on 'Flash ZIP' and navigate through the file system to '/data/local/tmp/' select the kali nethunter file that you put onto your device earlier and it will begin to flash/install. This may take a long time: ~20 minuites.
    I saw a message about a path not being found ("E:/...") but installation was successfull. Just in case some of you receive that msg, too. Flashing took about 30 minutes on my grouper. BTW I've used the work-around for un-bricking the device before installing Nethunter a second time and seemed to be much easier on a "fresh android".

    So long! style

  15. #15
    Join Date
    2015-Dec
    Posts
    1
    Thank you for the great info. I had to wipe out my device (given to me by friend) using the un-brick procedure as initially it wouldn't create the secondary ROM. The other issue I ran into was getting an error when trying to swap the ROM. I had to move nethunter.zip form data/local/tmp to a different location. I put in the Downloads folder then did the swap and nethunter installed nicely.

  16. #16
    ive been trying to download/install kali chroot from the nethunter.apk but the kali chroot manager/downloader/installer failed after 70 - 80% completion. from the terminal log, i noticed that the file in question is called kalifs-full.tar.xz and kalifs-minimal.tar.xz
    so i decided to look for any of the files online hoping to manually download and adb push it into the appropriate location. few moments later, i found kalifs-minimal.tar.bz hosted at androidfilehost website. it was not long before i feel that something is sketchy and realize that something is out of place. therefore here are my question:
    How to - if there is any way to know the legitimacy of this file?

    the file (kalifs-minimal) was downloaded and adb push'd into the appropriate folder as below:

    harayz@E6400:/sda4/android/nethunter$ adb push kalifs-full.zip /mnt/shell/emulated/0/
    1258 KB/s (768262587 bytes in 596.377s)
    it seems to be working and it is installing the meta packages for the past hour or so but i cant seem to ignore the suspicion and the doubt i have over the file integrity. when i put my tin-foil hat, the voices in my head is telling me that this is another tricks by the 3-letter agency to dig deeper into the community.

    anyhoo, i would like to hear any comment, respond or recomendation about this file and hopefully i can report the installationn status of my nethunter. best of luck to all that are trying and thank you to all that have shared. cheers~

  17. #17
    Join Date
    2013-Jul
    Posts
    9
    completely **** guide, steps are missing. When i type the command, it says "'adb' is not recognized as an internal or external command,
    operable program or batch file."

    so i figured that you must mean on android, so i go into play store to look for the terminal emulator, but it doesn't work either. SO FINALLY i realize .. oh wait, the noob did not say "REBOOT YOUR FUCKING DEVICE INTO THE RECOVERY MODE AND CHOOSE TERMINAL THERE!!!!" wasted over 1h trying to figure this out. then finally i try adb reboot-bootloader and it says "NOT FOUND"

    if you don't know how to write a step-by-step, just DONT. leave it for professionals who actually know how to write. all you do is just bumble here and wiggle there and say OH ITS DONE!
    NO! it's not done, you left half the steps out and nothing works. gonna look for a new guide, this is useless to anyone who haven't done this before and person who have done it, would not need this guide. so it's useless 100%.
    Last edited by g0tmi1k; 2018-02-13 at 13:24. Reason: Foul language

Similar Threads

  1. Supported device?
    By aaronouthier in forum Installing NetHunter
    Replies: 4
    Last Post: 2022-08-09, 12:39
  2. Replies: 0
    Last Post: 2020-12-24, 21:39
  3. nethunter install unsuported device any2kernal nexus 5
    By bobbymcfarleen in forum Installing NetHunter
    Replies: 3
    Last Post: 2016-04-21, 04:10
  4. Replies: 0
    Last Post: 2015-05-31, 09:40

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •