Linux
Enumeration
./LinEnum.sh -e <OUTPUT_FILE>
Security auditing tool for Linux, macOS and UNIX-based systems. Test security defenses.
./lynis audit system
Functionality
GTFOBins shows how to exploit SUID, Capabilities, and SUDO vulnerabilities on known programs.
SUDO
The sudo utility (Superuser-Do) can be used to run a command with elevated privileges. Must be a member of the sudo group.
See NOPASSWD entries.
Also remember abuse of relative paths and Wildcard.
SUID Program
Programs with the SUID flag will run with owner privileges. Analyze these programs.
SGID Program
Programs with the SGID flag run binaries as if we were part of the group that created them. Analyze these programs.
Capabilities
Capabilities are additional attributes that can be applied to processes, binaries, and services to assign specific privileges (ex., administrative). Analyze the presence of misconfigurations.
Groups
If the user is part of some privileged groups then he can perform privileged and particularly harmful actions.
Programms
See versions of various executable programs to check for Privilege Escalation exploits. See CVE section.
Process
Cron Jobs
Look through the Cron Jobs if they are called editable files to be exploited.
Also remember abuse via Wildcard.
Command-line tool designed to snoop around linux processes without needing root permissions. It allows you to see commands executed by other users, cron jobs, etc. while they are running.
File
Documents
Search for sensitive information in different files, such as system password files, files in the home profile, text files saved on Desktop/Documents, temporary files, etc.
Note: In /etc/passwd and /etc/shadow you can remove the x or insert instead the output of: openssl passwd <PASS>. Or you can add <USER> ALL=(ALL:ALL) ALL | <USER> ALL=(ALL) NOPASSWD: ALL in /etc/sudoers.
SSH keys
Look for ssh keys which may also be located elsewhere in the file system.
Config
Search for sensitive information in configuration files.
Backup
Check if there are any backup files that may contain sensitive information.
Script
Also check the bash scripts.
Writable Files and Directories
Check if there are any interesting writable files and folders.
Hidden Files and Directories
Check if there are any interesting hidden files and folders with sensitive information.
Password
It searches for passwords.
laZagne.py all
A tool to download the current Linux user's login password.
Browser
Extract sensitive data, including passwords, from browsers.
./hack-browser-data[.exe] (check the results directory)
Various
History
Search the command history.
Variables
Check environment variables for sensitive information such as passwords or misconfiguration.
Library
For ELFs see if you can manipulate the LD_PRELOAD variable or the RUNPATH setting of the binaries. In Python see if you can manipulate the PYTHONPATH variable or if there are writable directories in the module import.
Passive Traffic
Capture sensitive information from live network traffic, with tcpdump
Restricted Shells
Certain users may be assigned shells with limited functionality, such as rbash, rksh, rzsh
Check executable commands and look for them in GTFOBins
Also try
Command injection with
`Command Chaining with
;&|Variable changes (
export -p)Shell functions
Kernel
Exploit Kernel Level. Depends on Kernel Version and Operating System. Better to compile the exploit on the target if it has gcc. May cause crashes!
It allows you to detect kernel-level security weaknesses.
See Linux-CVE section.
Last updated
Was this helpful?
