NOTICE: If you are running the Web Terminal plugin disable it ASAP.
The Web Terminal can be exploited to gain root. I currently have 2 Hestia servers and both were hacked via the Web Termainal. I’m still investigating the incident, but this is what I know so far:
# journalctl -u hestia-web-terminal.service
May 22 01:18:18 web2 server.js[3506304]: New connection from 45.86.230.242 (0tk5i6u95ua5inti4o2h9lv2si)
May 22 01:18:18 web2 server.js[3506304]: New pty (680948): /bin/bash as root (0:0) in /root
May 22 01:18:22 web2 server.js[3506304]: Ended connection from 45.86.230.242 (0tk5i6u95ua5inti4o2h9lv2si)
May 22 01:18:22 web2 server.js[3506304]: Ended pty (680948)
This has also affected us and we found some things you might want to check for on your server. We didn’t find any new keys added to /root/.ssh/authorized_keys but we found something that had been deposited into our system, so you might want to check:
For us, the unauthorised web terminal access was three attempts, all on 21st May, hence why I am looking for libraries from this date on, some legitimate ones may also have been added since then but in our case the only one was the malicious one. These are the objects we found had been added:
a dropper/loader: /usr/lib/__hesti/__hesti
a library: /lib/x86_64-linux-gnu/libnss_cache.so.2
and a preload reference: /etc/ld.so.preload
What this malware appears to be doing:
using LD_PRELOAD via /etc/ld.so.preload
to inject libnss_cache.so.2 into essentially every dynamically linked process on the system.
This was causing some weird DNS activity, which manifested itself as a slowdown of the panel, and upon investigation we saw hundreds of DNS requests for a domain which was something like p1.678456.xyz. Each lookup was failing and causing timeouts, freezes, etc. Havoc basically!
I can’t explain it fully (deleting the dropper and payload was tricky) as I had to use ChatGPT to help - it’s all a bit beyond my light understanding on web server administration, but at least you might want to check if you have been affected by this particular malware, or at least share details of the version of events that has affected you.
Needless to say, the web terminal is now well and truly DISABLED!
Thanks for the tip. I checked your recommendations on one of the servers where similar activity was observed, but I didn’t find these files. Authorized_keys were also unaffected.
Apparently, using lshell saved the day.
By having the Web Terminal plugin enabled on a server, can the server be exploited straight away or does it require a user with access to Web Terminal on its package?
Just want to double confirm on this issue, understand this has been fixed in 1.9.5
But i want to check whether my server being exploited.
Is it NO account at all is needed for anonymous user who just knowing the server IP or domain to get hack into web terminal? or at least need the HestiaCP account?