【问题标题】:Thread.Sleep in aspx error page. Why?Thread.Sleep 在 aspx 错误页面中。为什么?
【发布时间】:2011-04-17 12:27:56
【问题描述】:

this advisory关于oracle padding exploit中,微软发布了以下推荐的错误页面:

<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="System.Security.Cryptography" %>
<%@ Import Namespace="System.Threading" %>

<script runat="server">
        void Page_Load() {
        byte[] delay = new byte[1];
        RandomNumberGenerator prng = new RNGCryptoServiceProvider();

        prng.GetBytes(delay);
        Thread.Sleep((int)delay[0]);

        IDisposable disposable = prng as IDisposable;
        if (disposable != null) { disposable.Dispose(); }
    }
</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <div>
        An error occurred while processing your request.
    </div>
</body>
</html>

对于 0-255 之间的某个值,Thread.Sleep 是什么意思?我不希望我的服务器线程被占用长达四分之一秒。

【问题讨论】:

    标签: asp.net padding-oracle-attack


    【解决方案1】:

    原因是改变结果的时间。通过使返回花费可变的时间,您不能使用错误返回的时间来确定失败的原因,这是用于攻击的方法

    【讨论】:

    • 好的,但是页面不能用作向量来耗尽您的线程服务器吗?
    • @spender:不,不超过任何其他页面。作为渲染的一部分,页面等待某些东西是正常的,例如数据库结果。什么都不等并不昂贵。
    • 鉴于这一切都是从 2010 年开始的,而现在已经是 2012 年了,这个漏洞是否已经修复或者我们应该保留解决方法吗?
    • 基于technet.microsoft.com/en-us/security/bulletin/MS10-070 上的信息 - 它已在所有支持的版本的更新中得到解决。
    猜你喜欢
    • 1970-01-01
    • 2010-11-03
    • 2011-03-25
    • 1970-01-01
    • 2021-06-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多