Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Installer Errors #432

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,20 @@ This is a script by which you can install Kali nethunter (Kali Linux) in your te
### In Case Of SSL error: certificate verify failed
Rerun script with extra parameter `--insecure` or copy paste this command `./kalinethunter.sh --insecure`

### In case of APT error in kali: the public key is not available: NO_PUBKEY
1. Copy the missing key shown. For example:
```bash
Err:1 http://kali.download/kali kali-rolling InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ED444FF07D8D0BF6
```

The missing key would be `ED444FF07D8D0BF6`

2. Add key to keyserver `sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys ED444FF07D8D0BF6`
Just change the final part to the key you found missing


#### setup LXDE
Default __DESKTOP__ is _XFCE4_ but you can setup __LXDE__ also https://www.hax4us.com/2018/07/how-to-install-lxde-in-kali-nethunter.html?m=1
Default __DESKTOP__ is __XFCE4__ but you can setup __LXDE__ also https://www.hax4us.com/2018/07/how-to-install-lxde-in-kali-nethunter.html?m=1

#### You have any idea to improve ? So Just give PR
84 changes: 28 additions & 56 deletions kalinethunter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ checksysinfo() {
checkdeps() {
printf "\n${blue} [*] Updating apt cache..."
apt update -y &> /dev/null
echo "\n [*] Checking for all required tools..."
echo -e "\n [*] Checking for all required tools..."

for i in proot tar axel; do
if [ -e $PREFIX/bin/$i ]; then
echo "\n • ${i} is OK"
echo -e "\n • ${i} is OK"
else
echo "\nInstalling ${i}..."
echo -e "\nInstalling ${i}..."
apt install -y $i ||
{
printf "\n${red} ERROR: check your internet connection or apt"
Expand All @@ -84,13 +84,13 @@ seturl() {
# Utility function to get tar file
gettarfile() {
seturl
printf "\n$blue} [*] Fetching tar file"
printf "\n${blue} [*] Fetching tar file"
printf "\n from ${URL}"
cd $HOME
rootfs="kali-nethunter-rootfs-${chroot}-${SETARCH}.tar.xz"
printf "\n [*] Placing ${rootfs}"
DESTINATION=$HOME/chroot/kali-$SETARCH
printf "\n into {$DESTINATION}"
printf "\n into ${DESTINATION}"
printf "${reset}\n"
if [ ! -f "$rootfs" ]; then
axel ${EXTRAARGS} --alternate "$URL"
Expand All @@ -104,22 +104,23 @@ gettarfile() {

# Utility function to get SHA
getsha() {
seturl
printf "\n${blue} [*] Getting SHA ... $reset\n"
if [ -f kali-nethunter-rootfs-${chroot}-${SETARCH}.tar.xz.sha512sum ]; then
rm kali-nethunter-rootfs-${chroot}-${SETARCH}.tar.xz.sha512sum
fi
axel ${EXTRAARGS}
--alternate "${URL}.sha512sum" \\
axel ${EXTRAARGS} \
--alternate "${URL}.sha512sum" \
-o $rootfs.sha512sum
}

# Utility function to check integrity
checkintegrity() {
printf "\n${blue} [*] Checking integrity of file..."
prinf "\n [*] The script will immediately terminate in case of integrity failure"
printf "\n [*] The script will immediately terminate in case of integrity failure"
printf "${reset}\n"
sha512sum -c $rootfs.sha512sum || \\
{
sha512sum -c $rootfs.sha512sum || \
{
printf "${red} Sorry :( to say your downloaded linux file was corrupted"
printf "\n or half downloaded, but don'''t worry, just rerun my script"
printf "${reset}\n"
Expand All @@ -132,57 +133,28 @@ extract() {
printf "\n${blue} [*] Extracting ${rootfs}"
printf "\n into ${DESTINATION}"
printf "${reset}\n"
proot --link2symlink \\
tar -xf $rootfs \\
proot --link2symlink \
tar -xf $rootfs \
-C $HOME 2> /dev/null || :
}

# Utility function for login file
createloginfile() {
bin=$PREFIX/bin/startkali.sh
bin=$PREFIX/bin/startkali
printf "\n${blue} [*] Creating ${bin}"
printf "${reset}\n"
cat > $bin <<- EOM
#!/data/data/com.termux/files/usr/bin/bash -e
unset LD_PRELOAD

# colors
red='\033[1;31m'
yellow='\033[1;33m'
blue='\033[1;34m'
reset='\033[0m'

#####################
# SETARCH #
#####################
unknownarch() {
printf "\n${red} [*] Unknown Architecture :("
printf "${reset}\n"
exit
}

# Utility function for detect system
checksysinfo() {
printf "\n$blue [*] Checking host architecture ..."
case $(getprop ro.product.cpu.abi) in
arm64-v8a)
SETARCH=arm64;;
armeabi|armeabi-v7a)
SETARCH=armhf;;
*)
unknownarch;;
esac
printf "\n [*] SETARCH = ${SETARCH}"
}
if [ ! -f $DESTINATION/root/.version ]; then
touch $DESTINATION/root/.version
fi
user=kali
home=$DESTINATION/home/$user
home=/home/\$user
LOGIN="sudo -u \$user /bin/bash"
if [[ ("\$#" != "0" && ("\$1" == "-r")) ]]; then
user=root
home=$DESTINATION/$user
home=/\$user
LOGIN="/bin/bash --login"
shift
fi
Expand All @@ -196,18 +168,18 @@ cmd="proot \\
-b ${DESTINATION}/dev:/dev/shm \\
-b /sdcard \\
-b ${HOME} \\
-w ${home} \\
${PREFIX}/bin/env -i \\
HOME=${home} TERM=${TERM} \\
LANG=${LANG} \\
PATH=${DESTINATION}/bin:${home}/bin:${DESTINATION}/sbin:${home}/sbin:${DESTINATION}\etc:${home}/bin \\
${LOGIN}"

args="${@}"
if [ "${#}" == 0 ]; then
exec $cmd
-w \$home \\
/usr/bin/env -i \\
HOME=\$home TERM=\$TERM \\
LANG=\$LANG \\
PATH=/bin:/usr/bin:/sbin:/usr/sbin \\
\$LOGIN"

args="\$@"
if [ "\$#" == 0 ]; then
exec \$cmd
else
$cmd -c "${args}"
\$cmd -c "\$args"
fi
EOM
chmod 700 $bin
Expand All @@ -229,7 +201,7 @@ if [[ ! -z $1 ]]; then
fi

printf "\n${yellow} You are going to install Kali Nethunter"
printf "\n In Termux Without Root ;) Cool"
printf "\n In Termux Without Root ;) Cool\n"

pre_cleanup
checksysinfo
Expand Down