Checklist


Key Commands and Their Purpose:

  1. whoami: Displays the current user.

  2. id: Shows user ID, group IDs, and group memberships.

  3. hostname: Reveals the server’s name, which may indicate its role.

  4. ifconfig / ip a: Lists network interfaces and subnets for potential lateral movement.

  5. sudo -l: Checks if the user can run commands as root without a password.

  6. cat /etc/os-release: Identifies the OS distribution and version.

  7. uname -a: Shows the Kernel version to check for known exploits.

  8. echo $PATH: Displays the PATH variable, which could be misconfigured for privilege escalation.

  9. env: Lists environment variables, potentially revealing sensitive data like passwords.

  10. cat /etc/passwd: Lists all users, their UIDs, GIDs, and shells.

  11. cat /etc/group: Shows groups and their members to identify high-privilege groups.

  12. cat /etc/shells: Lists available shells, which may have vulnerabilities.

  13. lsblk: Enumerates block devices (e.g., unmounted drives that may contain sensitive data).

  14. df -h: Displays mounted filesystems and their usage.

  15. cat /etc/fstab: Checks for credentials or misconfigured mounts.

  16. route / netstat -rn: Shows the routing table for network connections.

  17. arp -a: Lists devices the server communicates with.

  18. find / -type f -name ".*": Finds hidden files that may contain sensitive data.

  19. find / -type d -name ".*": Finds hidden directories.

  20. ls -l /tmp /var/tmp /dev/shm: Checks temporary directories for exploitable files.

Key Areas to Investigate:

  • OS and Kernel: Look for outdated versions with known exploits (e.g., check Exploit-DB).

  • Running Services: Identify services running as root (e.g., Nagios, Samba) for misconfigurations or vulnerabilities.

  • Users and Groups: Check for users in high-privilege groups like sudo or adm.

  • File Permissions: Look for writable files/directories owned by root or misconfigured PATH.

  • Sensitive Files: Search for config files (.conf, .config), SSH keys, or .bash_history containing credentials.

  • Defenses: Identify protections like AppArmor, SELinux, or iptables that may block exploits.

  • Network: Map subnets and connected devices for lateral movement.

Last updated