Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Digital Forensics Collection Script is a shell script designed to automate the process of gathering essential forensic data from a Linux system. This script serves as a foundational tool for digital forensic investigators, system administrators, and security professionals who need to collect and analyze system information for incident response, security audits, or forensic investigations.
Objectives
The primary objectives of this project are to:
Automate Data Collection: Streamline the process of collecting critical system information, reducing the time and effort required for manual data gathering.
Ensure Comprehensive Coverage: Collect a wide range of data, including system configurations, user information, running processes, network settings, and logs, to provide a holistic view of the system's state.
Maintain Data Integrity: Ensure that the collected data is stored in a structured manner, preserving its integrity for further analysis.
Key Features
System Information: Gathers basic system information using the uname command, providing details about the kernel and architecture.
User Information: Extracts user account details from the /etc/passwd file, which is crucial for understanding user access and permissions.
Running Processes: Captures a snapshot of all currently running processes using the ps command, which can help identify suspicious activities.
Network Information: Collects network configuration and active connections using ifconfig and netstat, aiding in the analysis of network-related incidents.
Login History: Retrieves last login information to track user access patterns and identify potential unauthorized access.
Installed Packages: Lists installed software packages, which can be useful for identifying vulnerabilities or unauthorized software.
System Logs: Copies relevant system logs from /var/log, providing insights into system events and potential security incidents.
Crontab Entries: Collects scheduled tasks from the crontab, which can reveal automated processes that may be malicious.
File System Information: Gathers information about disk usage and mounted file systems, which is essential for understanding system resources.
Open Files: Uses the lsof command to list open files, helping to identify files that may be in use by processes.
Implementation
The script is implemented in Bash and is designed to be run on Linux systems. It creates a dedicated directory to store all collected data, timestamped for easy identification. The script is structured to handle both Debian-based and Red Hat-based systems for package collection, ensuring compatibility across different Linux distributions.
Usage
To use the script, users must:
Save the script to a file (e.g., forensic_script.sh).
Make the script executable using the chmod command.
Run the script with root privileges to ensure access to all necessary files and directories.
Conclusion
The Digital Forensics Collection Script is a valuable tool for anyone involved in digital forensics or system administration. By automating the data collection process, it enhances efficiency and ensures that critical information is gathered systematically. This script can be further customized and expanded to meet specific forensic needs, making it a versatile addition to any forensic toolkit.