Kali (& metasploit) on the Galaxy Note 3
Install Kali on the GN3, using an app such as Linux Deploy or Complete Linux Installer, seemed incredibly simple; with most other droids, it is very simple. However, this particular phone kept erroring.
The Linux Deploy attempt merely said:
Updating environment ... FAILED
The Complete Linux Installer was a little more helpful, it said:
Checking loop device... missing Creating loop device ... mknod /dev/block/lop255 : operation not permitted FAILED! Error: unable to create loop device.
Fantastic. The phone was rooted, with a stock ROM, a stock kernel, and no custom recovery installed. Obviously, given that I had rooted my phone and was allowing super user permissions to both apps, the problem wasn't root related. It had to be an SeLinux issue.
The stock kernel, MJ7, does not allow you to change the SeLinux mode from "Enforcing" to "Permissive". Init.d scripts, run time terminal commands, and manually editing the /sys/fs/syslinux/enforce file all failed to persist the changes. No matter what I tried, something deep in the kernel was monitoring this file and reverting the bit to 1 (Enforcing) instantly.
I thought that installing a custom ROM might work. For that I needed a custom recovery. I could not get Odin for PC working through a VM, and did not have access to a native windows PC. Luckily, my phone was already rooted so I installed CMW recovery using the Odin Mobile app. It worked.
I went for Omega v6 as it fully supports s-pen and other Samsung features. I flashed it using the Omega Files Pro app. I hoped I would get lucky and find that the ROM overrides SeLinux. It doesn't. Omega v12 apparently does, however, I wasn't prepared to go to Android KitKat just yet.
Omega is a nice ROM that looks and feels like the stock ROM, with the option for less bloatware. I decided to keep it installed. I needed to replace the kernel though.
I found a 4.3 compatible kernel, which plays nicely with the stock n9005 ROM, and therefore, the Omega v6 ROM. It is available here: http://batcave.rasquin.co.uk/Android/Samsung/SGN3/01_kernel/faux123-yank555.lu/jb43-tw/hlteeur-faux123-yank555.lu-MJ6-004u.zip
I flashed this onto the device using Odin Mobile (open the file as OTA/Zip Update Installer). It installed successfully. I verified the SeLinux mode in each of the following ways:
$ su
# getenforce
# cat /sys/fs/selinux/enforce
Settings > General > About device > SELinux status
All showed either "Permissive" or "0".
Finally.
I was then able to install Kali linux using the tutorial, and customised bootscript, found here:
http://www.usoftphone.com/t162478.html
Galaxy Note 3 n9005, SSH to kali, running the wonderful metasploit console















