shell bypass 403

UnknownSec Shell

: /usr/share/lve/modlscapi/hooks/ [ drwxr-xr-x ]
Uname: Linux dedi-15171674.espacofacial.com.br 5.14.0-687.48.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Sep 16 12:22:07 EDT 2026 x86_64
Software: Apache
PHP version: 8.2.33 [ PHP INFO ] PHP os: Linux
Server Ip: 104.21.5.151
Your Ip: 216.73.217.13
User: espa7358 (1004) | Group: espa7358 (1003)
Safe Mode: OFF
Disable Function:
NONE

name : cpanel_check_handlers_hook.sh
#!/usr/bin/bash

CMD="$1"

HLOG="/usr/share/lve/modlscapi/logs/last.pre.upcp.handlers"

function get_current_handlers() {
    /usr/sbin/whmapi1 php_get_handlers | while read -r line;
    do
        echo -n "$line" | sed -n '/current_handler:/p' >> "$LOG"
        echo " $line" | sed -n '/version: [ea:alt]/p' >> "$LOG"
    done
}

function set_handlers_back() {
    cat "$HLOG" | while read -r line;
    do
        HANDLER=$(echo "$line" | cut -d ' ' -f2)
        PHPVERS=$(echo "$line" | cut -d ' ' -f4)
        echo "Setting $PHPVERS to $HANDLER handler" >> "$LOG"
        /usr/sbin/whmapi1 php_set_handler version="$PHPVERS" handler="$HANDLER" 2>/dev/null >/dev/null
    done
}

if [ "$CMD" == "--pre" ]; then
    LOG="/usr/share/lve/modlscapi/logs/Pre.upcp.$(date +%Y-%m-%d_%H:%M).log"
    get_current_handlers
    truncate -s 0 "$HLOG"
    cat "$LOG" >> "$HLOG"
    exit 0
fi

if [ "$CMD" == "--post" ]; then
    LOG="/usr/share/lve/modlscapi/logs/Post.upcp.$(date +%Y-%m-%d_%H:%M).log"
    get_current_handlers
    if diff "$LOG" "$HLOG" >/dev/null ; then
        echo "Handlers matched after upcp" >> "$LOG"
    else
        echo "Error: Handlers not matched after upcp" >> "$LOG"
        # Uncomment on the server where the lsapi handler is automatically turned off after the upcp
        set_handlers_back
    fi
    exit 0
fi


© 2026 UnknownSec