Staying one step ahead of the intruders
Prevention
Internet intruders have many ingenious ways of escalating privileges and hiding their presence once they get inside your system. The best protection is to keep them out in the cold.
Just when you think you've mastered the art of intrusion protection, the cyber-criminals discover new some techniques for slipping through your security. Attackers use every possible advantage to stay hidden and gain control. Shouldn't you use every trick to keep them out?
This month's cover story focuses on techniques for keeping intruders off your system. In our lead-off article, "Who's There: Single Packet Port Knocking with fwknop," we study a powerful technique that lets you keep your firewall ports closed to all unauthorized users – but still open to traffic from friends. The next article, "Closing the Book: Fighting Dictionary Attacks with Sshutout and Fail2ban," discusses a pair of tools that will help you keep intruders from guessing your passwords.
Next, we show you how to apply more flexible and precise permissions to files and other objects using Access Control Lists (ACLs). We end with a workshop on the powerful security tool known as SELinux.
Getting In
Read on for more about locking down your Linux system – but first we take a quick look at exactly why this elaborate dance of security is even necessary. The rest of this introduction examines rootkits in the Linux environment.
What if someone broke into your Linux system and replaced the login program with a malignant variant. The new login finds out your username and password and sends the data it collects through a hole it has punched in your firewall to a server somewhere in the wild. No one suspects the new login, although the intruder suspects that an attentive system administrator might eventually wonder about the change in the file size.
But Internet criminals have a way of covering their tracks. Along with the manipulated login tool, the attacker smuggles in a modified ls program. This new version of ls masks any changes to the size or modification date for the login program.
The attacker also decides to replace several other system programs that work together to gather information and hide any evidence of the intrusion. Even anti-virus programs are powerless because the manipulated tools fool them, too.
This scenario is by no means fiction. Attackers often bring along a collection of tools that captures information, opens backdoors, and conceals their activities. This bundle of weapons is commonly known as a rootkit.
A rootkit typically comprises multiple components that fill various needs:
- A trojan drops the rootkit and anchors it on the system.
- A sniffer analyzes the network traffic and retrieves the access credentials.
- In some cases, keyloggers log keyboard input to capture passwords or PINs before the system can encrypt them.
- A backdoor gives the attacker access to the system.
All of these activities are camouflaged by replacing system files and, for current rootkits, redirecting API calls. Other components then put the computer to use – possibly for distributing spam or performing denial of service attacks.
Innovation
In the early days, rootkits simply replaced popular system tools such as ls, passwd, or ps. Security experts soon learned how to detect these early rootkits, and malware programmers soon learned to target the kernel itself.
If an attacker manages to inject malicious code into the kernel, the offending kernel code can capture and redirect any request.
Rootkits running in kernel space are particularly hard to discover. On Linux, kernel rootkits are often injected through a kernel module, which explains why they are known as LKM (for Loadable Kernel Module) rootkits.
Rootkit developers use various approaches to infest the kernel. One option is to manipulate the memory directory via /dev/kmem.
Firmware
Firmware rootkits provide an alternative attack vector. They infect the PC's firmware and survive a reboot. Some rootkits feel quite at home in the ACPI firmware routines. A clean rescue disk is little help against this kind of threat.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
There's a New Open Source Terminal App in Town
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.