Git Product home page Git Product logo

macroremover's Introduction

MacroRemover

A python script which can be used during or after cyber incidents to prepare filesystems to be moved to the green/clean zone.

It is capable of parsing recursively at a defined starting path. It will check and process all files according to a ruleset which is defined in the config.ini. Processed files are copied into a processed folder which is mirroring the original directory structure.

Functionalities

  • The script is capable of removing Office macros using the Win32 API. To do this, the filetype (".doc", ".docm", ".xls", ".xslm") has to be defined under convert in the config.ini

  • It is capable of removing defined files according to a fileending. To do this, the file ending (e.g. ".exe") has to be defined under remove in the config.ini

  • It is capable of just copying filetypes into the processed folder To do this, the file ending (e.g. ".dwg") has to be defined under allowed in the config.ini

  • To create a backup copy of the original files before they are deleted or the macros removed, it is possible to collect them and save them in a archive file with a password. To do this, the file endings (e.g. ".exe", ".doc") have to be defined under compressed in the config.ini. The password and the filename can be defined there as well.

Config File

The configuration of the tool should be very much self explanatory.

[config]

Path where the files to be searched are located

path = C:\Users\IEUser\Desktop\Handler\TEST\

Path where matched files are placed. (Rule: "allowed")

processed_files_path = C:\Users\IEUser\Desktop\Handler\processed\

Path where converted files should be placed.

If the path is empty, "processed_file_path" is used

converted_files_path =

Filename of the zip archive for files to be compressed

zipfile_name = archive.zip

Password of the zip archive

zipfile_password = 123456

[filetypes]

File extensions defined here are allowed and will be copied to the "processed" folder.

allowed = [".docx"]

File extensions defined here will be converted to a non-macro format.

Currently supported formats: xls, xlsm, docm, doc

convert = [".doc"]

File extensions defined here will be deleted by the script.

remove = []

File extensions defined here will be placed in a zip archive in the "processed" folder.

compress = [".txt",".doc"]

Required Libraries

  • pywin32
  • pyminizip

macroremover's People

Contributors

obikenobii avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.