Retired: This application is now retired.
GHOST (CVE-2015-0235) - gethostbyname Detector
This script helps you confirm whether your system is susceptible to GHOST.
UPDATE: A new version of the detector script is now available that resolves the existing problems reported in this thread.
Comments
Subscriber exclusive content
An active Red Hat subscription is required to participate.
Log InThe current script is incorrect:
It requires the following chages:
After modification:
Thanks for the diff. That fixes EL6, but breaks EL5. I don't have an EL7 to test, but following diff works on 5 & 6:
$ diff -U 0 GHOST-test.sh.orig GHOST-test.sh
--- GHOST-test.sh.orig 2015-01-27 18:50:11.899497404 -0600
+++ GHOST-test.sh 2015-01-27 19:55:36.059068391 -0600
@@ -40,0 +41 @@
+echo "Vulnerable glibc version <=" $glibc_vulnerable_version3"-"$glibc_vulnerable_revision3
@@ -43 +44,4 @@
-glibc_revision=$(rpm -q glibc | awk -F"[-.]" '{print $4}' | sort -u)
+test $glibc_version = '2.5' && \
+ glibc_revision=$(rpm -q glibc | awk -F"[-.]" '{print $4}' | sort -u)
+test $glibc_version = '2.12' && \
+ glibc_revision=$(rpm -q glibc | awk -F"[-.]" '{print $5}' | sort -u)
Cheers.
How about this, which has been tested in EL5, EL6 and EL7:
Please find below the outputs for reference:
EL5
EL6
EL7
~~~~~~
[sibu@dhcp223-81 ~]$ rpm -q glibc
glibc-2.17-55.el7_0.5.x86_64
[sibu@dhcp223-81 ~]$
[sibu@dhcp223-81 ~]$ sh GHOST.sh
Vulnerable glibc version <= 2.17-54
Vulnerable glibc version <= 2.5-122
Vulnerable glibc version <= 2.12-148
Detected glibc version 2.17-55
Not Vulnerable.
[sibu@dhcp223-81 ~]$
~~~~~~~
This script has been rewritten to avoid checking for specific versions which vary across major and extended releases. Sorry for any inconvenience this may have caused.
This script appears to be broken. It does not check the Release version numbers correctly across all versions of RHEL server. Thus, it marks unpatched hosts as patched (RHEL7 & RHEL5) while marking RHEL6 hosts as vulnerable.
e.g.
RHEL7:
Version : 2.17
Release : 55.el7_0.3
is marked as patched when in fact only version 55.el7_05 is patched. The script only checks for the presence of "55".
This script has been rewritten to avoid checking for specific versions which vary across major and extended releases. Sorry for any inconvenience this may have caused.
You should mention, that the script does not "test if system is vulnerable" but only "test if system has a known bad version of libc".
RHEL 6 false positive
[root@labntrn035]~# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.4 (Santiago)
[root@labntrn035]~# rpm -q glibc --queryformat "%{name}-%{version}-%{release}.%{arch}\n"
glibc-2.12-1.149.el6_6.5.x86_64
glibc-2.12-1.149.el6_6.5.i686
[root@labntrn035]~# /var/tmp/GHOST-test.sh
Vulnerable glibc version <= 2.17-54
Vulnerable glibc version <= 2.5-122
Detected glibc version 2.12-1
This system is vulnerable to CVE-2015-0235. https://access.redhat.com/security/cve/CVE-2015-0235
Please refer to https://access.redhat.com/articles/1332213 for remediation steps
why not?
[root@localhost ~]# rpm -qa glibc
glibc-2.12-1.149.el6_6.5.x86_64 <== patch version?
[root@localhost ~]# ./GHOST-test.sh
Vulnerable glibc version <= 2.17-54
Vulnerable glibc version <= 2.5-122
Detected glibc version 2.12-1
This system is vulnerable to CVE-2015-0235. https://access.redhat.com/security/cve/CVE-2015-0235
Please refer to https://access.redhat.com/articles/1332213 for remediation steps
[root@localhost ~]#
glibc_version=$(rpm -q glibc | awk -F"[-.]" '{print $2"."$3}' | sort -u)
glibc_revision=$(rpm -q glibc | awk -F"[-.]" '{print $4}' | sort -u) <== miss version check?
This tool does not seem to work for RHEL 6 systems. I applied the Errata updates that purport to fix this bug (by upgrading glibc to glibc-2.12-1.149.el6_6.5.x86_64, RHSA-2015:0092-1 ( https://rhn.redhat.com/errata/RHSA-2015-0092.html )) and yet this tool still reports the system as vulnerable. Perhaps this is because it only checks the version number on the RPM, not for the actual vulnerability? Please let me know if my system is still vulnerable or your tool is not working.
Ok, I saw the patches to this after submitting my comment, noticing the "See comments" link in the hidden section of the page, and then coming here. This is not a professional way to distribute software and reflects poorly on RedHat. RedHat: Please act professionally -- apply the patches to the version of the script people download from the front page (https://access.redhat.com/labsinfo/ghost), rather than expecting them to find the buried link to the comments section, laboriously read through them, then apply the patch themselves.
This script has been rewritten to avoid checking for specific versions which vary across major and extended releases. Sorry for any inconvenience this may have caused.
Can we count on this script? Looks like system with existing updates are not affected.
nm, comments should be displayed by default. Ridiculous.
This is so broken...
Having a script that informs you that all is swell is worse than having no script at all.
You need to take down this script ASAP until you can find a proper fix for it.
This patch fixes the script for us, EL5/6/7
This script has been rewritten to avoid checking for specific versions which vary across major and extended releases. Sorry for any inconvenience this may have caused.
Hi,
We execute script GHOST-test.sh in several of my system.
The output is "Not vulnerable".
However we execute a C program from https://www.qualys.com/research/security-advisories/GHOST-CVE-2015-0235.txt
The output of this program is "vulnerable".
Sytems:
RHEL 6.6 and kernel 2.6.32-504.1.3.el6.x86_64
GHOST-test.sh output:
Detected glibc version 2.12 revision 149
Not Vulnerable.
Which of those tests are ok?
Regards
This script doesn't seem to detect the vulnerability correctly on RHEL6 systems
This script has been rewritten to avoid checking for specific versions which vary across major and extended releases. Sorry for any inconvenience this may have caused.
Can you please add a version header into the script. So we don't have to download the script to see, if something has changed. Thanks
Thanks for the suggestion. I have added the version number to the page.
Thanks Dan, would it be possible to also add it to the script header itself? Just a comment like:
That way there is less confusion about which one we're running.
Thanks,
Michele
I have just added the version into the script itself.
[root@localhost ~]# rpm -qa |grep glibc
glibc-common-2.12-1.149.el6_6.4.x86_64
glibc-headers-2.12-1.149.el6_6.4.x86_64
glibc-devel-2.12-1.149.el6_6.4.x86_64
glibc-2.12-1.149.el6_6.4.x86_64
[root@localhost]# ./GHOST-test.sh
Vulnerable glibc version <= 2.17-54
Vulnerable glibc version <= 2.5-122
Vulnerable glibc version <= 2.12-1.148
Detected glibc version 2.12 revision 149
Not Vulnerable.
However we execute a C program from https://www.qualys.com/research/security-advisories/GHOST-CVE-2015-0235.txt
The output of this program is "vulnerable".
Is it ok to not really update?
It looks like you aren't getting the latest RPM. In my experience glibc--2.12-1.149.el6_6.4.x86_64, will not solve the problem. It must be glibc--2.12-1.149.el6_6.5.x86_64. (**** Notice the "el6_6.5" instead of "el6_6.4" ****)
Will Satellite 6 offer a more convenient way to list vulnerable systems in one go?
Does not work for RHEL 4 as the extended support rpms do not appear to have the CVE-2015-0235 tag in the change log
Greg, please ensure that you have glibc-2.3.4-2.57.el4.2. I just checked the built RPM and it does in fact have this in the changelog.
This APP is related with CVE-2015-0235, but I can't search this app by keyword "CVE-2015-0235".