Ettercap v0.1 Installing script

A script written by Or Halimi  to install  ettercap , The apt-get version of Ettercap has a bug that prevent from Etterscript to compile and run the script properly.

#!/bin/bash

# check permissions
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi

echo -e "[ ] Setting up environment."
# Check for libs
libs=("debhelper" "libncurses5-dev" "libncurses-dev" "libpcap-dev" "openssl" "libtool" "cmake" "libssl-dev" "libltdl3-dev" "libnet1-dev" "libncurses5-dev" "libpcre3-dev" "ghostscript" "libcurl4-openssl-dev" "luajit-5.1-dev" "libssl-dev" "flex" "bison" "libgtk2.0-dev" "check" "libbsd-dev")

for lib in "${libs[@]}"; do
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $lib|grep "install ok installed")
if [ "" == "$PKG_OK" ]; then
echo "No $lib. Setting up $lib."
sudo apt-get --force-yes --yes install $lib
fi
done

echo -e "\e[00;32m[+]\e[00m Environment as been set."
echo "Start downloading Ettercap..."

# Starting the installation
cd /tmp
wget https://github.com/Ettercap/ettercap/archive/v0.8.0.tar.gz
echo -e "\e[00;32m[+]\e[00m Starting installation process"
tar zxvf v0.8.0.tar.gz > /dev/null
cd ettercap-0.8.0
echo -e "\e[00;32m[+]\e[00m Building Ettercap inside /tmp"
mkdir build
cd build
echo -e "\e[00;32m[+]\e[00m Making Ettercap inside /tmp/build"
echo "The making and the installing logs will be placed in the desktop"
cmake ../ > ~/Desktop/Ettercap_make.log
make >> ~/Desktop/Ettercap_make.log
echo -e "\e[00;32m[+]\e[00m Start installing...."
make install > ~/Desktop/InstallationLog.log
echo "Done!"

which ettercap >/dev/null
if [ $? -eq 1 ]; then
echo -e "\e[00;31m[-]\e[00m Ettercap was not installed successfully."
echo -e "\e[00;31m[-]\e[00m Go see Ettercap_make.log or InstallationLog.log to see what went wrong."
echo -e "\e[00;31m[-]\e[00m Please submit errors to yuval@see-security.com"
else
echo -e "\e[00;32m[+]\e[00m Ettercap 0.8.0 was installed successfull "
echo ""
echo -e "Use${bold} ettercap --help ${normal} to see more cool staff"
fi

Comments are closed.