install.sh
Embedded APT28 implant strings
AArch64 (ARM64) architecture stringReferences curl flags and HTTP URL
SHA-256aeee6c0e027e13d3436a0f2154869de8782bf249c596302e6c8b2192f2e4ca09
MaleculeO(Xe)H₆(Cm₁₀DbF₁₃Os₃Po₃U)Md(Pt₃)
Evidence
15:33… ROR]${NC} $1" >&2; }
16
17# Check if command exists
18command_exists() {
19 command -v "$1" >/dev/null 2>&1
20}
21
22# Lightweight JSON URL extractor using grep and sed (no jq/python)
23parse_and_select_url() {
24 local response="$1"
25 local target_os="$2"
26 local target_arch="$3"
27 …
28:13… j_os obj_arch obj_url
29 local found_url=""
30 local tmpfile="/tmp/codearts_parse_$$"
31
32 echo "$response" | grep -oE '\{"os"[^}]*\}' > "$tmpfile"
33
34 while read -r obj; do
35 obj_os=$(echo "$obj" | grep -oE '"os"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/.*"\([^"]*\)"$/\1/')
36 obj_arch=$(echo "$obj" | grep -oE '"arch"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/.*"\([^"]*\)"$/\1/')
37 obj_url=$(echo "$obj" | grep -oE '"url"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/.*"\([^"]*\)"$/\1/')
38
39 if [ "$obj_os" = "$target_os" ] && [ "$obj_arch" = "$target_arch" ] && [ -n "$obj_url" ]; then
40 fou …
40:21… l="$obj_url"
41 break
42 fi
43 done < "$tmpfile"
44
45 rm -f "$tmpfile"
46
⋯6 lines
53# Install binary
54install_binary() {
55 # Detect OS and architecture using the improved logic
56 local raw_os=$(uname -s)
57 local os=$(echo "$raw_os" | tr '[:upper:]' '[:lower:]')
58 case "$raw_os" in
59 Darwin*) os="darwin" ;;
60 Linux*) os="linux" ;;
61 MINGW*|MSYS*|CYGWIN*)
62 log_error "Windows is not supported by this installer."
63 exit 1
64 ;;
⋯4 lines
69 esac
70
71 local arch=$(uname -m)
72 if [ "$arch" = "aarch64" ]; then
73 arch="arm64"
74 fi
75 if [ "$arch" = "x86_64" ]; then
76 arch="x64"
77 fi
78
79 # Rosetta detection for Darwin (if running x64 on arm64)
80 if [ "$os" = "darwin" ] && [ "$arch" = "x64" ]; then
81 rosetta_flag=$(sysctl -n sysctl.proc_translated 2>/dev/null || echo 0)
82 if [ "$rosetta_flag" = "1" ]; then
83 arch="arm64"
⋯4 lines
107:14… mmand -v ldd >/dev/null 2>&1; then
108 if ldd --version 2>&1 | grep -qi musl; then
109 is_musl=true
110 fi
111 fi
112 fi
113
114 # Check for AVX2 baseline requirement
115 local needs_baseline=false
116 if [ "$arch" = "x64" ]; then …
117:6… if [ "$os" = "linux" ]; then
118 if ! grep -qwi avx2 /proc/cpuinfo 2>/dev/null; then
119 needs_baseline=true
120 fi
121 fi
122 if [ "$os" = "darwin" ]; then
123 avx2=$(sysctl -n hw.optional.avx2_0 2>/dev/null || echo 0)
124 if [ "$avx2" != "1" ]; then
125 needs_baseline=true
⋯5 lines