> For the complete documentation index, see [llms.txt](https://iptracej.gitbook.io/windows-linux-and-active-directory-ctf-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://iptracej.gitbook.io/windows-linux-and-active-directory-ctf-notes/database-attacks/mssql/directory-enumeration.md).

# Directory Enumeration

Use dirtree function in SQL to enumerate directory and file names.

### Common Commands

```bash
# Enumerate a directory under C:\
SQL> master.sys.xp_dirtree 'C:\',1,1
SQL> master.sys.xp_dirtree 'c:\inetpub\wwwroot',1,1;
```
