{"id":1707,"date":"2015-01-29T21:40:10","date_gmt":"2015-01-29T21:40:10","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=1707"},"modified":"2015-01-29T21:40:10","modified_gmt":"2015-01-29T21:40:10","slug":"ghost-vulnerability","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2015\/01\/29\/ghost-vulnerability\/","title":{"rendered":"Ghost Vulnerability"},"content":{"rendered":"<p>A very serious security problem has been found and patched in the GNU C Library called Glibc. It was announced on 27th January 2015.<\/p>\n<p>Here are the affected Linux distros:<\/p>\n<ul>\n<li>RHEL (Red Hat Enterprise Linux) version 5.x, 6.x and 7.x<\/li>\n<li>CentOS Linux version 5.x, 6.x &amp; 7.x<\/li>\n<li>Ubuntu Linux version 10.04, 12.04 LTS<\/li>\n<li>Debian Linux version 7.x<\/li>\n<li>Linux Mint version 13.0<\/li>\n<li>Fedora Linux version 19 or older<\/li>\n<li>SUSE Linux Enterprise 11 and older (also OpenSuse Linux 11 or older versions).<\/li>\n<li>SUSE Linux Enterprise Software Development Kit 11 SP3<\/li>\n<li>SUSE Linux Enterprise Server 11 SP3 for VMware<\/li>\n<li>SUSE Linux Enterprise Server 11 SP3<\/li>\n<li>SUSE Linux Enterprise Server 11 SP2 LTSS<\/li>\n<li>SUSE Linux Enterprise Server 11 SP1 LTSS<\/li>\n<li>SUSE Linux Enterprise Server 10 SP4 LTSS<\/li>\n<li>SUSE Linux Enterprise Desktop 11 SP3<\/li>\n<li>Arch Linux glibc version &lt;= 2.18-1<\/li>\n<\/ul>\n<p><strong>Read More to Fix the GHOST vulnerability on a CentOS\/RHEL\/Fedora\/Ubuntu Linux<\/strong><br \/>\n<!--more--><\/p>\n<p><strong>What is it?<\/strong><\/p>\n<p>A heap-based buffer overflow was found in __nss_hostname_digits_dots(), which is used by the gethostbyname() and gethostbyname2() glibc function call.<\/p>\n<p><strong>How can it hurt me?<\/strong><\/p>\n<p>A remote attacker could use this flaw to execute arbitary code with the permissions of the user running the application.<\/p>\n<p><strong>How to Check if I am vulnerable?<\/strong><\/p>\n<p>Check the version for the C library (Glibc).<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># ldd --version\n\n<\/pre>\n<p>Note that, at least on CentOS 6 and likely on RHEL6, the ldd \u2013version command will still return 2.12 even after the update. One can check the rpm package version to see if the system was updated (see the full package list at <a href=\"https:\/\/rhn.redhat.com\/errata\/RHSA-2015-0092.html\" target=\"_blank\" rel=\"noopener\">https:\/\/rhn.redhat.com\/errata\/RHSA-2015-0092.html<\/a>). The 2.12 library was patched, not replaced by a newer version. For example:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># rpm -q glibc\nglibc-2.12-1.149.el6_6.5.i686<\/pre>\n<p>RHEL\/CentOS Linux v6.6:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">&#x5B;root@cloud1 ~]# ldd --version\nldd (GNU libc) 2.12\nCopyright (C) 2010 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\nWritten by Roland McGrath and Ulrich Drepper.\n\n<\/pre>\n<p><strong>Test C Program<\/strong><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># wget https:\/\/qbytes.cloud\/files\/GHOST.c\n\n<\/pre>\n<p>Compile it:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># gcc -o GHOST GHOST.c\n\n<\/pre>\n<p>Test it:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># .\/GHOST\n\n<\/pre>\n<p>Sample outputs:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># .\/GHOST\nvulnerable\n\n<\/pre>\n<p><strong>GHOST-test.sh Vulnerability Test Bash Script<\/strong><\/p>\n<p>Get the script<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># wget https:\/\/qbytes.cloud\/files\/GHOST-test.sh\n\n<\/pre>\n<p>Run it<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># bash GHOST-test.sh\n\n<\/pre>\n<p>Output:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">]# .\/GHOST-test.sh\nInstalled glibc version(s)\n- glibc-2.12-1.132.el6.x86_64: vulnerable\n\nThis system is vulnerable to CVE-2015-0235. &amp;lt;https:\/\/access.redhat.com\/security\/cve\/CVE-2015-0235&amp;gt;\nPlease refer to &amp;lt;https:\/\/access.redhat.com\/articles\/1332213&amp;gt; for remediation steps\n\n<\/pre>\n<p><strong>How to Fix it<\/strong><\/p>\n<p><strong>CentOS\/RHEL\/Fedora\/<\/strong><\/p>\n<p>Type the following yum command as the root user:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># yum clean all\n# yum update\n<\/pre>\n<p>Finally, reboot<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># sudo reboot\n<\/pre>\n<p><strong>Ubuntu Linux<\/strong><\/p>\n<p>Type the following apt-get command as the root user:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># sudo apt-get clean\n# sudo apt-get update\n# sudo apt-get upgrade\n## only run dist-upgrade on a Ubuntu if you want to upgrade kernel too\n##sudo apt-get dist-upgrade\n\n<\/pre>\n<p>Finally, reboot Ubuntu Linux server by typing the following command:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# sudo reboot\n\n<\/pre>\n<p>** Reboot is necessary because currently running processes loaded on the old libs, and are vulnerable even after the glibc update. The reboot will force them to read the new libs.<\/p>\n<p>If, after patching, you\u2019re able to manually restart services listed with the following command a reboot shouldn&#8217;t be necessary:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># lsof | grep libc | awk &#039;{print $1}&#039; | sort | uniq\n\n<\/pre>\n<p>Sources:<\/p>\n<p><a href=\"http:\/\/www.cyberciti.biz\/faq\/cve-2015-0235-patch-ghost-on-debian-ubuntu-fedora-centos-rhel-linux\/\" target=\"_blank\" rel=\"noopener\">http:\/\/www.cyberciti.biz\/faq\/cve-2015-0235-patch-ghost-on-debian-ubuntu-fedora-centos-rhel-linux\/<\/a><br \/>\n<a href=\"http:\/\/www.cyberciti.biz\/faq\/cve-2015-0235-ghost-glibc-buffer-overflow-linux-test-program\/\" target=\"_blank\" rel=\"noopener\">http:\/\/www.cyberciti.biz\/faq\/cve-2015-0235-ghost-glibc-buffer-overflow-linux-test-program\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A very serious security problem has been found and patched in the GNU C Library called Glibc. It was announced on 27th January 2015. Here are the affected Linux distros: RHEL (Red Hat Enterprise Linux) version 5.x, 6.x and 7.x CentOS Linux version 5.x, 6.x &amp; 7.x Ubuntu Linux version 10.04, 12.04 LTS Debian Linux &#8230; <a title=\"Ghost Vulnerability\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2015\/01\/29\/ghost-vulnerability\/\" aria-label=\"Read more about Ghost Vulnerability\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,11,12,82,102,117],"tags":[],"class_list":["post-1707","post","type-post","status-publish","format-standard","hentry","category-administration","category-centos6","category-centos-7","category-patches","category-security","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/1707","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=1707"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/1707\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=1707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=1707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=1707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}