Seems like their malware relies on a couple of things: - intended target is KDE and GNOME - privilege escalation through LD_PRELOAD hooking from userland via open, stat, readdir access (of any other program that the user executes, see down below) - persistence through display manager config for KDE - persistence through desktop autostart files for GNOME - fallback persistence through .bashrc, profile or profile.sh in…
Challenge accepted. "All files loaded" is probably not what you want to do however. It is much easier to just ask rpm directly which files under your library directory has been modified, and treat any files outside known library directories as suspicious. Anyway, this is how you check which open files match ".so" and see if they are modified since installation: lsof | grep -o "/[^ ]*\.so[^ ]*" | while read path ; do…
Security researchers identify new malware targeting Linux
51–60 of 70 posts
Re: Security researchers identify new malware targeting Linux
#52Earlier quoted context omitted.
Challenge accepted. "All files loaded" is probably not what you want to do however. It is much easier to just ask rpm directly which files under your library directory has been modified, and treat any files outside known library directories as suspicious. Anyway, this is how you check which open files match ".so" and see if they are modified since installation: lsof | grep -o "/[^ ]*\.so[^ ]*" | while read path ; do…
Didn't check the code, but lsof seems a good approach. How does that work with the various namespaces? From root namespace you should see everything. But in a mount namespace you could bind mount under a different name. How would that confuse things? With a SELinux module even root cannot do everything. If /proc is mounted privately does it change anything? Not sure, just starting to think. Linux has become incredibl…
Re: Security researchers identify new malware targeting Linux
#53Earlier quoted context omitted.
Challenge accepted. "All files loaded" is probably not what you want to do however. It is much easier to just ask rpm directly which files under your library directory has been modified, and treat any files outside known library directories as suspicious. Anyway, this is how you check which open files match ".so" and see if they are modified since installation: lsof | grep -o "/[^ ]*\.so[^ ]*" | while read path ; do…
Here's a .deb version; only running debsums once per package name. Errors will go to stderr: sudo lsof | grep -o '/[^ ]*\.so[^ ]*' | awk '!seen[$0]++' | while read -r path; do if p=$(dpkg -S "$path");then cut -f1 -d: (But is there a hard rule that says a loaded library has to be named .so, or show up as .so for lsof? I'm sure there's ways to avoid the above detection.)
No, yes(-ish)
Filenames are just a convention and not necessarily enforced.
lsof will really list every file the kernel thinks has a handle held by an active process, but depending on your threat model I think you could get around this. For example you could copy the malicious code into memory and close the file, or use your preload to modify the behaviour of lsof itself (or debsums).
Anyway debsums is a great tool. I'd have used a command similar to yours, though maybe run debsums first, use `file` to filter dynamic libraries and then check which of those have been recently accessed from disk.
Re: Security researchers identify new malware targeting Linux
#54Earlier quoted context omitted.
>intended target is KDE and GNOME Apologies for the dumb question, but does this mean my PiHole running on a small Debian server that has no KDE or Gnome installed, is safe from this?
Yes, if it's not running Tomcat. (Personal opinion: You should never run Tomcat, history of really unsecure development practices)
Re: Security researchers identify new malware targeting Linux
#55The use of LD_PRELOAD as part of the attack surface makes me think that a statically-linked binary has some value. Not a maximalist approach like some experimental distros, but I think there's clearly some value in your standard userland utilities always performing "as you expect," which LD_PRELOAD subverts. Plenty of Linux installs around the world get on fine using BusyBox as the main (only?) userland utility packa…
They load a kernel driver so your avoidance of LD_PRELOAD wouldn’t really be able to protect against this anyway.
Re: Security researchers identify new malware targeting Linux
#56Re: Security researchers identify new malware targeting Linux
#57What AV (if any?) would people recommend for linux? I feel that clamav is more for incoming files than something which would or could catch this?
Re: Security researchers identify new malware targeting Linux
#58Earlier quoted context omitted.
Challenge accepted. "All files loaded" is probably not what you want to do however. It is much easier to just ask rpm directly which files under your library directory has been modified, and treat any files outside known library directories as suspicious. Anyway, this is how you check which open files match ".so" and see if they are modified since installation: lsof | grep -o "/[^ ]*\.so[^ ]*" | while read path ; do…
Here's a .deb version; only running debsums once per package name. Errors will go to stderr: sudo lsof | grep -o '/[^ ]*\.so[^ ]*' | awk '!seen[$0]++' | while read -r path; do if p=$(dpkg -S "$path");then cut -f1 -d: (But is there a hard rule that says a loaded library has to be named .so, or show up as .so for lsof? I'm sure there's ways to avoid the above detection.)
Other than that it seems to work - i.e. no alarming output. :-)
Re: Security researchers identify new malware targeting Linux
#59Earlier quoted context omitted.
Please learn the difference of persistence and privilege escalation versus "hiding a binary". They are certainly not trying to hide, and it has nothing to do with the initial exploit surface. You are mixing up things because you seem to be not aware how multi stage exploits work. The article also mentioned that tomcat was targeted, but it didn't mention whether it was a zero day or a known vulnerability (like log4j v…
So when you say "intended target is KDE and Gnome" you mean target for persistence on the system? Sorry but not all of us have formal education in this field, I'm just trying to understand if you're saying that KDE and Gnome systems are vulnerable, or Tomcat web servers.
> Although we lack concrete evidence regarding the initial access vector, the presence of multiple webshells (as shown in Table 1 and described in the Webshells section) and the tactics, techniques, and procedures (TTPs) used by the Gelsemium APT group in recent years, we conclude with medium confidence that the attackers exploited an unknown web application vulnerability to gain server access.
Re: Security researchers identify new malware targeting Linux
#60Earlier quoted context omitted.
Yes, if it's not running Tomcat. (Personal opinion: You should never run Tomcat, history of really unsecure development practices)
To my knowledge PiHole uses Ngingx, so that seems ok. Thank you for your response.