8.ring3-破坏knowndlls反劫持保护

https://support.microsoft.com/zh-cn/kb/164501 https://support.microsoft.com/en-us/kb/164501
KnownDlls必须是在系统目录中,并且是在系统启动的时候,从注册表读取KnownDlls列表之后,如果加载这个dll,首先搜索系统目录,其次搜索当前目录。
knowndlls,顾名思义,是指系统目录默认加载的DLL,现在病毒伪装的马甲DLL置于文件启动目录之下伺机启动早已不是什么有创意的做法。应用程序启动前优先加载当前目录下的所需DLL,这就给木马的启动又多了一条途径,而knowndlls键值正是斩断这条传播通断的利剑,无论你在当前目录下有多少马甲DLL,应用程序都会从SYSTEM目录下去寻找,从而避免了马甲的毒害。
KnownDlls必须是在系统目录中,并且是在系统启动的时候,从注册表读取KnownDlls列表。之后,如果加载这个dll,首先搜索系统目录,其次搜索当前目录。

系统自带KnownDlls,读取注册表里的dll,就不管其他的dll了

解决方案是:把HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SessionManager\knowndlls下的lpk项删除掉,重启电脑,再就可以dll劫持了

对于win7, 在HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SessionManager有个项叫做ExcludeFromKnownDlls(如果这个项没有,就手工加一个吧),把你的Lpk.dll加进去,重启电脑就行了,因为在win7下knowndlls是没有权限操作的!


这里再附上knowdlls的微软官方解释:

DLLs: 32-bit

For 32-bit DLLs the KnownDLLs registry key is found at:
   HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager
				
The REG_SZ registry value name is the name of the DLL without the extension. The registry value data is the name of the DLL with the extension. This entry affects only implicitly loaded DLLs, not DLLs loaded using the LoadLibrary() API. 

Without this entry, Windows NT uses the following search order to locate the DLL:
  1. The directory of the executable for the process that is loading the DLL.
  2. The current directory of the process that is loading the DLL.
  3. The \WINNT\SYSTEM32 directory.
  4. The \WINNT directory.
  5. A directory listed in the path environment variable.
With the KnownDLLs registry entry, Windows NT uses the following search order to locate the DLL:
  1. The \WINNT\SYSTEM32 directory.
  2. The directory of the executable for the process that is loading the DLL.
  3. The current directory of the process that is loading the DLL.
  4. The \WINNT directory.
  5. A directory listed in the PATH environment variable.

  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值