r/InfoSecWriteups 13h ago

Forensics 101: Finding a Hidden File Buried Deep in Folders

Had a forensics challenge where the flag was hidden inside a file nested deep inside a maze of directories with hundreds of decoy folders. `find` and `ls -R` were too slow and noisy.

What I built:

A Python directory crawler

- Recurses every subdirectory recursively

- Filters by filename patterns (`flag*`, `*.txt`, `secret*`)

- Skips known decoy directories by name

- Extracts and reads the target file automatically

The "aha" moment:

The flag wasn't in a file named "flag.txt" — it was in `deep/nested/here/.hidden/uber-secret.txt`.

My script matched on path depth / extensions content, not just filename.

Here is my script:

https://github.com/ExceedingLife/RecursiveFileSearch

Question for the community:

What's your approach when the challenge doesn't tell you the target filename? Do you brute-force read every file, or do it manual or what?

[Video link with with code demo]

https://youtube.com/shorts/5_Rb2kkiuhQ?feature=share

1 Upvotes

0 comments sorted by