Recursively discover files and directories on web servers from exposed .DS_Store files, and read everything else those files give away.
pipx install git+https://github.com/vflame6/dsstore-tree.git
dsstore-tree -u https://target.example
The tool is one file. Where nothing can be installed, copy dsstore_tree.py and run it: reading a file with -f needs only the standard library, scanning needs requests.
python3 dsstore_tree.py -f ./found.DS_Store
python3 dsstore_tree.py -u https://target.example
| Finding | Where it comes from | How often (survey below) |
|---|---|---|
| Names of folders that were opened or expanded | every record | all files |
| Names of files | icon positions (Iloc); the tree browsed in list view in the check below left none |
39% of .DS_Store files name at least one file; 48% of the files lying next to a .DS_Store are named in it |
| Which names are directories | records Finder writes only for folders (bwsp, vSrn, lg1S, moDD, dscl, …) |
86% of directories identified before any request, 14 wrong in 31,514 |
Where the next .DS_Store is |
folders that were opened as a Finder window | 56% of them have their own .DS_Store (71% of those with subfolders, 39% of those holding only files); 2% of folders with only an icon position do |
| Local username and absolute path | put-back records (ptbL) of items that went through the Trash |
2.6% of files; 89% of those records contain /Users/<name>/ |
| Extra filenames | former names in put-back records (ptbN) |
190 extra names; 26% existed in the same directory, 87% had existed there |
| Size of each subdirectory | lg1S / logS, Finder's cached recursive byte count; 0 means not calculated and is ignored |
32% of files |
| When each subdirectory last changed | moDD / modD, both on-disk encodings |
33% of files |
| Which macOS wrote the file | record and plist-key markers | lower bound, 10.6 to 14 |
| Spotlight comments, background-image paths | cmmt, pict / pBBk |
rare: 10 and 1 files in 7,749 |
Names that are disclosed but not reachable (403, 404, WAF) are still reported, with the HTTP status. The name is the finding.
A .DS_Store is a map of folders first and a file list second. A tree browsed in list view yields every folder that was expanded and not one file name. Such a scan ends with directories that exist and whose contents nothing discloses; they are reported as directories_without_dsstore, ready for a wordlist:
dsstore-tree -u https://target.example -j | jq -r '.directories_without_dsstore[].url'
- One ranged
GETper name. A name with directory records gets its.DS_Storerequested first; any other name is probed first and its.DS_Storeis requested only if the probe was not a plain file. On a 557-file test site built from real.DS_Storefiles that was 1,258 requests instead of 1,653. - Servers that answer for names that do not exist. The first answer other than
404in a directory triggers one request for a name that cannot exist and has the same shape (same leading dot, same extension), because "refuse every dotfile" and "send every*.phpto the front controller" are rules about shapes. An answer the server also gives to that name iswildcard. A200is compared with the fallback page, byte for byte once the echoed name is swapped in, or by line count, word count and length when the page changes on every request. An SPA that returnsindex.htmlfor every path then yields no phantom files, and a real file of another length still costs one request. - Names are data. Every name is percent-encoded into exactly one path segment (
#,?,%,:included), and a/inside a record name is mapped to:, its on-disk spelling. The other Unicode normalisation form (NFC/NFD) is tried on a404. - Size check. With
lg1Sknown for a directory, the bytes found underneath are compared with it. Equal means that directory is mirrored completely; a shortfall is content nobody has listed yet.
A .DS_Store is attacker-controlled input. The scanner:
- sends requests only to the host you named (with or without
www.) and to hosts added with--scope; redirects are followed by hand and only inside that set, so cookies and tokens passed with-Hcannot be steered to another host; - prints names and values with control characters and bidi overrides escaped;
- writes downloads only inside
dsstore-tree_<host>/, with every component made safe for Windows, macOS and Linux; - bounds the size of a
.DS_Store(--max-ds-size, default 32 MB) and rejects cycles, absurd counts and out-of-range offsets in microseconds.
Truncated downloads, FTP ASCII-mode uploads and partially zeroed files are salvaged instead of dropped: records are carved from the raw bytes, the node addresses Finder mirrors into the file header replace a missing block table, and LF→CRLF translation is undone. Share of names recovered from 400 real files, per kind of damage:
| Damage | 1.2.0 | 1.3.0 |
|---|---|---|
| Truncated at 75% of length | 11% | 98% |
| Truncated at 50% | 1% | 63% |
| Last block missing | 14% | 100% |
| LF→CRLF (FTP ASCII upload) | 0% | 100% |
| 8 bytes zeroed per 4 KiB | 32% | 100% |
The ds-store library, which 1.2.0 fell back to and most .DS_Store tools build on, scores the same as 1.2.0.
-u, --url URL Base URL to scan
-f, --file PATH Parse a local .DS_Store instead (repeatable, no network)
-d, --download Download and mirror discovered files
-q, --quiet Suppress informational output
-j, --json Output results as JSON
-o, --output FILE Write JSON results to file
-A, --user-agent UA Override the default browser User-Agent
-H, --header K:V Custom header (repeatable)
--proxy URL HTTP/SOCKS proxy (e.g., http://127.0.0.1:8080)
--threads N Concurrent requests (default: 10)
--timeout SEC HTTP timeout in seconds (default: 10)
--delay SEC Delay between requests
--depth N Max recursion depth (0 = unlimited)
--records Print every decoded record value
--scope HOST Additional host requests may go to (repeatable)
--appledouble Also probe ._<name> (AppleDouble sidecar) for each name
--max-ds-size MB Give up on a .DS_Store larger than this (default: 32)
--verify-tls Verify TLS certificates (off by default)
--no-color Disable colored output
dsstore-tree -u https://target.example --proxy http://127.0.0.1:8080 # through Burp
dsstore-tree -u https://target.example -d -o report.json # mirror + report
dsstore-tree -u https://target.example -j | jq -r '.files[].url' # URLs for the next tool
dsstore-tree -u https://target.example -j | jq '.putbacks[] | {username, original_dir}'
dsstore-tree -f ./downloaded.DS_Store --records # offline
Output tags: [DIR], [FILE], [NAME] (disclosed, not reachable), [DIR?] (directory according to the records, HTTP inconclusive), [HIGH-VALUE] (opened in Finder, and the directory or the request for its .DS_Store was refused, redirected or left unanswered: retry via the origin), [PUT-BACK], [CANDIDATE] (name taken from a record value), [SALVAGED]. A plain 404 for a child .DS_Store is not a lead: 44% of the folders Finder opened have none.
JSON keys: directories, directories_without_dsstore, files, disclosed_but_unreached, high_value_targets, putbacks, fetch_candidates, dates, coverage, comments, value_paths, plist_strings, salvaged, finder_era, rejected_names, summary. An entry's kind is dir, dir_nods, file, blocked, absent, wildcard or unknown.
7,752 Finder-written .DS_Store files (202,122 records) taken from the public git history of 1,630 repositories, first committed between 2003 and 2026. Git supplies the ground truth: the directory listing at the same commit says which names exist and which are directories, and the history says which names ever existed.
- The parser returns the same records as the
ds-storelibrary on all 7,749 intact files; the other 3 were already damaged in the repository and are salvaged. - 92.6% of names exist in the directory at that commit, 1.8% existed at another time, 5.6% were never committed (
.git,node_modules,.env, editor temp files). - Deleted names are not recoverable from free space: of 2,706 names that left a file between two commits, 7 were still present in slack. What sits there is stale copies of live records.
- Of 4,932
.DS_Storepaths (latest version of each), 61% name no file at all. Where the folder holds files, 47% name none of them, and 98% of the file names that do appear carry an icon position. - 11% of the directory sizes are
0; of 131 such directories checked against their git tree, 130 held files.
A second check uses a tree browsed by hand in Finder's list view on a Mac (12 .DS_Store files, 33 directories, 34 files; the records carry the macOS 14 marker): all 32 named folders are recognised as directories from the records alone, no file is named, and the 11 child .DS_Store files belong to the 10 folders that have subfolders and to one emptied folder.
pip install -e ".[dev]"
pytest
Tests need no network beyond 127.0.0.1. tests/test_dsstore_tree.py starts with a builder that writes .DS_Store files byte by byte, including shapes Finder does not produce on demand (two-level trees, cycles); tests/fixtures/ holds three binary samples with a comment, a bookmark and an alias.
.DS_Store (Desktop Services Store) is a hidden file the macOS Finder writes into folders it displays, to remember icon positions and view options. Uploaded to a web server by accident, it names the subfolders that were opened there, and the files too when the folder was arranged as icons, whether or not directory listing is enabled. Keep it out of deployments (.gitignore, rsync --exclude) and deny /.DS_Store at the web server.
Use this tool only against systems you are authorised to test.
MIT
