PDA

View Full Version : |Tutorial| How to build and install the new NetHunter|Marshmallow 6.0.1|



xorion33
2015-12-28, 18:23
Hi guys.
Hope you all had a good Christmas , today i have a tutorial for you.
I will show you how to build the new version of NetHunter and install it to your device(must be a supported device,,see the list below)

Nexus 4(mako)
Nexus 5(hammerhead)
Nexus 6(shamu)
Nexus 7 2012(nakasi) and 2013 model(razor)
Nexus 9(volantis)
Nexus 10(mantaray)
One Plus One(bacon)

For my build setup i have Kali Linux installed in vmware, you could use virtualbox also.
If you have it installed on your pc,,more power to you.
So the requirements are:

Have Kali Linux in a vm or installed on your pc(you could do the same thing on ubuntu,,but for the sake of it i use kali)
A rooted supported android device(for marshmallow you should root your device with supersu 2.64 , as of the day i write this tutorial it's the latest)https://drive.google.com/file/d/0B740ZYyX2XXkRlVZX3JWV0diN00/view?usp=sharing <=link to SuperSu here

Please note: this tutorial will not show you how to install linux neither how to root your android device.
I tested on a nexus 5 (my phone) and i have the latest marshmallow 6.0.1 on it and device is rooted.
It's not very complicated, if you ever built android roms or aosp from source it's a lot easier, the Nethunter guys made a script that pretty much
does it all by itself.

First thing , we will make a folder to work in, name it the way you want , i will just call it nethunter:

mkdir ~/nethunter

Then change directory into the folder you created:

cd ~/nethunter

Once inside the folder type:


git clone https://github.com/offensive-security/gcc-arm-linux-gnueabihf-4.7

After that we are going to clone the repo of the new installer branch like so:


git clone https://github.com/offensive-security/kali-nethunter.git -b newinstaller-fj

What we just done will created a folder named AnyKernel2 so we are going to change directory into it:

cd ~/nethunter/kali-nethunter/AnyKernel2

Then we are ready to build:

python build.py -d hammerhead -m (the -d means the device you are building for in my case it's a nexus 5 codename hammerhead,,and the -m means
marshmallow)


Once it's done,,you will have a zip file into the AnyKernel2 folder, and this is what you are going to flash in recovery to install NetHunter to your device.
The new installer is using aroma so you will be able to choose what to install.
On the first page or so you will be asked to install a version of SuperSu older than the one i provided you , untick this boxs, you don't want this to install and replace the version of SuperSu you curently have(2.64 ++)
When aroma will install it's probable that it will stuck at 40% for a couple of minutes, don't worry, let it do his things,,but if you are stuck there for more than
lets say 10 minutes just force shudown your device by holding the power button down and reboot,,Kali NetHunter should have been installed correctly anyway.
Make sure that once you boot with your new KaliNethunter go into the Kali app and update the chroot.

That's about it, if you have any question feel free to ask i will take a look at the thread everyday.

**Big thanks to Binkybear and Jmingov who provided me usefull info**

emorrowdf
2015-12-29, 03:22
Did this a little bit ago, not sure if anyone else will have this problem but I noticed that when I flashed the ZIP that the kernel didnt change for some reason. Used AnyKernel to make the kernel and just flashed that and no problems except for some reason hid attack isnt working on the N6.

xorion33
2015-12-29, 14:39
Did this a little bit ago, not sure if anyone else will have this problem but I noticed that when I flashed the ZIP that the kernel didnt change for some reason. Used AnyKernel to make the kernel and just flashed that and no problems except for some reason hid attack isnt working on the N6.
It means something wasn't done right , I know I had the same error the first time.
Make sure to git clone the newinstaller branch.

emorrowdf
2015-12-29, 19:00
It means something wasn't done right , I know I had the same error the first time.
Make sure to git clone the newinstaller branch.

Weird you were absolutely right. I had done NOTHING different and yet it was still bugged. Restored to stock and tried again and everything worked perfectly.

xorion33
2015-12-29, 21:20
Weird you were absolutely right. I had done NOTHING different and yet it was still bugged. Restored to stock and tried again and everything worked perfectly.

That's good

pkw603
2015-12-31, 16:13
Anyone try this out on a nexus 9 yet? Everything installs and runs great except wifi monitor mode appears to no longer work for me. It worked great when I had it running g on my nexus 9 with the lollipop build. This time I reflashed stock marshmallow 6.0.1, built the zip off the newinstaller-fg branch and monitor mode fails.
I can post again later with better details but was just wondering about other's experience using this method for nexus 9/marshmallow 6.0.1.
Overall, this is seriously great work done by binkybear and the offsec team! Great job!

pkw603
2016-01-01, 16:14
Figured out what the issue was with getting my USB WiFi card into monitor mode on my nexus 9/marshmallow/nethunter build and thought I'd share. For some reason, the firmware files weren't getting copied into /system/etc/firmware (copied or symlinked or otherwise). Once I got the firmware over in there and rebooted it worked like a charm. :)

firedodge
2016-01-02, 20:32
Hi,

Thanks for the awesome tut. One thing that i ran into is that im trying to compile the Nakasi hethunter but comes up with this.

root@kali:~/nethunter/kali-nethunter/AnyKernel2# python build.py -d nakasi -m
Traceback (most recent call last):
File "build.py", line 525, in <module>
main()
File "build.py", line 325, in main
aroma_enabled = Config.get(args.device, 'aroma')
File "/usr/lib/python2.7/ConfigParser.py", line 607, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'nakasi'

root@kali:~/nethunter/kali-nethunter/AnyKernel2# python build.py -d grouper -m
SEPOLICY not found at: kernels/marshmallow/grouper/sepolicy
Kernel not found at: kernels/marshmallow/grouper/zImage



Maybe something I can fix or if you know something please let me know. Thanks

skwifta13
2016-01-03, 19:28
Figured out what the issue was with getting my USB WiFi card into monitor mode on my nexus 9/marshmallow/nethunter build and thought I'd share. For some reason, the firmware files weren't getting copied into /system/etc/firmware (copied or symlinked or otherwise). Once I got the firmware over in there and rebooted it worked like a charm.

Think I may have a similar problem with the nexus 10 on lollipop. Everything else is working fine as far as i can see, just get an error when trying to bring up wlan1 (external usb wifi). I would be really gratefull to anyone who could provide a little extra info as to how to copy/symlink the firmware files over to system/etc/firmware. (mainly where to copy from but any other info would be much appriciated)
thanks.

pkw603
2016-01-04, 19:53
If you don't already have the firmware files you can grab them from the git repo (https://github.com/offensive-security/kali-nethunter/tree/master/AnyKernel2/system/etc/firmware). Then you can use a file manager like ES File Explorer to copy them into /system/etc/firmware. With ES File Explorer just make sure you enable "Root Explorer" and "Show hidden files" in settings.

nihad15
2016-01-05, 17:45
Would you one mind (hopefully the OP) building an image for hammerhead with this included ?
https://dev.seemoo.tu-darmstadt.de/bcm/bcm-public
(This is a mod to enable monitoring mode on the native chipset included with hammerhead)
I'm not a dev and not even close I'm sorry if this is an inappropriate request
If it is a apologize and will gladly remove my reply

brooksly.com
2016-01-06, 20:59
I'm getting stuck with the below error when cloning the repo of the installer branch: fatal: Remote branch installer-fj not found in upstream origin Any ideas on why the data is not there? Do I need to change the syntax?

exPat17
2016-01-14, 18:09
@brooksly.com

It failed for me as well. You can get around it by just downloading the entire kali-nethunter repository instead of the branch.


git clone https://github.com/offensive-security/kali-nethunter.git

===================================

My current issue is that the Nexus 7 Razor kernel isn't in the Marshmallow folder and I'm having trouble tracking one down.

viejo verde
2016-01-21, 14:30
Hi guys.
Hope you all had a good Christmas , today i have a tutorial for you.
I will show you how to build the new version of NetHunter and install it to your device(must be a supported device,,see the list below)


One Plus One(bacon)

For my build setup i have Kali Linux installed in vmware, you could use virtualbox also.
If you have it installed on your pc,,more power to you.
So the requirements are:

Have Kali Linux in a vm or installed on your pc(you could do the same thing on ubuntu,,but for the sake of it i use kali)
A rooted supported android device(for marshmallow you should root your device with supersu 2.64 , as of the day i write this tutorial it's the latest)https://drive.google.com/file/d/0B740ZYyX2XXkRlVZX3JWV0diN00/view?usp=sharing <=link to SuperSu here

Please note: this tutorial will not show you how to install linux neither how to root your android device.
I tested on a nexus 5 (my phone) and i have the latest marshmallow 6.0.1 on it and device is rooted.
It's not very complicated, if you ever built android roms or aosp from source it's a lot easier, the Nethunter guys made a script that pretty much
does it all by itself.

First thing , we will make a folder to work in, name it the way you want , i will just call it nethunter:

mkdir ~/nethunter

Then change directory into the folder you created:

cd ~/nethunter

Once inside the folder type:


git clone https://github.com/offensive-security/gcc-arm-linux-gnueabihf-4.7

After that we are going to clone the repo of the new installer branch like so:


git clone https://github.com/offensive-security/kali-nethunter.git -b newinstaller-fj

What we just done will created a folder named AnyKernel2 so we are going to change directory into it:

cd ~/nethunter/kali-nethunter/AnyKernel2

Then we are ready to build:

python build.py -d hammerhead -m (the -d means the device you are building for in my case it's a nexus 5 codename hammerhead,,and the -m means
marshmallow)


Once it's done,,you will have a zip file into the AnyKernel2 folder, and this is what you are going to flash in recovery to install NetHunter to your device.
The new installer is using aroma so you will be able to choose what to install.
On the first page or so you will be asked to install a version of SuperSu older than the one i provided you , untick this boxs, you don't want this to install and replace the version of SuperSu you curently have(2.64 ++)
When aroma will install it's probable that it will stuck at 40% for a couple of minutes, don't worry, let it do his things,,but if you are stuck there for more than
lets say 10 minutes just force shudown your device by holding the power button down and reboot,,Kali NetHunter should have been installed correctly anyway.
Make sure that once you boot with your new KaliNethunter go into the Kali app and update the chroot.

That's about it, if you have any question feel free to ask i will take a look at the thread everyday.

**Big thanks to Binkybear and Jmingov who provided me usefull info**

Thanks. I will wait until there is an official full signed CM13 zip for my rooted encypted OnePlusOne. I built Nethunter for OPO Lollipop on Kali Linux 2.0 following Binkybear's directions.

anilrawal
2016-02-20, 23:00
Thanks. I will wait until there is an official full signed CM13 zip for my rooted encypted OnePlusOne. I built Nethunter for OPO Lollipop on Kali Linux 2.0 following Binkybear's directions.

Looks like this info is missing some steps, even the one options mentioned on official site :https://github.com/offensive-security/kali-nethunter/wiki/Building-Nethunter

did not work for me.

The folder anykernel2 is missing, even compiling in the other folder "https://github.com/offensive-security/kali-nethunter/tree/master/nethunter-installer" where build.py is located the compiled version build is only 65mb, where as the official downloaded version is around 700mb.

If any one can provide a complete steps would be great.

Thanks.

jcadduono
2016-02-21, 01:04
x.x

https://github.com/jcadduono/kali-nethunter/blob/master/nethunter-installer/README.md

readmeeeeeeeeeeeeeeeeeeeeeees!

git clone -b master https://github.com/offensive-security/kali-nethunter.git
cd kali-nethunter/nethunter-installer
./build.py -d yourdevice --marshmallow --rootfs full --release 3.0.5-or-something

(it was 65 MB because rootfs was not included, and would have been downloaded by the NetHunter app after flashing -- adding --rootfs full will give you the ~750 MB result)

sorry for confusing y'all with the new, new, newer, awesome installer :P

mabusdogma
2016-05-03, 18:00
After that we are going to clone the repo of the new installer branch like so:
[LIST]

git clone https://github.com/offensive-security/kali-nethunter.git -b newinstaller-fj

This is the anwser I've got:
Cloning into 'kali-nethunter'...
fatal: Remote branch newinstaller-fj not found in upstream origin

Any ideas? :(

bennieUpsef
2019-04-23, 12:39
Never done it but it sounds interesting. I am a home theater buff but never found a reason to build one of these. With the networking options available these days everything I need to do is covered. What would you use yours for?