Skip to content
Public template

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DFIR Windows Collector - Enhanced Edition

A comprehensive Windows Digital Forensics and Incident Response (DFIR) evidence collection script with enhanced memory analysis capabilities.

πŸš€ Features

Core Evidence Collection

  • System Information: Complete system details, OS version, and installed programs
  • Network Information: Network configuration, connections, DNS cache, and ARP tables
  • User & Authentication: Logged-on users and login history
  • Processes & Services: Running processes with detailed information and SHA256 hashes
  • Persistence Mechanisms: Startup items, scheduled tasks, and registry run keys
  • Event Logs: Complete Security, System, and Application event logs (.evtx format)
  • Registry Hives: Full backup of all major registry hives (SYSTEM, SOFTWARE, SAM, SECURITY, NTUSER.DAT)
  • Browser Artifacts: Data from Chrome, Edge, Firefox, Opera, Brave, and IE/Edge WebCache
  • File System: Recently modified files and System32 directory hashes
  • Shortcuts: Collection of .lnk files from various system locations

Memory Analysis (Optional)

  • Flexible Memory Collection: Three modes for different scenarios
  • Procdump Integration: Automatic download and local caching of Procdump tool
  • Hash Verification: SHA256 hashing of memory dump files
  • Smart Caching: Reuses previously downloaded Procdump for faster execution

πŸ“‹ Requirements

  • Windows PowerShell 5.0 or later
  • Administrative privileges (required for registry access and memory dumps)
  • Internet connection (only for initial Procdump download)

πŸ› οΈ Installation

  1. Download the DFIR_Windows_Collector.ps1 script
  2. Place it in your desired directory
  3. Ensure you have administrative privileges

πŸ“– Usage

Basic Syntax

.\DFIR_Windows_Collector.ps1 -EvidenceID <CaseID> [-DumpMem] [-OnlyMem]

Parameters

Parameter Type Required Description
-EvidenceID String Yes Unique identifier for the evidence collection case
-DumpMem Switch No Enable memory dump collection in addition to standard evidence
-OnlyMem Switch No Collect only memory dump without other forensic evidence

Usage Examples

Standard Evidence Collection

.\DFIR_Windows_Collector.ps1 -EvidenceID "CASE001"

Collects all standard forensic evidence without memory analysis.

Complete Evidence Collection with Memory

.\DFIR_Windows_Collector.ps1 -EvidenceID "CASE001" -DumpMem

Collects all forensic evidence including full memory dump.

Memory-Only Collection

.\DFIR_Windows_Collector.ps1 -EvidenceID "CASE001" -OnlyMem

Collects only memory dump for quick memory analysis.

πŸ“ Output Structure

File Naming Convention

{EvidenceID}_{Hostname}_{YYYYMMDD_HHMMSS}.zip

Directory Structure

{EvidenceID}_{Hostname}_{YYYYMMDD_HHMMSS}/
β”œβ”€β”€ systeminfo.txt                    # System information
β”œβ”€β”€ os_version.txt                    # OS version details
β”œβ”€β”€ installed_programs.txt            # Installed software list
β”œβ”€β”€ network_config.txt                # Network configuration
β”œβ”€β”€ dns_cache.txt                     # DNS cache
β”œβ”€β”€ netstat_anob.txt                  # Network connections
β”œβ”€β”€ Get-NetTCPConnection.txt          # PowerShell network connections
β”œβ”€β”€ arp_table.txt                     # ARP table
β”œβ”€β”€ loggedon_users.txt                # Currently logged users
β”œβ”€β”€ login_history.txt                 # Login history (Security events)
β”œβ”€β”€ tasklist.txt                      # Process list
β”œβ”€β”€ Get-Process.txt                   # PowerShell process list
β”œβ”€β”€ process_hashes.csv                # Process SHA256 hashes
β”œβ”€β”€ process_hash_errors.csv           # Process hash errors
β”œβ”€β”€ services.txt                      # Service list
β”œβ”€β”€ scheduled_tasks.txt               # Scheduled tasks
β”œβ”€β”€ startup_hklm.txt                  # HKLM startup items
β”œβ”€β”€ startup_hkcu.txt                  # HKCU startup items
β”œβ”€β”€ Security.evtx                     # Security event log
β”œβ”€β”€ System.evtx                       # System event log
β”œβ”€β”€ Application.evtx                  # Application event log
β”œβ”€β”€ SYSTEM.hiv                        # Registry SYSTEM hive
β”œβ”€β”€ SOFTWARE.hiv                      # Registry SOFTWARE hive
β”œβ”€β”€ SAM.hiv                          # Registry SAM hive
β”œβ”€β”€ SECURITY.hiv                     # Registry SECURITY hive
β”œβ”€β”€ NTUSER.DAT                       # Current user registry
β”œβ”€β”€ Shortcuts/                        # Shortcut files
β”œβ”€β”€ Browsers/                         # Browser artifacts
β”œβ”€β”€ modified_files_last7days.csv     # Recently modified files
β”œβ”€β”€ system32_hashes.csv              # System32 file hashes
β”œβ”€β”€ system32_unreadable_files.txt    # Unreadable files
└── Memory/                          # Memory analysis (if enabled)
    β”œβ”€β”€ {Hostname}_{Timestamp}.dmp   # Memory dump file
    └── dump_info.csv                # Dump file information

πŸ”§ Memory Analysis Details

Procdump Tool Management

  • Local Priority: Script first checks for DFIR_tools\procdump.zip in the script directory
  • Automatic Download: Downloads Procdump from Sysinternals if not found locally
  • Local Caching: Saves downloaded Procdump for future use
  • Version: Uses the latest version from Microsoft Sysinternals

Memory Dump Information

  • Format: Full memory dump (.dmp)
  • Hash: SHA256 hash of the dump file
  • Metadata: File size, creation time, and hash stored in CSV format
  • Compression: Included in the final ZIP archive

⚑ Performance Considerations

Execution Time

  • Standard Mode: 5-15 minutes (depending on system size)
  • Memory Mode: Additional 10-30 minutes (depending on RAM size)
  • Memory-Only Mode: 10-30 minutes (memory dump only)

Storage Requirements

  • Standard Evidence: 50-500 MB (depending on system)
  • Memory Dump: 1-8 GB (depending on installed RAM)
  • Compression: Reduces total size by 20-50%

πŸ›‘οΈ Security Features

Hash Verification

  • All collected files include SHA256 hashes
  • Process executables are hashed for integrity verification
  • Memory dump files include hash verification
  • System32 files are hashed for baseline comparison

Safe Collection

  • Junction point avoidance to prevent infinite loops
  • Error handling for locked files
  • Timestamp normalization for ZIP compatibility
  • Automatic cleanup of temporary files

🚨 Troubleshooting

Common Issues

Permission Errors

Error: Access denied
Solution: Run PowerShell as Administrator

Memory Dump Failures

Error: Procdump.exe not found
Solution: Check internet connection for initial download

Registry Access Issues

Error: Cannot access registry hive
Solution: Ensure administrative privileges

Log Files

  • All errors are logged to respective error files
  • Process hash errors: process_hash_errors.csv
  • System32 errors: system32_unreadable_files.txt
  • Memory analysis errors: Memory\memory_error.txt

πŸ“Š Output Analysis

Key Files for Analysis

  1. process_hashes.csv: Analyze running processes and their integrity
  2. login_history.txt: Review authentication events
  3. modified_files_last7days.csv: Identify recent file system changes
  4. system32_hashes.csv: Baseline for system file integrity
  5. Memory dump: For advanced memory forensics

Recommended Tools

  • Registry Analysis: Registry Explorer, RegRipper
  • Memory Analysis: Volatility, Rekall
  • Log Analysis: Event Log Explorer, Splunk
  • Hash Verification: HashMyFiles, HashCalc

πŸ”„ Updates and Maintenance

Version History

  • v2.0: Enhanced with memory analysis and flexible collection modes
  • v1.0: Initial release with standard evidence collection

Future Enhancements

  • Additional browser support
  • Cloud storage integration
  • Automated analysis reports
  • Network artifact collection

πŸ“ž Support

For issues, questions, or feature requests:

  1. Check the troubleshooting section
  2. Review error logs in the output
  3. Ensure all requirements are met
  4. Verify administrative privileges

βš–οΈ Legal Notice

This tool is designed for authorized digital forensics and incident response activities only. Users are responsible for ensuring compliance with applicable laws and regulations. Always obtain proper authorization before collecting evidence from any system.

πŸ“„ License

This script is provided as-is for educational and professional use in digital forensics and incident response. Use at your own risk and ensure compliance with applicable laws and regulations.


Version: 2.0 Enhanced Edition
Last Updated: December 2024
Compatibility: Windows PowerShell 5.0+

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages