New Linux userland rootkit with anti-debugging, new backdoors and pcap hiding
blackhatlibrary.net
blackhatlibrary.net
A rootkit is not a virus nor a way to obtain privileges on a Linux box, but a set of tools providing various features to keep hidden a root access to the hacked box.
This rootkit provides various backdoors allowing to get root ssh access and advanced anti-detection features, but as far as I know, this package won't hurt you badly as far as you don't manipulate it with a privileged user.
> This rootkit provides various backdoors allowing to get root ssh access
followed by:
> this package won't hurt you badly
Allowing root ssh is the ultimate death of your machine's security. Having this installed hurts you badly.
Taking stuff out of context is fun!
He said it won't hurt you badly as long as you don't run it as root. From that, I understand that it can't install itself unless it's run as a privileged user.
So what he's saying is that there's no privilege escalation exploit packaged with this rootkit. Gotcha.
Still I wouldn't mention "this package won't hurt you" along with such a tool. Many userland exploits exist.
I said that "it won't hurt you" as a reaction to people saying "I won't even click on that link" in some comments.
Okay, that's interesting - how would you remove this hook?
As someone else points out, all statically linked binaries are immune to this technique since they don't load preloads.
Another warning is don't muck around with /etc/ld.so.preload unless you know what you're doing. It's possible to get in a state that everything you executes segfaults.
$ ldd /usr/bin/busybox not a dynamic executable
$ ls -l /usr/bin/busybox -rwxr-xr-x 1 root root 1795976 Jan 20 14:21 /usr/bin/busybox*
$ file /usr/bin/busybox /usr/bin/busybox: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=76e26ac5c916fc1e715c9a49c10db3405b26a22c, stripped
$ busybox BusyBox v1.22.1 (2014-01-20 17:20:52 MSK) multi-call binary. BusyBox is copyrighted by many authors between 1998-2012. Licensed under GPLv2. See source distribution for detailed copyright notices.
Usage: busybox [function [arguments]...] or: busybox --list[-full] or: busybox --install [-s] [DIR] or: function [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use and BusyBox
will act like whatever it was invoked as.
Currently defined functions:
[, [[, addgroup, adduser, adjtimex, ar, arp, arping, ash, awk, base64,
basename, beep, blkid, blockdev, bootchartd, brctl, bunzip2, bzcat,
bzip2, cal, cat, catv, chat, chattr, chgrp, chmod, chown, chpasswd,
chpst, chroot, chrt, chvt, cksum, clear, cmp, comm, cp, cpio, crond,
(...)
uudecode, uuencode, vconfig, vi, vlock, volname, wall, watch, watchdog,
wc, wget, which, who, whoami, whois, xargs, xz, xzcat, yes, zcat, zcipAs these rootkits are designed by rather smart people to overcome all existing tools, there simply cannot be generic tools that catch them all. If you get hit by a bunch of script kiddies using outdated tools, things like rkhunter and chkrootkit can help. Modern rootkits are almost by definition undetectable by them. If it's actually new, the way you find out about it is typically either a separate NID box between the machine and the wall that alerts, or the behaviour of the box changing.
End user here: I just have a Linux laptop, interested in servers on the 'wild' web
You could also use asm to directly invoke sys_ptrace, since this rootkit doesn't have any kernel components.
Why even have an install step for this? Actually, why does it exist?
...and we broke it.
This is, for all intended purposes, a static page. When will people learn to put a caching nginx in the front... that's all it takes, really.
As a matter of fact, is it possible to get stuff like nsswitch working without dynamic linking on Linux?
I know kernel tracing is cheating for this kind of backdoor, but it can be easy ;-)
Scary.
There probably are plenty of holes, but they might be only found by big-money efforts aimed at compromising particular computers, meaning essentially government spying.
The major difference between your common Windows user and Linux user is that Windows users are often logged in as Administrator. So if arbitrary-code-execution happens that code owns the whole system - checkmate.
The typical Linux user is not running their Windows Manager or browser as root. The worse that can happen is stuff to your home dir(which can be very bad too). Even this article title calling this a "userland rootkit" is kinda odd, since "/etc/ld.so.preload"(and the whole /etc dir) is a root-only writable. No matter how secure your OS is, if you're tricked into running an evil program as root/admin... it's game over.
The usage-pattern for this happening on Windows is much, much higher than Linux since Windows users are already admin to start off with. Also, from my observation of Windows users over my 10+ year career, they always click "Ok" on every pop-up dialog box without even reading it. I think that UAC thing from Windows Vista enforced that behavior even more.
As for the Azazel rootkit, it uses LD_PRELOAD. According to the ld.so manpage[1] it is ignored for setuid/setgid executables. This looks like the behaviour is not exactly that of the Linux ld.so so perhaps this limits the rootkit's impact.
[1] http://www.openbsd.org/cgi-bin/man.cgi?query=ld.so§ion=1
http://www.openbsd.org/cgi-bin/man.cgi?query=lkm
LD_PRELOAD and friends are also ignored on linux for setuid/setgid binaries, otherwise privilege escalation would be trivial, just start any dynamicly linked setuid binary with LD_PRELOAD and go to town.
edit: Just created this account to answer this question. Otherwise I'm only on HN to lurk.