Ferret-rs
Yeah, it's another file finder. But this one doesn't suck.
Written in Rust because we're not savages who enjoy waiting for Python to boot up. The binary is called fr because typing is overrated and your time is valuable.
Why This Exists
Look, we've all been there. You're trying to find that one config file from 2019, and you're staring at a find command that looks like someone had a seizure on their keyboard. Or you're using fd but still typing out long flag names like it's 1995.
Ferret does three things well:
- Finds your files fast (like, really fast)
- Organizes your disaster of a Downloads folder
- Tells you what's eating all your disk space
No PhD required. Just fr find "*.whatever" and get on with your life.
What It Does
File Search - Glob patterns, regex, filters for size/date/type. You know, the stuff that should be easy but never is.
Smart Organization - Automatically sorts your files by type, date, or size. Your future self will thank you.
Directory Stats - Shows you what's actually in that folder. With pretty charts because humans like pretty things.
Pentesting & Security Tools - SUID/SGID finder, writable file scanner, capabilities checker, config hunter, and more. Built for pentesters, red teamers, and blue teamers.
Combined Flags - Because if netcat can do nc -nlvp, you should be able to do fr find "*.log" -ivH. Flag combining works like you'd expect it to.
Output Options - Default view, detailed with timestamps and sizes, or JSON if you're into that sort of thing.
Getting Started
Installation
Pick your poison:
Via Cargo (Recommended - Works Everywhere)
🚀 One-Command Install with Auto PATH Setup:
|
The installer will ask if you want cargo install (with auto PATH setup) or system-wide install.
Or manual cargo install:
# 1. Install
# 2. Add to PATH
Arch Linux (AUR)
# or
macOS (Homebrew)
# Add the tap (first time only)
# Install
From Source (The Hard Way)
# Clone it
# Build it (grab a coffee, Rust is compiling)
# Install it
What you need:
- Rust 1.70 or newer (for cargo install or building from source)
- A Linux/Unix box (Arch, Ubuntu, Kali, Debian, Fedora - whatever floats your boat)
- Basic understanding that
sudomeans business
Troubleshooting
"fr: command not found" after cargo install
This means ~/.cargo/bin isn't in your PATH. Here's the fix:
Quick Fix:
# Run the automated installer (it handles PATH setup)
|
Or manually:
# Check if the binary exists
# If it's there, add to PATH
Verify it worked:
Upgrading
Already have Ferret installed? Here's how to upgrade to the latest version:
🚀 One-Command Upgrade (Recommended)
|
Automatically detects if you have cargo/brew and upgrades to the latest version
Via Cargo
Arch Linux (AUR)
# or
macOS (Homebrew)
From Source
Uninstalling
Need to remove Ferret from your system? Here's how:
Via Cargo
Arch Linux (AUR)
# or
# or using pacman directly
macOS (Homebrew)
# or
From Source (Manual Installation)
# Remove the binary
# Optional: Clean up the source directory
Clean Cargo Cache (Optional)
If you want to completely remove all traces including cached builds:
# Remove cargo cache for ferret-rs
# Remove build artifacts from source directory
Usage Guide & Quick Reference
Find Command Basics
The bread and butter. Finding files without wanting to throw your keyboard.
# Find Rust files
# Case-insensitive (because who remembers capitalization?)
# Regex for the brave
# Combine flags like a pro
Size Filters
# Files over 100MB (find the chunky boys)
# Small files under 1KB
# Specific range
Time Filters
# Modified in last week
# Recent logs
# Old backups
Type Filters
# Only files (not directories)
# Only directories
# Symlinks
Quick Command Reference
| Command | What It Does |
|---|---|
fr find PATTERN |
Find files matching pattern |
fr organize PATH |
Clean up the mess |
fr stats PATH |
See what's taking up space |
fr dupes PATH |
Find duplicate files (waste detector) |
fr grep PATTERN |
Search inside files (fast grep) |
fr config |
Manage your config file |
fr ls PATH |
List directory contents (like ls) |
fr suid |
Find SUID binaries (pentesting) |
fr sgid |
Find SGID binaries (pentesting) |
fr writable |
Find writable files/dirs (pentesting) |
fr caps |
Find files with capabilities (pentesting) |
fr configs |
Hunt for credentials/configs (pentesting) |
fr recent |
Find recently modified files (pentesting) |
fr dn CMD |
Run command (optional output control) |
Common Find Patterns
# The essentials
# With output options
# Power moves
|
All Find Flags
| Flag | What |
|---|---|
-p PATH |
Where to search |
-i |
Ignore case |
-r |
Use regex |
-t TYPE |
file/dir/symlink |
--min-size SIZE |
Min size (K/M/G) |
--max-size SIZE |
Max size |
-m DAYS |
Modified within N days |
-d DEPTH |
Max depth |
-H |
Include hidden |
-o FORMAT |
Output: default/detailed/json |
-x CMD |
Execute command |
-v |
Verbose mode |
-q |
Quiet mode |
-l |
Follow symlinks |
Organize Command
Stop living in chaos. Let the computer do the sorting.
# Organize current directory by type
# Organize Downloads (we know it's a disaster)
# Preview first (dry-run)
# Copy instead of moving (safety first)
# Custom output location
# Go deep (recursive)
# Combine flags (netcat-style)
Organization Methods
# By file type (default)
# Creates: documents/, images/, videos/, code/, etc.
# By date
# Creates: 2026/01-January/, 2025/12-December/, etc.
# By size
# Creates: tiny/, small/, medium/, large/, huge/
Organize Flags
| Flag | What |
|---|---|
-m METHOD |
type/date/size |
-o PATH |
Output directory |
-n |
Dry run (preview) |
-c |
Copy (don't move) |
-r |
Recursive |
-H |
Include hidden |
-v |
Verbose |
Duplicate Finder Command
Find duplicate files because your Downloads folder is a disaster zone.
# Find duplicates in current directory
# Search specific path
# Recursive search (go deep)
# Check big files only (skip the tiny ones)
# Ignore really large files (skip videos)
# Combine flags like a pro
How It Works
- First filters by file size (fast)
- Then uses SHA256 hashing (accurate)
- Parallel processing (stupid fast)
- Shows you where your duplicates are hiding
Dupes Flags
| Flag | What |
|---|---|
-r |
Recursive search |
--min-size SIZE |
Minimum file size (K/M/G) |
--max-size SIZE |
Maximum file size |
-H |
Include hidden files |
-v |
Verbose output |
Grep Command
Search inside files like you mean it. Fast. Parallel. Powerful.
# Search for pattern in current dir
# Search specific path
# Recursive search (the usual)
# Case insensitive
# Use regex (for the fancy folks)
# Only show filenames
# Show line numbers
# Limit depth
# All the flags at once
Grep Flags
| Flag | What |
|---|---|
-r |
Recursive search |
-i |
Ignore case |
-R |
Enable regex |
-l |
Files only (no content) |
-n |
Show line numbers |
-d DEPTH |
Max depth |
-H |
Include hidden files |
-v |
Verbose mode |
Config Command
Customize file organization. Tell Ferret how YOU want things organized.
# Initialize config file
# Show current config
# Get config path
Config File Location
- Linux/Mac:
~/.config/ferret/config.toml - Windows:
%APPDATA%\ferret\config.toml
Example Config
[]
[]
= [".rs", ".py", ".js", ".go"]
= [".pdf", ".docx", ".txt"]
= [".mp3", ".flac", ".wav"]
[]
= 1000 # Max file size for dupes
= 8 # Parallel processing threads
Config Features
- Custom file type categories
- Performance tuning
- Organization preferences
- Persistent settings
Stats Command
Figure out where all your disk space went.
# Current directory stats
# Recursive analysis (the whole tree)
# Specific directory
# Include hidden files
# Verbose output
What You Get:
- Total files and directories
- Size distribution (with ASCII charts)
- Top file types by count and size
- Largest files
- Everything color-coded because terminal UX matters
Stats Flags
| Flag | What |
|---|---|
-r |
Recursive |
-H |
Include hidden |
-v |
Verbose |
File Type Categories
When you organize by type, here's where stuff goes:
- documents - pdf, doc, docx, txt, md, rtf
- images - jpg, png, gif, svg, webp, bmp
- videos - mp4, avi, mkv, mov, webm
- audio - mp3, wav, flac, aac, ogg
- archives - zip, tar, gz, 7z, rar
- code - rs, py, js, c, cpp, go, java
- web - html, css, json, xml, yaml
- spreadsheets - xls, xlsx, csv
- presentations - ppt, pptx, key
- executables - exe, deb, rpm, apk
- databases - db, sqlite, sql
- fonts - ttf, otf, woff
Files with no extension? They go in no-extension/.
Unknown extensions? They get their own folder like xyz-files/.
Real-World Examples
Because theory is boring and you probably just skimmed to this part anyway.
Cleaning Up Your Downloads
# See what you're dealing with
# Preview the organization
# Actually do it
# Or organize by date if you're fancy
Finding That File You Know Exists
# You know it has "config" in the name
# It's probably a .conf file
# You edited it last week
# Screw it, show me everything recent
Nuking Temp Files
# Find them first
# Delete them (quietly, no drama)
# Or old backups
Batch Operations
# Count lines in all Python files
|
# Grep for TODO comments
|
# Compress old logs
# Get total size (JSON + jq)
| |
Finding Space Hogs
🔥 Pentesting & Security Features
Ferret now includes powerful security enumeration tools designed for pentesters, red teamers, and blue teamers. All commands are short, fast, and designed for privilege escalation reconnaissance.
Quick Security Command Reference
| Command | What It Does | Typical Usage |
|---|---|---|
fr suid |
Find SUID binaries | Privilege escalation vectors |
fr sgid |
Find SGID binaries | Group privilege escalation |
fr writable |
Find world-writable files/dirs | Writable paths for exploitation |
fr caps |
Find files with capabilities | Linux capabilities abuse |
fr configs |
Find interesting config files | Credentials, keys, passwords |
fr recent |
Find recently modified files | Detect recent system changes |
fr dn CMD |
Run command (optional output control) | Execute with optional redirection |
fr ls |
List directory contents | Like ls but with colors |
List Command (ls)
Enhanced directory listing with color-coded output:
# List current directory
# List with all files including hidden (like ls -a)
# Long format with details (like ls -l)
# Long format with human-readable sizes (like ls -lh)
# List recursively (like ls -R)
# Combine flags (like ls -laR)
# List specific directory
# Full featured listing
Color coding:
- Directories - Cyan and bold
- Executable files - Green and bold (Unix/Linux only)
- Symlinks - Purple
- Regular files - Default color
Flags:
-a/--all- Show hidden files-l/--long- Long format with permissions, size, date-R/--recursive- List subdirectories recursively-H/--human- Human-readable file sizes (KB, MB, GB)-e/--explain-perms- Explain permissions (e.g., owner:rw-, group:r--, other:r--)
Examples with permission explanations:
# Show detailed permission explanations
# Without explanations (default, cleaner output)
SUID Binary Scanner
Find SUID binaries (run with owner's privileges) - essential for privilege escalation:
# Find all SUID binaries (classic)
# Search from root (comprehensive scan)
# Quiet mode - just the paths (for scripts)
# Verbose - show permissions
# Save results to file
# Search specific directory
Equivalent to:
SGID Binary Scanner
Find SGID binaries (run with group's privileges):
# Find all SGID binaries
# Full system scan
# Quiet mode
# With detailed permissions
# Save to file
Equivalent to:
World-Writable Files Scanner
Find files and directories that anyone can modify:
# Find all world-writable files and directories
# Only directories (for backdoor placement)
# Only files
# Quiet mode for scripting
# Verbose with permissions
# Search specific path
# Save results
Common use cases:
- Find writable directories for persistence
- Locate configuration files you can modify
- Identify temp directories with weak permissions
Linux Capabilities Scanner
Find files with special capabilities (often overlooked privilege escalation vector):
# Find all files with capabilities
# System-wide scan
# Quiet mode
# Verbose output
# Save to file
# Check specific directory
Why this matters:
cap_setuidcan be used to spawn root shellcap_dac_overridecan read/write any filecap_sys_admincan mount filesystems- Often missed by standard priv-esc scanners
Config & Credential Hunter
Find interesting configuration files, credentials, keys, and sensitive data:
# Hunt for configs and credentials
# Full system search
# Quiet mode - just paths
# Verbose - show file sizes
# Save findings
# Search home directories
# Check /etc for configs
Searches for:
- Configuration files (*.conf, *.cfg, *.ini, *.yaml, *.json)
- Password files (passwd, shadow, credentials)
- SSH keys (id_rsa, id_dsa, id_ecdsa, id_ed25519)
- SSL/TLS certificates and keys (*.pem, *.key, *.crt)
- Shell config files (.bashrc, .zshrc, .profile)
- Environment files (.env, *.env)
- And more...
Recent Changes Monitor
Detect recently modified files (useful for finding newly created files or changes):
# Files modified in last 60 minutes (default)
# Files modified in last 10 minutes
# Last 24 hours (1440 minutes)
# Quiet mode
# Verbose - show how long ago
# Search from root
# Save to file
Use cases:
- Detect file changes after running exploits
- Monitor system modifications
- Find newly created backdoors
- Track configuration changes
Dev Null Helper (dn command)
Quick command executor with optional output redirection. By default, shows all output like normal - add flags to suppress output when needed:
# Run command normally (shows all output)
# Hide stdout only
# Hide stderr only (suppress errors)
# Hide all output (quiet mode)
# Works with any command
Flags:
- No flags = Show all output (normal behavior)
-s/--hide-stdout= Hide stdout, show stderr-e/--hide-stderr= Hide stderr, show stdout-q/--quiet= Hide all output (both stdout and stderr)
Equivalent to:
# fr dn command (default)
# fr dn -s command
# fr dn -e command
# fr dn -q command
Why this is useful:
- No more "Permission denied" spam
- Cleaner output when searching system-wide
- Faster than typing redirection manually
- Perfect for one-liners
Pentesting Workflow Examples
Quick Privilege Escalation Enumeration:
# One-liner to check common vectors
&& && &&
# Or more verbose for analysis
Hunt for Credentials:
# Find interesting files
# Then grep for juicy stuff
|
# Or search specific locations
Monitor System Changes:
# Before running exploit
# After running exploit
# Compare
Find Writable Paths for Persistence:
# Find writable directories
# Find writable directories in common locations
Script Integration:
#!/bin/bash
# Quick privilege escalation enumeration script
Pro Tips for Pentesters
-
Combine with grep for targeted searches:
| -
Use quiet mode in scripts:
SUID_COUNT= -
Save everything to files for later analysis:
-
Search specific high-value directories first:
-
Use dn for cleaner enumeration:
Finding Space Hogs
# Files over 1GB
# Large videos
# Show me the biggest stuff
Comparison with find
Look, find is fine if you enjoy suffering. Here's why you might want to use fr instead:
| Task | Old Way (find) | New Way (fr) |
|---|---|---|
| Find .rs files | find . -name "*.rs" |
fr find "*.rs" |
| Large files | find . -size +100M |
fr find "*" --min-size 100M |
| Recent files | find . -mtime -7 |
fr find "*" -m 7 |
| Delete temps | find . -name "*.tmp" -exec rm {} \; |
fr find "*.tmp" -x "rm {}" |
| Case-insensitive | find . -iname "*readme*" |
fr find "*readme*" -i |
Speed: Faster because Rust and parallel processing. Syntax: Simpler because it's not from 1974. Output: Actually readable without piping to 3 other commands.
Performance Tips
Make It Fast
- Be specific -
fr find "test_*.rs"beatsfr find "*"every time - Limit depth -
fr find "*.txt" -d 2if you know it's shallow - Filter early - Use size/date filters to narrow the search
- Skip detailed output - Default view is faster for large result sets
- Use quiet mode -
fr find "*.log" -q | other_commandfor scripting
When Things Get Slow
# Network drives suck, limit the damage
# Permission errors everywhere? Redirect stderr
# Too many results? Add filters
Building & Development
Build It Yourself
# Debug build (fast compile, slow runtime)
# Release build (slow compile, fast runtime)
# Run tests
# Run without installing
# Format code
# Check for issues
Create an Alias
Because typing the full path is for people with too much free time.
# Bash
# Zsh
Troubleshooting
Permission Denied
# Use sudo for system directories
# Or just ignore the errors
Command Not Found
# Check your PATH
# Use full path
# Or create an alias (see above)
It's Too Slow
# Limit depth
# Add size filters
# Use quiet mode
License
MIT License - Do whatever you want with it. Credit appreciated but not required. See LICENSE file if you care about the legal stuff.
Contributing
Found a bug? Have an idea? Cool. Open an issue or send a PR. No strict rules, just don't be a jerk and write decent commit messages.
📝 What's Next (Roadmap)
Planning for future releases:
- Trash/recycle bin support - Safe file deletion with recovery
- More search operators - Advanced filtering and queries
- More Advanced Regex options - Enhanced pattern matching capabilities
- Windows-specific privilege checks, ACL Checks and CI/CD For Windows Hosts with proper support
🙏 Contributors
Thanks to everyone who uses Ferret and provides feedback!
Made for Linux/Unix users who value their time and sanity.
If this saved you 5 minutes of typing find commands, consider it a win.