Enumeration

Basic enumeration commands (Linux)

  1. hostname

  2. uname -a

  3. Files to view with the cat command

a) /proc/version

b) /etc/issue

c) /etc/passwd and /etc/shadow

  • Readable /etc/shadow file

  • Writable /etc/passwd and /etc/shadow

# rx /etc/passwd
$ ls -l /etc/passwd
-rw-r--r-x 1 root shadow xxxx xxx xx xxxx /etc/passwd

# rx /etc/shadow
$ ls -l /etc/shadow
-rw-r--r-x 1 root shadow xxxx xxx xx xxxx /etc/shadow
  1. env

  2. id

Suppose a user is in the adm group. This user will be able to read the log files present in the /var/log or other related folder:

Practical example: https://jarrettgxz-sec.gitbook.io/penetration-testing-ethical-hacking/write-ups/tryhackme/silver-platter

  1. history

  2. sudo -l

The target system may be configured to allow users to run some (or all) commands with root privileges. The sudo -l command can be used to list all commands your user can run using sudo

  1. find

a) Files with SUID bit:

b) Files with SGID bit:

c) Files with certain permission

  • 0777: readable, writable and executable by all users

  • 003: writable and executable by others. Ignoring permissions for owner and group

  • /001: atleast executable permissions for others

Find world-writable folders

Find world-executable folders

Files to look out for

  1. Writable /etc/systemd/system , /lib/systemd/services, /usr/lib/systemd/system, /run/systemd/system (systemd services) and other similar directories

Automated tools

Last updated