The Mindset
The Linux filesystem is enormous. Manually browsing through directories looking for something interesting is a waste of time. Instead, you use tools that let you search with surgical precision — by name, by type, by owner, by size, by date, by permission.
This skill is critical in two scenarios:
- Post-exploitation enumeration — finding credentials, configs, and sensitive data after landing on a box
- Privilege escalation — finding SUID binaries, writable scripts, and misconfigured files
Know Where to Look First
Before running any search, know the Linux filesystem layout. These directories are your hunting grounds:
Before running anything, check what’s installed. Knowing whether Python, netcat, wget, or curl are available changes your options.
If a program isn’t found, which returns nothing. No output = not on the PATH.
find is the most powerful file search tool on Linux. It searches in real-time and supports a huge range of filters. Slower than locate, but always accurate and extremely flexible.
Syntax
Core Options
Practical Examples
Find all config files owned by root, larger than 20KB, modified after 2020:
Find all SUID binaries — check each one against GTFOBins:
Find world-writable files (potential hijack targets):
Find all files owned by a specific user:
Hunt for credential files by name:
Find recently modified files (last 10 minutes — useful after running an exploit):
Always append 2>/dev/null to find commands. Without it, the terminal floods with “Permission denied” errors that bury your real results.
locate uses a pre-built database to search instantly across the entire filesystem. Much faster than find, but the database may be outdated — it won’t show files created since the last updatedb run.
When to use locate vs find:
tree — Visualize Directory Structure
When you need to understand how a directory is organized at a glance:
High-Value Targets Cheatsheet
These are the files and locations that most often yield credentials, keys, or privesc paths:
.bash_history is underrated. Users frequently type passwords directly into
commands. Always check history files for every user you can access.
Next: Output Filtering & Text Processing — parsing command output to extract exactly what you need.