# File Analysis Container A comprehensive Docker-based toolkit for malware and file forensics analysis, featuring an extensive offline help system and modern shell environments. ## ๐ŸŽฏ Quick Start ```bash # Clone the repository git clone https://github.com/tabledevil/docker_file_analysis.git cd docker_file_analysis # Build using REMnux upstream (recommended) make build-upstream # Run the container docker run -it --rm -v "$(pwd):/data" tabledevil/file-analysis:remnux # Inside the container, get help fhelp ``` ## ๐Ÿ“ฆ Build Options This project offers **three different build strategies** to suit your needs: ### 1. **REMnux Upstream** (Recommended) Uses the official `remnux/remnux-distro` image as a base and adds enhancements. ```bash make build-upstream # OR docker build -f Dockerfile.remnux -t tabledevil/file-analysis:remnux . ``` **Advantages:** - Fast build (uses pre-built REMnux image) - Includes all REMnux tools and configurations - Regular updates from upstream - Production-ready ### 2. **From Scratch** (Full Control) Builds a REMnux-like environment from Ubuntu 20.04 base, mimicking the official build. ```bash make build-scratch # OR docker build -f Dockerfile.scratch -t tabledevil/file-analysis:scratch . ``` **Advantages:** - Full control over every package and configuration - Understand exactly what's installed - Customize the base system - Smaller final image (optional) ### 3. **Kali Base** (Legacy) Original implementation using Kali Linux rolling as the base. ```bash make build-kali # OR docker build -f Dockerfile -t tabledevil/file-analysis:kali . ``` **Advantages:** - Access to Kali Linux security tools - Different package ecosystem - Alternative to REMnux ## ๐Ÿš€ Usage ### Basic Analysis Workflow ```bash # Start the container with a directory containing files to analyze docker run -it --rm -v "/path/to/suspicious/files:/data" tabledevil/file-analysis:remnux # Inside the container: # Get help on available tools fhelp # Find PDF analysis tools fhelp tools pdf # Quick command examples for a specific tool fhelp cheat pdfid.py # Analyze a PDF pdfid.py suspicious.pdf pdf-parser.py suspicious.pdf # Interactive cheat sheet browser fhelp examples # Switch to zsh or fish for better interactivity zsh # or fish ``` ### Alternative Shells The container includes three shells with different features: - **bash** (default) - Traditional, reliable - **zsh** - Advanced completion, history search, plugins - **fish** - Friendly syntax, autosuggestions ```bash # Try zsh zsh # Try fish fish ``` ## ๐Ÿ“š Comprehensive Help System The container features an **offline-first help system** with multiple layers: ### 1. Command-Line Help (`fhelp`) ```bash fhelp # Main help menu fhelp tools pdf # Find PDF analysis tools fhelp cheat # Quick examples for a tool fhelp tldr # Simplified man pages fhelp examples # Browse all cheat sheets interactively fhelp pdf # PDF analysis workflow guide ``` ### 2. Tool Coverage The help system includes documentation for **100+ analysis tools**: - **PDF Analysis:** pdfid, pdf-parser, peepdf, pdftk, qpdf, pdfresurrect, origami suite - **Office Documents:** oledump, rtfdump, oletools, emldump - **Malware Analysis:** capa, box-js, strings, vivisect - **File Inspection:** exiftool, file, binwalk, hexdump - **Scripting:** python, ruby, perl, powershell (with PSScriptAnalyzer) - **Data Analysis:** visidata, jq, yq, sqlite3 - **System Tools:** fd-find, ripgrep, zsh, fish ### 3. Help Content Types - **Cheat Sheets** - Quick command examples and common patterns - **TLDR Pages** - Simplified, example-focused documentation - **Fish Completions** - Smart command-line autocompletion - **Workflow Guides** - Multi-tool analysis procedures ## ๐Ÿ› ๏ธ Adding & Modifying Help Content See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed instructions on: - Adding cheat sheets for new tools - Creating TLDR pages - Writing fish shell completions - Importing bulk cheatsheets from markdown - Checking help coverage for installed tools ### Quick Example: Add a Cheat Sheet ```bash # Inside the container: cat > /opt/cheatsheets/personal/mytool << 'EOF' # mytool - Description # Basic usage mytool file.txt # Advanced options mytool -v --output result.txt input.txt EOF # Test it fhelp cheat mytool ``` ## ๐Ÿ”ง Included Tools ### PDF Analysis Suite - **peepdf** - Interactive PDF analysis with JavaScript detection - **pdf-parser.py** - Extract and analyze PDF elements (Didier Stevens) - **pdfid.py** - Quick PDF structure overview - **pdftk** - PDF manipulation and transformation - **qpdf** - PDF inspection and transformation - **origami** - Ruby suite (pdfcop, pdfextract, pdfmetadata) - **pdfresurrect** - Extract previous versions from PDFs ### Malware Analysis - **capa** - Detect malware capabilities (Mandiant) - **box-js** - JavaScript sandbox - **oletools** - Office document analysis (oledump, rtfdump, emldump) - **vivisect** - Malware analysis framework - **strings** - Extract printable strings - **upx** - Executable packer/unpacker ### Modern Shells & Tools - **PowerShell** - Cross-platform PowerShell with PSScriptAnalyzer - **zsh** - With autosuggestions and syntax highlighting - **fish** - Friendly interactive shell - **fd-find** - Modern, fast file finder - **ripgrep** - Ultra-fast recursive grep ### Data Analysis - **visidata** - Terminal spreadsheet and data explorer - **unfurl** - URL and forensics data analyzer - **jq** - JSON processor - **sqlite3** - Database analysis ### File Inspection - **exiftool** - Metadata extraction - **binwalk** - Firmware analysis - **hexdump** / **xxd** - Binary viewers - **file** - File type identification ## ๐Ÿ“ Repository Structure ``` docker_file_analysis/ โ”œโ”€โ”€ Dockerfile # Kali-based build (legacy) โ”œโ”€โ”€ Dockerfile.remnux # REMnux upstream build (recommended) โ”œโ”€โ”€ Dockerfile.scratch # Build from Ubuntu base (full control) โ”œโ”€โ”€ Makefile # Build automation โ”œโ”€โ”€ README.md # This file โ”œโ”€โ”€ CONTRIBUTING.md # How to add/modify help content โ”œโ”€โ”€ WARP.md # WARP AI assistant context โ”œโ”€โ”€ files/ # Container configuration files โ”‚ โ”œโ”€โ”€ README # Welcome message shown on login โ”‚ โ”œโ”€โ”€ command_help # Detailed command examples โ”‚ โ”œโ”€โ”€ zshrc # Zsh shell configuration โ”‚ โ””โ”€โ”€ fish_config.fish # Fish shell configuration โ”œโ”€โ”€ scripts/ # Helper scripts โ”‚ โ”œโ”€โ”€ fhelp # Main help system โ”‚ โ”œโ”€โ”€ create-offline-help-system.sh # Build help database โ”‚ โ”œโ”€โ”€ add-tool-cheats.sh # Add default cheat sheets โ”‚ โ”œโ”€โ”€ import-remnux-cheatsheets.sh # Import bulk cheatsheets โ”‚ โ”œโ”€โ”€ convert-remnux-cheats.py # Convert markdown to cheat format โ”‚ โ”œโ”€โ”€ check-help-coverage.sh # Verify help coverage โ”‚ โ””โ”€โ”€ find-tool # Search for tools โ”œโ”€โ”€ cheatsheets/ # Custom cheat sheets โ”‚ โ”œโ”€โ”€ pdf-analysis.cheat โ”‚ โ”œโ”€โ”€ malware-analysis.cheat โ”‚ โ””โ”€โ”€ system-utilities.cheat โ”œโ”€โ”€ docs/ # Additional documentation โ””โ”€โ”€ tests/ # Test scripts ``` ## ๐Ÿงช Testing ```bash # Test all builds make test # Test specific build docker run --rm tabledevil/file-analysis:remnux fhelp cheat pdfid # Run help coverage check docker run --rm tabledevil/file-analysis:remnux check-help-coverage.sh ``` ## ๐Ÿณ Docker Hub Pre-built images are available: ```bash # Pull the latest REMnux-based image docker pull tabledevil/file-analysis:remnux # Pull the Kali-based image (legacy) docker pull tabledevil/file-analysis:latest ``` ## ๐Ÿค Contributing Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for: - Adding new tools - Improving help content - Adding cheat sheets and TLDR pages - Enhancing shell configurations - Reporting bugs ## ๐Ÿ“ License This project packages various open-source tools. Please respect individual tool licenses. ## ๐Ÿ™ Acknowledgments - [REMnux](https://remnux.org/) - Malware analysis toolkit - [Didier Stevens](https://blog.didierstevens.com/) - PDF analysis tools - [Mandiant](https://www.mandiant.com/) - CAPA malware analysis - [cheat](https://github.com/cheat/cheat) - Cheat sheet system - [tldr](https://tldr.sh/) - Simplified man pages ## ๐Ÿ“ฎ Support - **Issues**: [GitHub Issues](https://github.com/tabledevil/docker_file_analysis/issues) - **Discussions**: [GitHub Discussions](https://github.com/tabledevil/docker_file_analysis/discussions) --- **Security Note**: This container is designed for analyzing potentially malicious files. Always run it with appropriate isolation and never execute untrusted code outside the container.