Environment Enum

Basic commands

  • whoami - what user are we running as

  • id - what groups does our user belong to?

  • hostname - what is the server named. can we gather anything from the naming convention?

  • ifconfig or ip -a - what subnet did we land in, does the host have additional NICs in other subnets?

  • sudo -l - can our user run anything with sudo (as another user as root) without needing a password? This can sometimes be the easiest win and we can do something like sudo su and drop right into a root shell.

Tools

Tools

Operating System and Version

 cat /etc/os-release

NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Current user's PATH

Path Abuse

Environment variables

Look for password

Kernel version

Kernel Exploits

CPU type/version

Shell availables

Defense in place

Some things to look for include:

Drives and shares

Printers attached

Mounted drives

Routing tables

route or netstat -rn

Internal DNS

/etc/resolv.conf

ARP Table

Existing Users

Occasionally, we will see password hashes directly in the /etc/passwd file.

Hashes/etc/passwd & /etc/shadow

Outdated versions, such as Bash version 4.1, are vulnerable to a shellshock exploit.

Existing Groups

Members of interesting group

Home

Look for .bash_history, ssk keys, config files, etc.

Credentials Hunting

Mounted File Systems

Unmounted File Systems

All Hidden Files

All Hidden Directories

Temporary Files

Last updated