# Important Directories

## /etc

**One of the most important**

Short for etcetera

A commonplace location to store system files that are used by OS.

`sudoers` file contains a list of the users & groups that have permission to run sudo or a set of commands as the root user.

Also "passwd" and "shadow" files. These two files are special for Linux as they show how your system stores the passwords for each user in encrypted formatting called sha512.

<figure><img src="https://859957243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fde5Oj59jxsVsTZcMyIgC%2Fuploads%2FRh9AHjOLxOl0MKh6N79v%2Fimage.png?alt=media&#x26;token=ac866f9b-a0cd-4fa9-a186-fce2e7eb1c79" alt=""><figcaption></figcaption></figure>

## /var

Short for variable data

Stores data that is frequently accessed or written by services or applications running on the system.

E.g. log files from running services and applications are written here (/var/log), or other data that is not necessarily associated with a specific user (i.e., databases and the like).

<figure><img src="https://859957243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fde5Oj59jxsVsTZcMyIgC%2Fuploads%2FRLZQr3hZf5nIZX1tyrxY%2Fimage.png?alt=media&#x26;token=6d71277f-f427-4166-a5e3-1898338abc8e" alt=""><figcaption></figcaption></figure>

## /var/log

These files and folders contain logging information for applications and services running on your system.

<figure><img src="https://859957243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fde5Oj59jxsVsTZcMyIgC%2Fuploads%2FOIiRePNEQOxIYCcToMVR%2Fimage.png?alt=media&#x26;token=c3c3ea3a-b164-4800-b6de-46085a4bfb62" alt=""><figcaption></figcaption></figure>

Logs for services such as a web server contain information about every single request - allowing developers or administrators to diagnose performance issues or investigate an intruder's activity.

E.g. the two types of log files below that are of interest:

* access log
* error log

<figure><img src="https://859957243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fde5Oj59jxsVsTZcMyIgC%2Fuploads%2FaPpZWSrv4qjezAmdaNk8%2Fimage.png?alt=media&#x26;token=21825283-e917-439b-8ad4-5bc03c4287f2" alt=""><figcaption></figcaption></figure>

## /root

The /root folder is actually the home for the "root" system user.

There isn't anything more to this folder.

<figure><img src="https://859957243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fde5Oj59jxsVsTZcMyIgC%2Fuploads%2FeCM712Xhb2jIwgo5AloX%2Fimage.png?alt=media&#x26;token=fd009fc9-349a-4925-be6e-6afb3769dd6f" alt=""><figcaption></figcaption></figure>

## /tmp

Short for temporary.

the /tmp directory is volatile and is used to store data that is only needed to be accessed once or twice.

Similar to the memory on your computer, once the computer is restarted, the contents of this folder are cleared out.

What's useful for us in pentesting is that any user can write to this folder by default. Meaning once we have access to a machine, it serves as a good place to store things like our enumeration scripts.

<figure><img src="https://859957243-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fde5Oj59jxsVsTZcMyIgC%2Fuploads%2Fq95VyRolost9nxYNxb6P%2Fimage.png?alt=media&#x26;token=e27f8b34-48c6-415c-9e21-039d249c06d5" alt=""><figcaption></figcaption></figure>
