未分類 分類的彙整

WordPress 2.7.0 admin remote code execution vulnerability

by Ryat[puretot]
mail: puretot at gmail dot com
team: http://www.80vul.com
date: 2008-12-18

一分析:
這個漏洞出在後台:wp-admin/post.php

  1. if ( current_user_can('edit_post', $post_ID) ) {
  2.         if ( $last = wp_check_post_lock( $post->ID ) ) {
  3.             $last_user = get_userdata( $last );
  4.             $last_user_name = $last_user ? $last_user->display_name : __('Somebody');
  5.             $message = sprintf( __( 'Warning: %s is currently editing this post' ), wp_specialchars( $last_user_name ) );
  6.             $message = str_replace( "'", "\'", "<div class='error'><p>$message</p></div>" );
  7.             //提交\'經過此處代碼處理後變為\\' :)
  8.             add_action('admin_notices', create_function( '', "echo '$message';" ) );
  9.             //利用上面的方法閉合echo後面的單引號,就可以執行命令了[ex:\';phpinfo();\'];另外這個地方也可以利用create_function函數自身的一個bug[1]來執行命令[ex:\';}phpinfo();//]
  10.         } else {
  11.             wp_set_post_lock( $post->ID );
  12.             wp_enqueue_script('autosave');
  13.         }
  14.     }

繼續閱讀 ‘WordPress 2.7.0 admin remote code execution vulnerability’