Skip to content

Instantly share code, notes, and snippets.

@yaci
Last active May 15, 2023 23:57
Show Gist options
  • Save yaci/d59886dfc0a26456dbd65c482e71dec4 to your computer and use it in GitHub Desktop.
Save yaci/d59886dfc0a26456dbd65c482e71dec4 to your computer and use it in GitHub Desktop.
Install Arachni on Kali Linux
#! /bin/bash
######
# TO DOWNLOAD THIS SCRIPT SIMPLY TYPE:
# wget bit.ly/kali-arachni
######
#arachni will be installed in $targetInstallationDirectory/$targetDirectoryName
targetInstallationDirectory="$HOME/soft"
targetDirectoryName=arachni
#--- try not to modify anything below this line---
echoAndExit() {
echo "$1"
exit -1;
}
mkdir -p $targetInstallationDirectory
cd $targetInstallationDirectory
if [ -d arachni ]; then
echoAndExit "It seems that folder with arachni already exists under $targetInstallationDirectory. Exiting..."
fi
# get url to the latest arachni release through github api
arachniTarUrl=$(curl -s https://api.github.com/repos/Arachni/arachni/releases/latest | tr ',' '\n' | grep browser_download_url | grep 'linux-x86_64.tar.gz\"' | cut -d\" -f4)
if [[ ! $arachniTarUrl =~ ^https://.*\.tar\.gz$ ]]; then
echoAndExit "Could not obtain arachni download link. This could indicate a problem with your internet connection. Or Github API miay have changed. Exiting..."
fi
mkdir arachni
fileName="${arachniTarUrl##*/}" #exctract file name from download url
echo "Downloading Arachni from Github: $arachniTarUrl"
curl -L $arachniTarUrl -o $fileName
tar -xf $fileName -C ./"$targetDirectoryName" --strip-components 1
echo "Done. Arachni executables are located under $targetInstallationDirectory/$targetDirectoryName/bin"
# on fresh kali linux ssh is not enabled and even if it was, the root user cannot ssh so it's better to add a new user
read -p "Do you want to add arachni-scanner user to the system? (y/n) " -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
adduser arachni-scanner
fi
read -p "Do you want to enable ssh? (y/n) " -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
systemctl enable ssh
service ssh start
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment