Smooth Hotel
Member
- Jan 21, 2012
- 55
- 2
Download the attachment and just replace your news2.php with it.Hmpf, tried that, stil got the error.
P.S. got a screenie here:
Download the attachment and just replace your news2.php with it.Hmpf, tried that, stil got the error.
P.S. got a screenie here:
Read the whole topic. The developer of the CMS posted that if you use that, it would be exploitable, so he posted a query which fixed the exploits.Download the attachment and just replace your news2.php with it.
Incorrect integer value: 'Vineen' for column 'author' at row 1
<?php
namespace Revolution;
if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); }
class js implements iJS
{
private $js;
final public function get()
{
global $_CONFIG;
foreach (glob("app/tpl/skins/".$_CONFIG['template']['style']."/js/*.js") as $filename)
{
$this->js = '<script src="'.$filename.'" type="text/javascript"></script>';
$this->setJS();
}
}
final public function getHK()
{
global $_CONFIG;
foreach (glob("app/tpl/skins/".$_CONFIG['template']['style']."/hk/js/*.js") as $filename)
{
$this->js = '<script src="'.$filename.'" type="text/javascript"></script>';
$this->setJS();
}
}
final public function setJS()
{
global $template;
$template->tpl .= $this->js;
unset($this->js);
}
}
?>
<link rel="stylesheet" href="{url}/app/tpl/skins/{skin}/hk/styles/global.css" type="text/css">
<div id="main">
<div id="links"></div>
<div id="header"><img src="{url}/app/tpl/skins/{skin}/images/logo.png" align=right style="margin-right: 480px; margin-top: 5px;">
<div id="logo">
<div id="logo_text">
<!-- class="logo_colour", allows you to change the color of the logo text -->
<h1>{hotelname} Housekeeping -- Welcome {username}</h1>
</div>
</div>
</div>
<div id="site_content">
<div id="sidebar_container">
<!-- insert your sidebar items here -->
<div class="sidebar">
<div class="sidebar_top"></div>
<div class="sidebar_item">
<br />
[ <a href='dash'>Return to Dashboard</a> ] [ <a href='logout'>Log out</a> ]<br /> <br />
<p>
<?php if(mysql_result(mysql_query("SELECT rank FROM users WHERE id = '" . $_SESSION['user']['id'] . "'"), 0) >= 5)
{ ?>
Player Management <br /> <img src='../app/tpl/skins/<?php echo $_CONFIG['template']['style']; ?>/hk/images/line.png'> <br />
» <a href='vip'>Give a user Regular VIP</a> <br />
» <a href='svip'>Give a user Super VIP</a> <br />
» <a href='edit'>Edit a users account</a> <br />
<br />
Administration <br /> <img src='../app/tpl/skins/<?php echo $_CONFIG['template']['style']; ?>/hk/images/line.png'> <br />
» <a href='news'>Post news article</a><br />
» <a href='delnews'>Delete a news article (By ID)</a><br />
» <a href='cmdlogs'>Command logs</a><br />» <a href='motd'>Change welcome message</a><br />» <a href='empty'>Empty a table</a><br />» <a href='timer'>Change the Credits & Pixels timer</a><br />
<br />
<?php } if(mysql_result(mysql_query("SELECT rank FROM users WHERE id = '" . $_SESSION['user']['id'] . "'"), 0) >= 5) { ?>
Moderation <br /> <img src='../app/tpl/skins/<?php echo $_CONFIG['template']['style']; ?>/hk/images/line.png'> <br />
» <a href='banlist'>Ban List</a> <br />
» <a href='ip'>IP lookup</a> <br />
<br />
Badges <br /> <img src='../app/tpl/skins/<?php echo $_CONFIG['template']['style']; ?>/hk/images/line.png'> <br />
» <a href='listbadge'>List badges</a><br />» <a href='addbadge'>Add a badge</a><br />» <a href='delbadge'>Delete a badge</a><br />
<?php } ?>
<br />
Statistics<br />
<img src='../app/tpl/skins/<?php echo $_CONFIG['template']['style']; ?>/hk/images/line.png'> <br />
Server Status:
{status} <br />
{online} user(s) online <br />
</p>
</div>
<div class="sidebar_base"></div>
</div>
</div>
<div id="content_container">
<div id="content">
<!-- insert the page content here -->
<br />
<?php
if(!isset($_SESSION["longstory"]))
{
header("Location: ".$_CONFIG['hotel']['url']."/ase/news");
exit;
}
if(isset($_POST["proceed"]))
{
$topstory = mysql_real_escape_string($_POST["topstory"]);
$author = mysql_result(mysql_query("SELECT username FROM users WHERE id = '".$_SESSION['user']['id']."' LIMIT 1"), 0);
mysql_query("INSERT INTO cms_news (title,shortstory,longstory,published,image,author, campaign, campaignimg) VALUES ('" . $_SESSION["title"] . "', '" . $_SESSION["shortstory"] . "', '" . $_SESSION["longstory"] . "', '" . time() . "', '" . $topstory . "', '" . $author . "', 0, 'default')") or die(mysql_error());
unset($_SESSION["title"], $_SESSION["shortstory"], $_SESSION["longstory"]);
header("Location: ".$_CONFIG['hotel']['url']."/ase/");
exit;
}
echo '<center><b>You are writing news article <u>'.$_SESSION["title"].'.</u><br />';
echo 'It\'s time to choose the image for your story. Choose one from the drop down list and click "Check Image"';
echo '<form method="post">';
echo '<br />';
echo '<select name="topstory" id="topstory" style="font-size: 14px;"';
if ($handle = opendir('ts/'))
{
while (false !== ($file = readdir($handle)))
{
if ($file == '.' || $file == '..')
{
continue;
}
echo '<option value="' . $file . '"';
if (isset($_POST['topstory']) && $_POST['topstory'] == $file)
{
echo ' selected';
}
echo '>' . $file . '</option>';
}
}
echo '</select>';
if(isset($_POST["check"]))
{
echo '<br /> <br /> <input type="submit" value=" Check image " name="check" /> <br /><br />';
echo '<font size="3">Topstory image<br /></font><img src="ts/' . $_POST["topstory"] . '" align="right />';
echo '</center> <align="right"> <br /> <br /> <input type="submit" value=" Proceed (use image) " name="proceed" /> <br />';
echo '</form>';
}
else
{
echo '<br /> <br /> <input type="submit" value=" Check image " name="check" /> <br />';
echo "</form>";
}
?>
Code:<link rel="stylesheet" href="{url}/app/tpl/skins/{skin}/hk/styles/global.css" type="text/css"> <div id="main"> <div id="links"></div> <div id="header"><img src="{url}/app/tpl/skins/{skin}/images/logo.png" align=right style="margin-right: 480px; margin-top: 5px;"> <div id="logo"> <div id="logo_text"> <!-- class="logo_colour", allows you to change the color of the logo text --> <h1>{hotelname} Housekeeping -- Welcome {username}</h1> </div> </div> </div> <div id="site_content"> <div id="sidebar_container"> <!-- insert your sidebar items here --> <div class="sidebar"> <div class="sidebar_top"></div> <div class="sidebar_item"> <br /> [ <a href='dash'>Return to Dashboard</a> ] [ <a href='logout'>Log out</a> ]<br /> <br /> <p> <?php if(mysql_result(mysql_query("SELECT rank FROM users WHERE id = '" . $_SESSION['user']['id'] . "'"), 0) >= 5) { ?> Player Management <br /> <img src='../app/tpl/skins/<?php echo $_CONFIG['template']['style']; ?>/hk/images/line.png'> <br /> » <a href='vip'>Give a user Regular VIP</a> <br /> » <a href='svip'>Give a user Super VIP</a> <br /> » <a href='edit'>Edit a users account</a> <br /> <br /> Administration <br /> <img src='../app/tpl/skins/<?php echo $_CONFIG['template']['style']; ?>/hk/images/line.png'> <br /> » <a href='news'>Post news article</a><br /> » <a href='delnews'>Delete a news article (By ID)</a><br /> » <a href='cmdlogs'>Command logs</a><br />» <a href='motd'>Change welcome message</a><br />» <a href='empty'>Empty a table</a><br />» <a href='timer'>Change the Credits & Pixels timer</a><br /> <br /> <?php } if(mysql_result(mysql_query("SELECT rank FROM users WHERE id = '" . $_SESSION['user']['id'] . "'"), 0) >= 5) { ?> Moderation <br /> <img src='../app/tpl/skins/<?php echo $_CONFIG['template']['style']; ?>/hk/images/line.png'> <br /> » <a href='banlist'>Ban List</a> <br /> » <a href='ip'>IP lookup</a> <br /> <br /> Badges <br /> <img src='../app/tpl/skins/<?php echo $_CONFIG['template']['style']; ?>/hk/images/line.png'> <br /> » <a href='listbadge'>List badges</a><br />» <a href='addbadge'>Add a badge</a><br />» <a href='delbadge'>Delete a badge</a><br /> <?php } ?> <br /> Statistics<br /> <img src='../app/tpl/skins/<?php echo $_CONFIG['template']['style']; ?>/hk/images/line.png'> <br /> Server Status: {status} <br /> {online} user(s) online <br /> </p> </div> <div class="sidebar_base"></div> </div> </div> <div id="content_container"> <div id="content"> <!-- insert the page content here --> <br /> <?php if(!isset($_SESSION["longstory"])) { header("Location: ".$_CONFIG['hotel']['url']."/ase/news"); exit; } if(isset($_POST["proceed"])) { $topstory = mysql_real_escape_string($_POST["topstory"]); $author = mysql_result(mysql_query("SELECT username FROM users WHERE id = '".$_SESSION['user']['id']."' LIMIT 1"), 0); mysql_query("INSERT INTO cms_news (title,shortstory,longstory,published,image,author, campaign, campaignimg) VALUES ('" . $_SESSION["title"] . "', '" . $_SESSION["shortstory"] . "', '" . $_SESSION["longstory"] . "', '" . time() . "', '" . $topstory . "', '" . $author . "', 0, 'default')") or die(mysql_error()); unset($_SESSION["title"], $_SESSION["shortstory"], $_SESSION["longstory"]); header("Location: ".$_CONFIG['hotel']['url']."/ase/"); exit; } echo '<center><b>You are writing news article <u>'.$_SESSION["title"].'.</u><br />'; echo 'It\'s time to choose the image for your story. Choose one from the drop down list and click "Check Image"'; echo '<form method="post">'; echo '<br />'; echo '<select name="topstory" id="topstory" style="font-size: 14px;"'; if ($handle = opendir('ts/')) { while (false !== ($file = readdir($handle))) { if ($file == '.' || $file == '..') { continue; } echo '<option value="' . $file . '"'; if (isset($_POST['topstory']) && $_POST['topstory'] == $file) { echo ' selected'; } echo '>' . $file . '</option>'; } } echo '</select>'; if(isset($_POST["check"])) { echo '<br /> <br /> <input type="submit" value=" Check image " name="check" /> <br /><br />'; echo '<font size="3">Topstory image<br /></font><img src="ts/' . $_POST["topstory"] . '" align="right />'; echo '</center> <align="right"> <br /> <br /> <input type="submit" value=" Proceed (use image) " name="proceed" /> <br />'; echo '</form>'; } else { echo '<br /> <br /> <input type="submit" value=" Check image " name="check" /> <br />'; echo "</form>"; } ?>
This is the news2.php forYou must be registered for see links. The fix was coded byYou must be registered for see linksand this news2.php is for Grapefruit ASE, so you need to edit certain things there. I have copy-pasted the full file as it seems I cannot find where the original 66th line content was. I asked Muffins to make one secured patch for it and if any PHP coder out there, feel free to inspect if this is not vulnerable.
Many thanks,
Vineen
Yes. However, why wouldIt wouldn't be pretty vulnerable anyways, because you have to login to the ase to view the page..