gpt4 book ai didi

c - 如何通过 TLS 测试 POODLE?

转载 作者:太空狗 更新时间:2023-10-29 16:56:42 26 4
gpt4 key购买 nike

我希望能够通过 TLS 测试 POODLE 漏洞。

已经有几种方法可以做到这一点,例如 Qualys SSLLabs,但它限制太多(互联网上只有服务器的 TCP 端口 443 可用)。还有这个链接,但我在测试时得到了很多误报/否定:http://www.exploresecurity.com/testing-for-poodle_tls-manually/

所以现在我正在尝试修改 OpenSSL 1.0.2d 的 TLS 实现,以便能够发送无效数据包(使用 openssl s_client ...)并查看服务器的行为。

即使我不太熟悉 C,我也可以在 crypto/evp/e_aes_cbc_hmac_sha1.c 的 OpenSSL 中找到实现 AES-CBC-SHA 填充的有趣代码(根据 RFC 2246)第 518 行:

/* pad the payload|hmac */
plen += SHA_DIGEST_LENGTH;
for (l = len - plen - 1; plen < len; plen++)
out[plen] = l;

我将其修改成这样,以便根据 RFC 更改第一个填充字节以使其不正确:

/* pad the payload|hmac */
plen += SHA_DIGEST_LENGTH;
for (l = len - plen - 1; plen < len; plen++) {
if (plen == len - l - 1)
out[plen] = (l + 1) % 256;
else
out[plen] = l;
}

然后编译测试:

./config
make
./apps/openssl s_client -connect www.google.com:443 -servername www.google.com -tls1 -cipher AES128-SHA

我可以连接并发出一个得到响应的 HTTP 请求...

所以我的问题是:这不是我修改的好文件还是其他东西?

非常感谢您的帮助。

最佳答案

我有同样的问题,回答here .基本上,您需要修改 ssl3_enc 函数(在 s3_enc.c 文件中)并替换

memset(&rec->input[rec->length], 0, i);

for(size_t j = 0; j < i; ++j) {
rec->input[rec->length + j] = rand() % 256;
}

而且对于 block 对齐良好且没有填充的情况,最好增加填充大小。为此,只需添加:

i += bs;

就在这些行之前

/* we need to add 'i-1' padding bytes */
l += i;

关于c - 如何通过 TLS 测试 POODLE?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31721567/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com