Skip to content

GARATONCODE/ForemostAuto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 

Repository files navigation


ForemostAuto.py πŸš€

Description πŸ“„

Foremost.py is a Python program designed for file recovery and data extraction. It uses the Foremost tool in a WSL (Windows Subsystem for Linux) environment to analyze disk images or raw data and recover files based on their headers, footers, and internal structures.

Features ✨

  • πŸ”„ Automatically runs Foremost via WSL to recover files.
  • πŸ“‚ Supports various file formats (images, documents, videos, etc.).
  • πŸ—‚οΈ Organizes recovered files into structured directories.
  • ⚑ Lightweight, automated, and easy to use.

Prerequisites πŸ› οΈ

  • 🐍 Python 3.x
  • πŸ–₯️ WSL (Windows Subsystem for Linux) installed and configured
  • πŸ“¦ Foremost installed in the WSL environment

Installation 🧰

  1. Clone the repository:
    git clone https://github.com/FSTHTW/ForemostAuto
  2. Navigate to the project directory:
    cd foremost.py
  3. Ensure WSL is installed and Foremost is available in the WSL environment:
    wsl sudo apt update && sudo apt install foremost

Usage πŸ–±οΈ

  1. ✏️ Modify the Python script to specify the paths to your .img file and the output folder:
    wsl_command = "foremost -i /mnt/../../to your .img file -o /mnt/../../recup_img"
  2. ▢️ Run the Python script:
    python foremost.py
  3. πŸ“ The recovered files will be available in the specified output folder.

Code Example πŸ’»

Here is an excerpt from the main script:

import subprocess

def open_wsl_and_run_command():
    wsl_command = "foremost -i /mnt/../../to your .img file -o /mnt/../../recup_img"
    try:
        print("Opening WSL and executing the command...")
        subprocess.run(["wsl", "bash", "-c", wsl_command], check=True)
        print("Analysis complete! Files are recovered in the specified folder.")
    except subprocess.CalledProcessError as e:
        print(f"Error while executing the command: {e}")
    except FileNotFoundError:
        print("Error: wsl.exe not found. Ensure WSL is properly installed.")
    except Exception as e:
        print(f"Unexpected error: {e}")

if __name__ == "__main__":
    open_wsl_and_run_command()

Notes πŸ“

  • βœ… Ensure the paths specified in the WSL command are correct and accessible.
  • πŸ“š Refer to the official Foremost documentation for advanced options.

License πŸ“œ

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages