Prerequisite commands:
To have full access to your system and avoid any errors during the following procedures you need to escalate your privileges to root by typing the following command and upon request type in your password that you set up during installation, default is kali :
sudo -s
After you have escalated your privileges you will now put in the following command to update and upgrade all currently installed binaries:
apt update && apt full-upgrade -y
———————————————————————————————————————–
-First, we need to create a backup of Kali’s sources.list file in order to restore it later , command :
mv /etc/apt/sources.list /etc/apt/sources.list.bak
————————————————————————————————————————————–
-Remove currently installed Kali Updates
Go to /var/lib/apt/lists and delete all the files within the directory, leaving only the partial and auxfiles directory, command:
find /var/lib/apt/lists -type f -exec rm {} \;
————————————————————————————————————————————–
-Download Ubuntu Sources.list File
Download Ubuntu’s sources.list file into the /etc/apt/ directory, command:
wget https://gist.githubusercontent.com/ishad0w/788555191c7037e249a439542c53e170/raw/3822ba49241e6fd851ca1c1cbcc4d7e87382f484/sources.list -O /etc/apt/sources.list
————————————————————————————————————————————–
-Next , we need to add the specified public keys to our computer, commands:
apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 3B4FE6ACC0B21F32
apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 871920D1991BC93C
————————————————————————————————————————————–
-Run the command :
apt update && apt full-upgrade -y
and you should be ready to install snort now!
————————————————————————————————————————————–
-Install Snort
After successfully updating our apt repository using the Ubuntu sources.list file, we can install Snort, command:
apt install snort
Note: You will be prompted to enter the IP address or IP address range of your computer using CIDR notation for Snort’s configuration. Enter your IP address or IP address range and hit enter.
————————————————————————————————————————————–
-Restoring Kali’s Repository Sources.list File
After installing Snort, remove the new update files located in /var/lib/apt/lists command:
find /var/lib/apt/lists -type f -exec rm {} \;
————————————————————————————————————————————–
-Then, rename the current Ubuntu sources.list file to ubuntu_sources.list, just in case you need it again in the future, command:
mv /etc/apt/sources.list /etc/apt/ubuntu_sources.list
————————————————————————————————————————————–
-Rename the Kali Linux /etc/apt/sources.list.bak file back to /etc/apt/sources.list command:
mv /etc/apt/sources.list.bak /etc/apt/sources.list
————————————————————————————————————————————–
– Finaly run command :
apt update && apt full-upgrade -y