Skip to content

Instantly share code, notes, and snippets.

@Ejuc
Forked from yaci/install-arachni-on-kali.sh
Created September 21, 2020 11:34
Show Gist options
  • Save Ejuc/509cc2e2ae2869e226c79d6a18843f32 to your computer and use it in GitHub Desktop.
Save Ejuc/509cc2e2ae2869e226c79d6a18843f32 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