Jump to content
Nytro

Wordpress Pingback GHOST vector

Recommended Posts

Posted

GHOST gethostbyname() heap overflow in glibc (CVE-2015-0235)

A heap-based buffer overflow vulnerability in glibc (CVE-2015-0235) was announced this week.

6a00e551318e8a883301b8d0cb285d970c-800wi

It seems as though all new vulnerabilities need to have catchy marketing names so this one was dubbed "GHOST" which was derived from the vulnerable glibc function name - "GetHOSTbyname()".

Vulnerability Notes

Here are the key points thus far:

  • The vulnerability affects all versions of glibc from glibc-2.17 and lower
  • The bug was patched in glibc-2.18 in May 2013, but was not marked as a security bug so the fix did not make it into many common Linux distributions like RedHat and Ubuntu.
  • To our knowledge, this is not currently being exploited in the wild
  • Qualys has not released any PoC code but they plan to release a Metasploit module in the near future.
  • Qualys was able to remotely exploit a mail server running Exim mail software but it’s unclear what other software might be vulnerable. (They are working on a metapsloit module specifically for the Exim exploit)

Regarding other Linux server software Qualys wrote:

"to the best of our knowledge, the buffer overflow cannot be triggered in any of [these]:

apache, cups, dovecot, gnupg, isc-dhcp, lighttpd, mariadb/mysql,

nfs-utils, nginx, nodejs, openldap, openssh, postfix, proftpd,

pure-ftpd, rsyslog, samba, sendmail, sysklogd, syslog-ng, tcp_wrappers,

vsftpd, xinetd."

Wordpress XML-RPC Pingback Vector

It has been speculated that the XML-RPC pingback functionality in Wordpress installs may be vulnerable to remote exploitation. We decided to run some tests to see if it is in fact vulnerable. We previously did a blog post outlining how the Wordpress XML-RPC "pingback" functionality could be abused by attackers to force unsuspecting websites into participating in DDoS attacks. To summarize, in that attack, the attacker sends an XML request to the "/xmlrpc.php" script:

6a00e551318e8a883301b7c741a0af970b-800wi

The YELLOW highlighted data is a WordPress "Patsy Proxy" site while the ORANGE highlighted data is the DDoS target/victim website. In this scenario, the XML-RPC "pingback" code in PHP is using the gethostbyname() function call on the ORANGE highlighted data so that it can resolve it to an IP address for the remote request it will send. This is the exploit vector we chose to focus on for GHOST testing.

Modifying Input for GHOST Vulnerability Testing

Instead of sending a normal sized URL in the XML pingback.ping method body, we need to send a large one. Here is a Ruby PoC script:

6a0133f264aa62970b01b7c741bad8970b-800wi

The script takes command line arguments for the size of payload that you want to send. During our testing in SpiderLabs Research, we identified different size ranges that worked on different platform/versions of glibc, php and wordpress. After sending the attack payload, we have seen the HTTP process responds with the following:

  • 500 HTTP Response Status code with php-cgi
  • No HTTP Response with mod_php

There are errors in the Apache error_log file when the process crashes:

6a0133f264aa62970b01bb07e57b56970d-800wi

This PoC allows users to remotely verify if a target web server is vulnerable to the CVE however it does not demonstrate exploitability. Here is the glibc and php version information for the two systems we used during this test:

6a0133f264aa62970b01bb07e57bad970d-800wi

6a0133f264aa62970b01b8d0cb52a8970c-800wi

Recommendations

Install glibc Patches

Example for Ubuntu Linux Distributions:

sudo apt-get clean

sudo apt-get update

sudo apt-get upgrade

And don't forget to reboot!

Disable XML-RPC

It is possible to disable the XML-RPC process altogether if you do not want to use it. There are even plugins that will disable it.

Disable Pingback Requests

You may also disable the pingback feature by adding the following to your functions.php file:

6a00e551318e8a883301a73d8e3909970d-800wi

WAF Protections

By using a WAF, you can identify initial pingback XML requests on your Wordpress site and look for attacks. The Trustwave WAF has a profiling and learning engine called "Adaption" that is able to identify these types of anomalies vs. normal user traffic. We have also added rules to our commercial SpiderLabs ModSecurity rules package to identify this specific PoC attack vector.

Monitor Your Logs

When attackers are attempting to exploit this vulnerability against your web servers, there will most likely be error messages (segmentation faults, etc...) that will indicate a problem. Organizations should be vigilant in monitoring their logs and following up on an anomalous errors.

Acknowledgments

I would like to thank my fellow SpiderLabs Research colleagues who helped with testing and the content of this blog post:

  • Robert Rowley
  • Christophe De La Fuente
  • Chaim Sanders
  • Felipe Costa
  • Jonathan Claudius
  • Karl Sigler

Posted by Ryan Barnett on 29 January 2015

Sursa: http://blog.spiderlabs.com/2015/01/ghost-gethostbyname-heap-overflow-in-glibc-cve-2015-0235.html

Posted

Deocamdata nu e asa periculos, inca asteapta toti sa vada acel shell code sau whatever, pentru ca gethostbyname nu accepta orice caractere, e destul de greu sa o exploatezi doar cu cifre si puncte for fun and profit... dar daca zic ei ca au reusit, nu mi-am spart capul sa imi dau seama ce au facut.

(sau ma rog, poate au facut deja public ca n-am avut timp sa mai investighez, a trebuit sa patchuiesc manual pe la prieteni glibc-uri vechi:))

Posted

Cei de la Qualys au zis ca au reusit remote shell via email. La cate nebunii am vazut la viata mea, de aceea nici nu m-am chinuit sa vad ce si cum, ca o sa apara mai devreme sau mai tarziu... Probabil s-au legat cumva de 0xfffffful ala

Pai patch manual sursa in nss, recompilare ce sa ii faci... exista tot servere vechi cu tot felul de distrouri si aplicatii critice care nu pot fi migrate, nu poti sa upgrade ca iti crapa dependintele si tot asa...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...