https://github.com/richardevcom/flagsearch
Searches for CTF flags in files or directories recursively.
https://github.com/richardevcom/flagsearch
bash ctf flag grep linux search
Last synced: 4 days ago
JSON representation
Searches for CTF flags in files or directories recursively.
- Host: GitHub
- URL: https://github.com/richardevcom/flagsearch
- Owner: richardevcom
- License: mit
- Created: 2025-03-22T00:18:16.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-03-22T00:52:35.000Z (3 months ago)
- Last Synced: 2025-06-17T14:13:19.087Z (10 days ago)
- Topics: bash, ctf, flag, grep, linux, search
- Language: Shell
- Homepage: https://github.com/richardevcom/flagsearch
- Size: 12.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# CTF Flag Search Tool
[](https://opensource.org/licenses/MIT)
[](https://github.com/richardevcom/flagsearch)A powerful command-line tool designed to help CTF participants and security professionals search for flags within files and directories. This tool can search both file names and file contents for specified flag patterns.
## 🚀 Features
- Search for flags in filenames
- Deep search within file content
- Color-coded output for better readability
- Clean and intuitive user interface
- Works with single files or entire directories## 📋 Requirements
- Bash 4.0 or later
- Standard Unix utilities (`grep`, `find`, etc.)
- Read permissions to files you want to search## 🔧 Installation
1. Clone the repository:
```bash
git clone https://github.com/richardevcom/flagsearch.git
cd flagsearch
```2. Make the script executable:
```bash
chmod +x flagsearch.sh
```3. Optionally, create a symbolic link to use the tool from anywhere:
```bash
sudo ln -s $(pwd)/flagsearch.sh /usr/local/bin/flagsearch
```## 🔎 Usage
Basic syntax:
```bash
flagsearch.sh -f -i [-d]
```### Parameters:
- `-f` - Pattern to search for (required)
- `-i` - Input file or directory to search in (required)
- `-d` - Enable deep search (search within file contents - optional, only applicable with directory input)### Examples:
1. Search for files with "flag" in the filename:
```bash
flagsearch.sh -f flag -i /path/to/ctf/files
```2. Search for files containing "flag{" in their content:
```bash
flagsearch.sh -f flag{ -i /path/to/ctf/files -d
```3. Search for a specific flag format in a single file:
```bash
flagsearch.sh -f "flag{[A-Za-z0-9]+" -i suspicious_file.txt
```## 🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the project
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request## 📜 License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ✉️ Follow
Twitter - [@richardevcom](https://twitter.com/richardevcom)
Project Link: [https://github.com/richardevcom/flagsearch](https://github.com/richardevcom/flagsearch)