This week we take a look into BPFDoor, a newsworthy backdoor piece of malware which has been targeting Linux machines, plus we cover security updates for Bind, Vim, Firefox, PostgreSQL and more.
32 unique CVEs addressed
https://doublepulsar.com/bpfdoor-an-active-chinese-global-surveillance-tool-54b078f1a896
https://www.sandflysecurity.com/blog/bpfdoor-an-evasive-linux-backdoor-technical-analysis/
Malware that has been in the wild for a while (over 5 years)
Reported on by PwC in their Cyber Threats 2021: A year in Retrospect report
Stealthy - allows to backdoor a system for RCE but without opening any new network ports or firewall rules by piggy-backing on existing network facing applications
Uses BPF filter to watching incoming packets and activate accordingly
Earlier versions are on VT - with lots of other variants too
Even source code too - https://pastebin.com/kmmJuuQP
As I said - stealthy
In more detail:
/dev/shm/kdmtmpflush
and then forks to clean itself up
to alter timestamps (timestomp) to a specific timestamp (7:17pm
Thursday October 30th 2008)/bar/run/haldrund.pid
to prevent further copies of
itself from running/dev/shm/
ramdisk and then exits to leave the
forked copy running resident in memory and then use BPF filter to watch
for incoming traffic to activateDoesn’t appear to have any particular persistence mechanism but some
reports suggest use of crontab
or rc/init
scripts
By deleting itself from the ramdisk this avoids detection from filesystem
scanners (although processes running from since deleted binaries are a
suspicious sign themselves and can be easily detected since once the
binary is removed the kernel notes this in /proc/self/exe
for the
process)
Renames its argv[0]
so that it looks like other commonly found processes
like dbus-daemon
/ udevd
/ auditd
etc
Also wipes its environ
too to try and help hide it’s activities, however
this again is another suspicious activity and can easily be detected
(e.g. strings
on /proc/$PID/environ
will show as empty which is basically
never normally the case for normal processes)
BPF filter inspects either ICMP, TCP or UDP packets and then if it has a special magic value in the first couple bytes it passes into the main packet processing routine
bindshell masquerades its process name to look like postfix as well as
setting a specific environment too (including HISTFILE=/dev/null
)
Then attacker has full access to the machine (as the user)
Reasonably advanced malware
What is not clear is what is the initial compromise vector and then how to privesc from that to give privileges to load BPF filter on a raw socket
xscreensaver
but this vuln is specific to Solaris platformsWhy it is important to keep systems updated with latest patches etc.