apache - Apache Digest 身份验证是否比 Basic 更安全?

标签 apache security authentication basic-authentication digest-authentication

关于Authorization intro页面,Apache 告诉我们:

Apache supports one other authentication method: AuthType Digest. This method is implemented by mod_auth_digest and is much more secure.

mod_auth_digest 上时页面,Apache 告诉我们:

This module implements HTTP Digest Authentication (RFC2617), and provides an alternative to mod_auth_basic where the password is not transmitted as cleartext. However, this does not lead to a significant security advantage over basic authentication. On the other hand, the password storage on the server is much less secure with digest authentication than with basic authentication.

有人可以帮我澄清这些看似矛盾的说法吗?我知道这两种处理密码的方法都容易受到重放攻击(除非您也使用 SSL),但这似乎是一个单独的问题。

最佳答案

通过基本身份验证,密码几乎以纯文本形式(base64 编码)发送到服务器,并在服务器端对其进行哈希处理并与哈希密码(存储在 htpasswd 文件或类似文件中)进行比较。通过摘要身份验证,散列密码将发送到服务器(添加了一些服务器定义的数据,因此重放攻击将不起作用)。但要验证密码,您需要在服务器端拥有纯密码(或接近纯密码的密码)。这意味着,如果攻击者能够访问 htpasswd 文件,则需要破解所有密码才能将其用于基本身份验证,而如果攻击者能够访问 htdigest 文件,则可以直接使用它进行摘要身份验证。

总之:基本身份验证在网络上的安全性较低,但在服务器上存储则更安全。因此,两者的最佳选择是使用带有 SSL 的基本身份验证。但是,这两种身份验证技术都有缺点,即无法实现 session 超时或显式注销,例如浏览器将保持登录状态,直到关闭。这使得 CSRF 等攻击变得更加容易。

关于apache - Apache Digest 身份验证是否比 Basic 更安全?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20910207/

相关文章:

php - 如何预测系统资源需求?

php - 安全性:用户能够命名 session 变量会出现什么问题?

php - Auth::attempt 如何在 Laravel 中检查密码?

javascript - 即使我将“记住我”设置为 false,firebase 也会自动登录

authentication - SSL 和客户端证书

apache - 如何从 https 子域 URL 中删除 www

apache - 使用 dispatch.cgi 运行 CGI 时出现 perl Dancer 问题

apache - Mod_rewrite 检查 php 文件是否存在

linux - 在哪里存储我开发的应用程序?

security - 如何登录 Nessus 中的网页并执行 SecTest?