Professional Documents
Culture Documents
Kalinethunter
Kalinethunter
termux/files/usr/bin/bash -e
# Copyright ©2018 by Hax4Us. All rights reserved. 🌎 🌍 🌏 🌐 🗺
#
# https://hax4us.com
################################################################################
# colors
red='\033[1;31m'
yellow='\033[1;33m'
blue='\033[1;34m'
reset='\033[0m'
# Clean up
pre_cleanup() {
find $HOME -name "kali*" -type d -exec rm -rf {} \; || :
}
post_cleanup() {
find $HOME -name "kalifs*" -type f -exec rm -rf {} \;
}
proot_patch() {
printf "\n\n"
printf "${blue}[*]$yellow HUAWEI kernel detected ...$reset"
axel --alternate
https://github.com/Hax4us/Nethunter-In-Termux/raw/master/proot
mv proot $PREFIX/bin
chmod +x $PREFIX/bin/proot
apk-mark hold proot
}
#####################
# Decide Chroot #
#####################
setchroot() {
chroot=minimal
}
unknownarch() {
printf "$red"
echo "[*] Unknown Architecture :("
printf "$reset"
exit
}
checksysinfo() {
printf "$blue [*] Checking host architecture ..."
case $(getprop ro.product.cpu.abi) in
arm64-v8a)
SETARCH=arm64
;;
armeabi|armeabi-v7a)
SETARCH=armhf
;;
*)
unknownarch
;;
esac
}
checkdeps() {
printf "${blue}\n"
echo " [*] Updating apt cache..."
apt update -y &> /dev/null
echo " [*] Checking for all required tools..."
seturl() {
URL="https://build.nethunter.com/kalifs/kalifs-20171013/kalifs-${1}-$
{chroot}.tar.xz"
}
gettarfile() {
printf "$blue [*] Getting tar file...$reset\n\n"
DESTINATION=$HOME/kali-${SETARCH}
seturl $SETARCH
axel --alternate "$URL"
rootfs="kalifs-${SETARCH}-${chroot}.tar.xz"
}
getsha() {
printf "\n${blue} [*] Getting SHA ... $reset\n\n"
axel --alternate "https://build.nethunter.com/kalifs/kalifs-20171013/kalifs-$
{SETARCH}-${chroot}.sha512sum"
}
extract() {
printf "$blue [*] Extracting... $reset\n\n"
proot --link2symlink tar -xf $rootfs 2> /dev/null || :
}
createloginfile() {
bin=${PREFIX}/bin/startkali
cat > $bin <<- EOM
#!/data/data/com.termux/files/usr/bin/bash -e
unset LD_PRELOAD
exec proot --link2symlink -0 -r ${DESTINATION} -b /dev/ -b /sys/ -b /proc/ -b
/storage/ -b $HOME -w $HOME /usr/bin/env -i HOME=/root USER=root TERM="$TERM"
LANG=$LANG PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash --login
EOM
printline() {
printf "${blue}\n"
echo " #-----------------------------------------------#"
}
#################
# Start #
#################
clear
#EXTRAARGS="default"
if [[ ! -z $1 ]]
then
EXTRAARGS=$1
if [[ $EXTRAARGS = "uninstall" ]]
then
echo "uninstalled"
exit
fi
fi
# Dont run in non-home
if [ `pwd` != $HOME ]; then
printf "$red You are not in home :($reset"
exit 2
fi
printf "\n${yellow} You are going to install Kali Nethunter In Termux Without
Root ;) Cool\n\n"
pre_cleanup
checksysinfo
SETARCH=armhf
checkdeps
if [ $(getprop ro.product.manufacturer) = HUAWEI -a $SETARCH = arm64 ]
then
proot_patch
fi
setchroot
gettarfile
getsha
checkintegrity
extract
createloginfile
post_cleanup
################
# finaltouchup #
################
finalwork() {
[ -e $HOME/finaltouchup.sh ] && rm $HOME/finaltouchup.sh
echo
axel -a
https://github.com/Hax4us/Nethunter-In-Termux/raw/master/finaltouchup.sh
DESTINATION=$DESTINATION SETARCH=$SETARCH bash $HOME/finaltouchup.sh
}
#finalwork
printline
printf "\n${yellow} Now you can enjoy Kali Nethuter in your Termux :)\n"
printline
printline
printf "\n${blue} [∆] My official email:${yellow} lkpandey950@gmail.com.com\n"
printf "$blue [∆] My website:${yellow} https://hax4us.com\n"
printf "$blue [∆] My YouTube channel:${yellow} https://youtube.com/hax4us\n"
printline
printf "$reset"