Skip to content

Instantly share code, notes, and snippets.

@softdream1981
Created September 15, 2022 17:00
Show Gist options
  • Select an option

  • Save softdream1981/5284ee7377aaa456f1fa4561a26fb74f to your computer and use it in GitHub Desktop.

Select an option

Save softdream1981/5284ee7377aaa456f1fa4561a26fb74f to your computer and use it in GitHub Desktop.
Install Kali Linux native tools on Debian Stretch/Buster.
#!/bin/bash
# @title Debian Kali Linux Installer
# @author Kamaran Layne <github.com/KamaranL>
# @description This script will install the repo and GPG keys required to install native kali linux tools
# on your Debian installation
# check permissions
if [ "$USER" == "root" ]; then
if [ "$1" == "install" ]; then
# pre-requisites
apt-get update
apt-get install -y wget
# repo and keys
echo "deb http://http.kali.org/kali kali-rolling main non-free contrib" > /etc/apt/sources.list.d/kali.list
wget https://archive.kali.org/archive-key.asc
apt-key add archive-key.asc
apt-get update
echo "SUCCESS: Kali Linux repository and GPG keys have been added."
exit 0
elif [ "$1" == "enable" ]; then
# enable repo
echo "deb http://http.kali.org/kali kali-rolling main non-free contrib" > /etc/apt/sources.list.d/kali.list
apt-get update
echo "SUCCESS: Kali repository ENABLED."
exit 0
elif [ "$1" == "disable" ]; then
# disable repo
echo "#deb http://http.kali.org/kali kali-rolling main non-free contrib" > /etc/apt/sources.list.d/kali.list
apt-get update
echo -e "SUCCESS: Kali repository DISABLED."
exit 0
elif [ "$1" == "help" ]; then
# help menu
echo -e "\nUsage: $BASH_SOURCE [argument]\n\nArguments:\n\n\
install Adds the Kali Linux repository and installs GPG keys.\n\n\
enable Enables the Kali Linux repository.\n\n\
disable Disables the Kali Linux repository.\n\n" | sed -e "s|^[[:space:]]*||"
exit 0
else
echo -e "ERROR: Invalid argument supplied.\nTry '$BASH_SOURCE help' for more information."
exit 1
fi
else
echo -e "ERROR: Please run again as root."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment