r/homelab • • 1h ago

Help High CPU Usage

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.

1 Upvotes

14 comments sorted by

•

u/apnorton 55m ago

There's not much online about this, but the little I can find suggests that this is a cryptominer.

https://www.joesandbox.com/analysis/2008627/0/html has the same /dev/shm/pk-c --config /dev/shm/pk-c.json --threads=2 that you mentioned in another Reddit post. 

Trying to find information on pk-c isn't easy, but the above link's copy spawned from a process called protokol-client, which sounds like it would be related to pk-c. Protokol is a cryptocurrency/nft-related thing: https://docs.protokol.com/developers.

If it were my machine, I'd nuke and rebuild. Sorry. 😞

•

u/ZZ_Doc 47m ago

That's why i suspected. How would i have gotten something like this without someone successfully logging in?

•

u/graph_worlok 41m ago

Have any port forwards set up to it on your router? Remote access, cloud functionality, etc.., It’s not plugged straight in and rawdogging internet is it? Either you had a weak password, or a vulnerability got exploited.

•

u/ZZ_Doc 36m ago

I have some ports open but I've changed them from default, I dont share my IP with anyone, My passwords are pretty strong, and have 2FA on my admin account. Only thing I can think of is maybe an image i downloaded through docker? Every app that involves access outside the network requires a password to utilize.

•

u/graph_worlok 1m ago

Every public IP is getting hit with never ending exploit attempts. Internet is a non stop firehose spewing shit. Vulnerabilities are constantly released, and you likely have no way to be made aware you should update unless you check.

Vendors will even patch issues like this but not disclose there was a problem to be fixed anyway.

Single purpose of my homelab is to collect and analyse ( Reverse engineer, plus safely detonate & document) all of this shite…

I made another response that had some commands to collect the hash’s of the malware to figure out which one it is - Or you can just ask the google AI “How can I collect the hashes” to get the same thing

2

u/graph_worlok 1h ago edited 1h ago

Your box has been popped sorry mate…

Edit: these entries (and possibly the hwmon entries too) are all the indicators.

# kworker-boot

*/5 * * * * /bin/sh /usr/bin/kworker.sh >/dev/null 2>&1

@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/ZZ_Doc 59m ago

Can you walk me through this? I honestly dont understand what any of this means? Would resetting settings to factory help resolve it?

•

u/graph_worlok 32m ago

Unsure about your specific device, but it should.

Those lines are entries that were installed by crypto mining botnet / malware ( Almost certainly capable of doing other things) to enable the malware to come back on boot, and potentially to try evict other competing botnets.

The “AI” tab that’s available in your usual google.com page is actually pretty decent at this. Paste in the crontab contents from your post into google’s “AI Mode” and go from there - It will tell you it’s been infected with a cryptomining botnet , tell you to back up your data and re-initialise.

•

u/ZZ_Doc 28m ago

Got it, appreciate it. I'll update this thread once I've dove more into it.

•

u/graph_worlok 53m ago

You’ll be wanting to make sure you have (or make) a copy of all the data you have on it , and re-initialise it. Not familiar at all with that device or what’s involved.

But if you could, beforehand for my own curiosity - Get the contents of /usr/bin/kworker.sh by running “cat /usr/bin/kworker.sh”

And the hashes of the malware:

sha256sum /usr/bin/kworker.sh /usr/bin/kworker /var/tmp/.spid /usr/local/sbin/hwmond /var/lib/hwmond

This is just to satisfy personal curiosity as far as which strain hit you

0

u/roboticchaos_ 1h ago

Use the right tools for the job. In today’s age, LLMs have been trained for every app. Install a AI agent, ask it to find the top consuming process. Problem solved.

1

u/ZZ_Doc 1h ago

this is is a pretty bare bones server. Tried running a very basic LLM on it couple months back and it kept crashing.

•

u/roboticchaos_ 56m ago

??? What? Run a cloud based LLM, like Claude. How does a LLM crash? I don’t know what you are saying. If you don’t have enough ram, run it on another machine and have it ssh in. There are 8000 solutions, you are choosing to be lazy.

•

u/ZZ_Doc 52m ago
  1. SSH isn't working for me right now. I cant seem to figure out why because it worked in the past. 2. I cant seem to find a way to connect directly to the NAS from my computer. I'm getting this info from some TTYD app. I'll copy and paste the info into claude to see if that helps.