我怎样才能proctect我对DLL劫持.NET应用程序? [英] How can I proctect my .NET application against DLL Hijacking?

查看:398
本文介绍了我怎样才能proctect我对DLL劫持.NET应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个.NET 3.5的应用程序,注册扩展。我们如何保护它不受DLL劫持攻击?

We have a .NET 3.5 application with registered extensions. How can we protect it against DLL Hijacking attacks?

由于遗产和放大器;设计问题强命名/签名是不是现在的选项

额外的信息,如果你不知道什么是DLL劫持是:

Extra Information if you don't know what DLL Hijacking is:

  • What's DLL Hijacking - SO
  • DLL hijacking vulnerabilities

推荐答案

我曾碰到过类似的问题,我已经结束了写我自己的逻辑来验证该dll。对我来说,我只是使用DLL在LGPL的方式(我不能修改DLL),但希望确保我的应用程序使用真正的DLL(不喜劫持之一)。

I had came across similar issue, I had ended up writing my own logic for verifying the dll. For me I was just using that dll in LGPL fashion (I can't modify the dll), but wanted to make sure that my application uses the genuine dll (not the hi-jacked one).

简单的解决方案:

更好的解决方案:

  • 生成散列的dll,具有较强的散列算法和盐
  • 在生成RSA键值对(私钥和公钥)
  • 加密的DLL的哈希值与私钥
  • 嵌入的公共密钥,加密散列和盐在应用程序
  • 当应用程序启动时,加密散列解密用你的公钥
  • 再次在运行时具有相同的盐生成散列,并比较使用公开密钥与解密的哈希

如果你从如Verisign信任的CA任何证书,您可以使用使用RSA密钥值对认定证书来代替。

If you have any certificate from trusted CA like verisign, you can use that certificate instead of using RSA key value pair.

这样即使有人用破解的DLL替换您的dll,哈希将不匹配,你的应​​用程序就会知道劫机企图。

This way even if someone replaces your dll with cracked dll, the hash will not match and your application will know the Hijacking attempt.

此方法可能比只给DLL好强的名字,因为,可能是强名称验证可以通过运行禁用

This approach could is better than only giving dll a strong name because, may be strong name verification can be disabled by running

SN -Vr HijackedAssembly

希望这可以帮助你,或某人谁想要了解的东西签名的数字是如何在内部工作。

Hope this helps you, or someone who wants to understand how digital signature things work internally.

这篇关于我怎样才能proctect我对DLL劫持.NET应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆