These are just a few of the automated tools used for discovering and finding potential security risks and misconfigurations on Linux endpoints. Be sure to try and discover your own weaknesses and risks on your endpoints by looking for the same privilege escalation methods.
Linux endpoints come with different types of users, groups, and access controls.
The majority of these automated tools and scripts are simply looking for the following Linux misconfigurations or weaknesses. Discover them first and lock them down with the right security controls.
Here are some of the common Linux misconfigurations attackers will try to take advantage of:
- Passwords stored in files and system configurations
- SSH keys
- Services running as root
- Scheduled cron jobs—used to elevate privileges or create persistence
- SUID (Set User ID)—can be abused to elevate privileges
- SUDO misconfigurations
- GTFOBins—shell-escape keys that can be exploited by attackers
- Wildcards
- Writable files and file permissions misconfigurations
- Kernel exploits
Attackers will exhaust all these methods in an effort to gain privilege escalation, and as defenders, we must discover them all and harden our Linux endpoints to protect and defend against these exploits and risks.
Tips to reduce your risk from these attacks:
PRIVILEGE HARDENING – Throw the Universal Keys Away, Move to On-demand Privileges
TIP #1: Use Application Control on all endpoints to control which applications can execute and which require additional auditing and visibility. While applications can be used for legitimate purposes, they are also used by attackers, so ensure authorized execution only. Application control can also help prevent the enumeration scripts from running, such as LinEnum or lse.
TIP #2: Patch and Update your Linux endpoints and applications regularly. Remove unused software and get rid of your legacy operating systems and applications. If you cannot get rid of legacy systems, then put a strong lock around them via network access, as well as privileged access controls to limit access to them.
REMEMBER: Patching systems will not make you 100% secure; it’s only reducing one high risk from being abused easily.
TIP #3: Use a Privileged Access Security solution to ensure that all service accounts have a provisioned, secure service account with the correct security controls in place. Use complex passwords that are rotated frequently, and never default passwords.
TIP #4: RESTRICT ROOT account usage and rotate passwords after every use.
TIP #5: Log and audit as much privileged activity as possible, and monitor for abuse.