Linux PE Methodology
IF GET REVERSE SHELL, SEE IF CAN PUT PRIVATE KEY INTO THE USER ACCOUNT SO THAT CAN LOGIN IN USING SSH OR USE Upgrading Shells
Example at Getting a proper user shell
cat <PUBLICKEYFILE>
echo <CONTENT OF PUBLICKEYFILE> > authorized_keyUser Information
Get Current Username
Get User Context Information
Get all users
Get shadow file (Requires permission to read or write)
Privilege Group Privilege Escalation
System Information
Get hostname
Get OS Information
List System Process
Network Information
Get IP Configuration
Get Routing Table
Display active network connections and listening ports
Firewall rule location
For example,
Cron Job Information
List all scheduled task scripts
View scheduled task for current user
Inspect Cron log file for running cron jobs
If there is nothing for Cron Job, try using PSPY
Application Installed
List applications installed (Debian-based)
List applications installed (Red Hat-based)
Finding Files
Find writable files in the whole root directory
Find Files with specific extensions
Find writable file in the directory
Mounted Filesystem information
List all mounted filesystems
List all drives that will be mounted
View all available disks
Kernel Module information
View all loaded kernel modules
View more information about specific module
Unix-privesc-check binary location
Automated Tool Location
Environment Variable information
Get the environment details
Check .bashrc config file
Take snapshot
Take a single snapshot of the active process
Abusing passwd file permission
Sometimes if the /etc/passwd has write permission, can set an arbitrary password for any account
Abusing SUID
List of binaries that can abuse SUID
List all SUID-marked binaries
Abusing Capabilities
Search for all capabilities
Find cap_setuid+ep for the programs
Abuse sudo command
sudo commandList all commands that is able to run as root
List sudo version
Abuse doas command
Find the doas.conf
Running the command
Git
Under the .git/config file, it might contain some credentials which can used for privilege escalation.

PwnKit
PSPY
This does not need privileges to see Cron Job for root.
Last updated