How do I prevent DLL injection

前端 未结 8 2200
自闭症患者
自闭症患者 2020-11-27 11:01

So the other day, I saw this:

http://www.edgeofnowhere.cc/viewtopic.php?p=2483118

and it goes over three different methods of DLL injection. How would I preven

8条回答
  •  一向
    一向 (楼主)
    2020-11-27 11:33

    I'm not intimately familiar with the Windows API, but I can give you some more generalized pointers:

    1. See if you can use Windows Data Execution Prevention (DEP). It will probably not work for all (read: most) situations, because the process outlined in your link is a valid process from the OS's standpoint. Defense in depth though

    2. Ensure that your process methods assert security permissions throughout the application

    3. Statically allocate your memory space so that any new threads spawned into it will either fail or overwrite existing memory space; you'll need probably a hefty chunk of logic to detect and correct for this though.

    4. Factor your code into a device driver or some other low-level type process that you can get covered under the Windows File Protection umbrella.

    Just saw Cthulon's answer and I'm afraid he's probably correct: anyone who wants to perform code injection on your application will find a way to do so. The steps above might merely make it a bit more difficult.

    Hope this helps

提交回复
热议问题