Glibc: GHOST Vulnerability Test To See If a Linux Sever Is Secure

The GHOST vulnerability is a critical vulnerability that affects the GNU C Library (glibc) versions prior to 2.18. To test if a Linux server is secure and not vulnerable to GHOST, you can use the following command:

env 'x=() { :;}; echo vulnerable' 'BASH_FUNC_x()=() { :;}; echo vulnerable' bash -c 'echo hello'

If the output of the command contains the string “vulnerable”, the system is vulnerable to GHOST. If the output is just “hello”, the system is not vulnerable.

It is recommended to upgrade the glibc package to a version later than 2.18 to fix the GHOST vulnerability. The exact steps for upgrading glibc may vary depending on your Linux distribution and the package management system used. Consult the documentation for your specific distribution for more information.

Leave a Comment