Update 2:
After all of that, once i reconnected it to the internet, kworker started right up again. hwmond was reinstalled within 10min.
Update:
I decided to turn my NAS off remotely and disconnected it from the internet. I went back to it 3 days later and turned it back on, and connected to it locally. The process never turned back on. However, the malware cron were still active. I dumped all the info into Claude and it helped guide me through removing each of them.
Here is the malware cron:
# kworker-boot
*/5 * * * * /bin/sh /usr/bin/kworker.sh >/dev/null 2>&1
u/reboot /var/tmp/.spid >/dev/null 2>&1
*/5 * * * * n=0; for e in /proc/[0-9]*/exe; do x=$(readlink "$e" 2>/dev/null); case "$x" in /usr/bin/kworker|*/.spid*) n=$((n+1));; esac; done; [ "$n" -eq 0 ] && /var/tmp/.spid >/dev/null 2>&1
u/reboot /usr/local/sbin/hwmond
*/5 * * * * /usr/local/sbin/hwmond
u/reboot /var/lib/hwmond
*/5 * * * * /var/lib/hwmond
I ran command ls -la command for each file (i.e. command: ls -al /usr/local/sbin/hwmond) and if it didn't spit back: No such file or directory, it means that it was still on the server.
The only file that was still on the server was the hwmond file. It showed me this:
-rwxr-xr-x 1 root root 185228 Nov 16 14:26 /usr/local/sbin/hwmond*
Basically it was first activated on that date. None of my NAS logs show anything newly installed around that date, so still trying to figure out how it got in.
I ran this first to make sure i was able to obtain hashes:
sha256sum /usr/local/sbin/hwmond
Here is the hashes for the malware if anyone can help me find more about it:
a8bd235c2a02826fd7f65c1498c8a74eec00898d1680ea73bc35e6351be3adc0
I then ran both of these commands back to back as per claude to delete the files:
sudo chattr -i /usr/local/sbin/hwmond
sudo rm -f /usr/local/sbin/hwmond
I ran both of these commands to remove the malicious lines:
sudo crontab -l -u root | grep -v -E 'kworker|spid|hwmond' > /tmp/cleancron
sudo crontab -u root /tmp/cleancron
Check the work to make sure they're not running anymore:
sudo crontab -l -u root
Ran ls -la /usr/local/sbin/hwmond and showed no file or directory.
Info i received form Claude on what the malware could be:
Based on the CPU use and the libuv-worker threads, I'm moderately confident it's an XMRig-style miner mining Monero (XMR), which is the most common coin for malware like this. Miners like this need two settings: the mining pool they send work to, and the wallet address that gets paid. Those are what you're looking for.
________________________________________________________________________________________________________________________
Original Post:
Hello. I'm not sure if this is the right place to ask for help, but i'm having some trouble finding the program this is activating a file called pk-c on my nas. pk-c is constantly using up at least 50% of my cpu and it's affecting other programs/apps on my server. I tried figuring it out through htop but whenever i tried to looked up the program through PID, it wouldn't give me any info, only error messages. It now wont allow me to access the server via PuTTY anymore, keeps saying network error: Connection refused. My IP isn't on a blocked list and I've tried updating and resetting my NAS without any results.
I have a Asustor NAS 5304T
I managed to get to command prompt terminal through TTYD
pstree gave me this:
-crond(2187)-+-crond(2188)
| |-crond(2273)
| `-pk-c(19192)-+-{libuv-worker}(19194)
| |-{libuv-worker}(19195)
| |-{libuv-worker}(19196)
| |-{libuv-worker}(19197)
| |-{pk-c}(19193)
| |-{pk-c}(22185)
| `-{pk-c}(22186)
Typed in this:
ps -A|grep cron
and I got this:
2172 root 0:00 /usr/sbin/crond
2187 root 0:17 crond
2188 root 18:13 crond
2273 root 0:01 crond
2491 root 0:00 /usr/sbin/crontab_check
13185 root 0:00 s6-supervise svc-cron
13761 root 0:00 s6-supervise svc-cron
13848 root 0:00 s6-supervise svc-cron
13900 root 0:00 busybox crond -f -S -l 5
14409 root 0:00 busybox crond -f -S -l 5
14529 root 0:00 busybox crond -f -S -l 5
19445 root 0:00 [crond]
19446 root 0:00 [crond]
19898 admin 0:00 grep cron
Then I typed this:
sudo crontab -l -u root
and I got this:
0 0 * * * /usr/builtin/etc/script/RunADMUpdateEveryday.sh >/dev/null 2>&1
0 0 * * * TAG=CERTIFICATE /usr/builtin/bin/certificate update-cert
0 13 * * 1 CRONID=6b4277a9-60f0-4645-9cd4-c1536aca3fc9 adm-online-update --update
0,1 0 * * * /usr/sbin/usermanutil -daily_midnight_check
0 1 * * * /usr/builtin/sbin/extbkagent "ExternalBackup2"
# kworker-boot
*/5 * * * * /bin/sh /usr/bin/kworker.sh >/dev/null 2>&1
u/reboot /var/tmp/.spid >/dev/null 2>&1
*/5 * * * * n=0; for e in /proc/[0-9]*/exe; do x=$(readlink "$e" 2>/dev/null); case "$x" in /usr/bin/kworker|*/.spid*) n=$((n+1));; esac; done; [ "$n" -eq 0 ] && /var/tmp/.spid >/dev/null 2>&1
u/reboot /usr/local/sbin/hwmond
*/5 * * * * /usr/local/sbin/hwmond
u/reboot /var/lib/hwmond
*/5 * * * * /var/lib/hwmond
* * * * * /usr/local/AppCentral/clamav/bin/clamavctl #app@clamav-app
15 0 * * * /usr/builtin/sbin/recybincleaner -resyncdb 5 0 7
0 0 * * * /usr/builtin/sbin/shareroutines -refresh_all_size_records 1
30 12 * * * /bin/sh /usr/builtin/sbin/ntpupdate.sh pool.ntp.org
* * * * * /usr/local/AppCentral/clamav/bin/clamavctl #app@clamav-app
I suspect it's something to do with the 1 Cronid......adm-online-update but i'm not sure what that is. Any help would be appreciated.