Giter VIP home page Giter VIP logo

deleteprotector-minifilter-driver's Introduction

DeleteProtector-minifilter-Driver

DeleteProtector is a File system minifilter driver (upper filter) that stops any attemp from the cmd to delete a file (of course even if the cmd runs as an admin).

this is done by intercepting two types of IRP: IRP_MJ_CREATE & IRP_MJ_SET_INFORMATION.

How cmd deletes a file

cmd apply this action by two ways, if one fails it will use the other:

  • the first is to open the file with DELETE_ON_CLOSE, then close the handle so the file will be deleted
  • if this failed, it will then try to call NtSetInformationFile with FileInformationClass set to FileDispositionInformation or FileDispositionInformationEx, then set the FILE_DISPOSITION_INFORMATION (or FILE_DISPOSITION_INFORMATION_EX) with the appropriate values.

So in the code you going to see that I registered a pre-callback to those two types of IRP and do the appropriate check to see if it came from the cmd and if it want to actually delete the file ..etc. and if all is right then stop the request from being passed to the file system driver.

Note

I'm checking the process name that if it contain the path to cmd, of course you may notice that it's easy to avoid this driver by chaning the process name or run the cmd from different path, but I wrote this driver just to apply the needed concepts.

deleteprotector-minifilter-driver's People

Contributors

omarshehata11 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.