How To install Kali Linux (nethunter) On Android (Without root) via proot-distro and install Kali Linux Xfce Desktop On Android using Termux
Kali Linux is a Debian-derived Linux distribution designed for digital forensics and penetration testing. It is maintained and funded by Offensive Security , This tutorial isn't only about learning how to install Kali Linux. Okay let's run down what we will be doing
Table Of Content
•Installing Kali Linux Terminal
•Installing Kali Linux Desktop
•Installing Default packages
•Creating vncserver port
•Closing vncserver port
•Closing multiple vncserver ports
•Reseting Kali Linux
•Uninstalling Kali Linux
Okay!!!!
Let's Begin
Requirements:
• Termux : Click Here To Download Termux
Installation:
Please you can also copy and paste the commands below
The First thing we have to do is to make sure our repositories are up to date, to do that type the command
pkg update
It is essential to install proot-distro and wget as we will be installing Kali Linux on proot-distro for easy installation.
pkg install wget proot-distro
After that we need to add Kali linux rootfs profile to proot-distro list, to do that follow the guidelines below
nano $PREFIX/etc/proot-distro/kali.sh
Paste the following code in it
# This is a default distribution plug-in.
# Do not modify this file as your changes will be overwritten on next update.
# If you want customize installation, please make a copy.
DISTRO_NAME="Kali Linux (nethunter)"
TARBALL_URL['aarch64']="https://kali.download/nethunter-images/current/rootfs/kalifs-arm64-minimal.tar.xz"
TARBALL_SHA256['aarch64']="7e17a35e1528a5efc12bf1bbad00a764d38a5724e2b08a226849c594a3b3f029"
TARBALL_URL['arm']="https://kali.download/nethunter-images/current/rootfs/kalifs-armhf-minimal.tar.xz"
TARBALL_SHA256['arm']="62f07cd260cd31e9a84c25a331f3db0278d9ccdeb648522b69382946acdd8581"
TARBALL_URL['i686']="https://kali.download/nethunter-images/current/rootfs/kalifs-i386-minimal.tar.xz"
TARBALL_SHA256['i686']="e83cd8f57d6128efd64e88b191a1653ff315fffd78c05d536d2b6f63b2e6d49d"
TARBALL_URL['x86_64']="https://kali.download/nethunter-images/current/rootfs/kalifs-amd64-minimal.tar.xz"
TARBALL_SHA256['x86_64']="096290b7229ab81f1ac3b35324a7109dc19f1e2f5bf6aab1ff8254ebc95463ea"
Save with Ctrl+o and exit with Ctrl+x
The next thing we're going to do is install kali linux, to do that type or copy and paste the command:
proot-distro install kali
After this, you can now successfully login to your Kali Linux with the command:
proot-distro login kali
By default, after installation, Kali Linux on android rootless phone doesn't support upgrade, and that is because of postgresql as it blocks the upgrade command from working on Kali, to fix this all we have to do is delete the postgresql file, we can delete the postgresql file with this command
rm -rf /var/lib/dpkg/info/postgresql* && dpkg --configure -a
This should fix the error and you can continue with using your Kali as usual
Now, you can update and upgrade kali repository with the command
apt update && apt upgrade
Select "install package mainter's version " And now you can proceed to using Kali Linux as usual.
Now Install Kali Linux Xfce Desktop On Android :
Requirements:
• Termux : Click Here To Download Termux
• AVNC : Click Here To Download AVNC
How To install Kali XFCE Desktop
Login to your terminal with the command proot-distro login kali as shown in the previous article, then upgrade your terminal with the command
apt full-upgrade
After that, the next thing we're going to do is install udisks2, you can install udisks2 with the command
apt install udisks2
Now we remove the default udisks2 file and configure a new one, you can do that with the commands below.
Removing
rm /var/lib/dpkg/info/udisks2.postinst
configuration
echo "" >> /var/lib/dpkg/info/udisks2.postinst
Now you configure the dpkg file and hold udisks2, you can do that with the commands below.
Configuring dpkg
dpkg --configure -a
Holding udisks2
apt-mark hold udisks2
Now we install xfce
After finishing up with all of the procedures above, then Xfce Desktop is now safe for installation, to install xfce you can use the command:
apt install xfce4 xfce4-whiskermenu-plugin
The command above is going to install xfce, after that we're going to install other utilities like dbus launcher, qterminal, Firefox e.t.c you can simply use the command below to install all utilities at once:
apt install qterminal dbus-x11 firefox-esr tigervnc-standalone-server kali-themes
Now we can launch vncserver by using the command:
vncserver -geometry 1500x720 -xstartup /usr/bin/xfce4-session
Then Create your Kali Linux password
After this go to AVNC tap on "+" icon below and fill in the vncserver details
NOTE: geometry size depends on the resolution of your phone
Installing all default Kali Linux packages:
Now that we have logged into Kali desktop environment we are going to install all Kali Linux tool at once (Note: Please you need to have up to 15gb space on your phone and you need to have up to 2gb data subscription)
Go to termux, login to Kali and type this command:
sudo apt install kali-linux-default
Closing vncserver:
And you can always kill vncserver with the command vncserver -kill :1(always remember to close vncserver before exiting termux)
How To close multiple vncserver ports:
Okay I have experience a lot of problem with vncserver it creates another port and leave the old one connected (which makes it useless) whenever I forget to close it (you will experience the same issues) if you face this problem you have to ways to fix
•Change the port number : go to AVNC, long tap on Kali Linux, click on edit and change the port number to the one matching the termux display
•Close all port: if you want to close all port all you need to do is type this command
rm -rf /tmp/
When you type this command you will need to restart your Kali Linux type "Ctrl+D" then login in to Kali back and type the vncserver command startup.The command above will delete the port folder and the port number will start counting from beginning
OR
How To Reinstall kali Linux:
If you need help in resetting Kali Linux you can use this command to do so
proot-distro reset kali
How To uninstall Kali Linux:
If you are bored of Kali Linux and want to uninstall it (maybe to get another os) you can use this command
proot-distro remove kali
That is going to be all for this tutorial, if you have any questions to ask me regarding this article, you can let me know in the comments section below, hope to hear from you soon. Stay safe
Comments
Post a Comment