Waraxe IT Security Portal
Login or Register
October 15, 2026
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: 960
Members: 0
Total: 960
Full disclosure
[0day-rubbish] StreamSets Transformer 3.17.0 auth-mode none fallback and un-sandboxed ScalaDTransform execution to container root (8.1 primary)
[0day-rubbish] RCDevs WebADM 2.4.14 authenticated log viewer sid command injection to webadm uid 999 code execution (7.2)
[0day-rubbish] Maian Cart 3.8 addBanners unrestricted banner upload to PHP webshell and administrator command execution (7.2 primary, PR:H)
[0day-rubbish] IPConfigure Orchid VMS 26.3.0 authenticated DNF repository GPG-key property command injection to root (7.2)
[0day-rubbish] Circutor LineEds 24.11.14-r0 unauthenticated pwrstudio events.xml shellExecute command injection (9.8)
[0day-rubbish] Asustor ADM 3.5.9.RWM1 (AS602T) music.cgi act=live stored-filename command injection reaching system() (8.8 primary, PR:L)
[0day-rubbish] Advantech WebAccess Node 9.2.3 unauthenticated CrystalRpt.aspx file upload and path traversal to code execution in w3wp.exe (9.8)
SEC Consult Research 20261001 :: Arbitrary Email sender spoofing in Apple iCloud mail
SEC Consult SA-20260924-0 :: Multiple Vulnerabilities in Paessler PRTG Network Monitor #CVE-2026-4637 #CVE-2026-4638
[NotCVE-2026-0019] game-music-emu through 0.6.5 VGM Command Interpreter Missing Operand Length Check Allows Heap Out-of-Bounds Read
[NotCVE-2026-0018] game-music-emu (libgme) through 0.6.5 Unbounded GYM Command Loop Allows Heap Out-of-Bounds Read
[NotCVE-2026-0017] game-music-emu (libgme) 0.6.5 and Earlier AY Loader NULL Pointer Dereference Allows Denial of Service
[NotCVE-2026-0016] game-music-emu VGM Command Interpreter Unvalidated 0xE0 PCM Seek Offset Allows Out-of-Bounds Read and Denial of Service
APPLE-SA-09-28-2026-3 macOS Sequoia 15.8.1
APPLE-SA-09-28-2026-2 macOS Tahoe 26.7.1
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> Sql injection -> Injectable?
Post new topicReply to topic View previous topic :: View next topic
Injectable?
PostPosted: Fri Jan 13, 2006 7:25 am Reply with quote
e-rased
Beginner
Beginner
Joined: Jan 13, 2006
Posts: 2




There's a popular mod-addon out for IBStore(Invision Power Board mod) called Transactions Mod...I looked the source over and some of the sql query values aren't checked or sanitized...Can anyone look it over and tell me what you could do with it? I imagine union would be of use but I'm new to exploits...

Code:

<?php



$idx = new trans;

class trans
{
var $output = "";
var $page_title = "";
var $nav = array();
var $html = "";


function trans()
{
global $ibforums, $forums, $DB, $std, $print, $skin_universal;

$ibforums->lang = $std->load_words($ibforums->lang, 'lang_trans', $ibforums->lang_id );
$this->html = $std->load_template('skin_trans');
$this->base_url = $ibforums->base_url;


//// $this->output = $this->html->test();


////Here we build the transactions page.
////right here i'm checking to see if the $_GET[] vars are defined. if they aren't, i define them.

if ( ! isset( $ibforums->input['method'] ) )
{
$ibforums->input['method'] = "global";
$method = "global";
}
else
{
$method = $ibforums->input['method'];
}

if ( ! isset( $ibforums->input['current'] ) )
{
$ibforums->input['current'] = "0";
$current = 0;
}
else
{
$current = $ibforums->input['current'];
}
///We're done checking our get vars.
///Here i'm going to switch() on the case of $method

switch($method){

case "global";
$sql_count = "SELECT * from ipb_store_logs";

////get the number of rows
$total_rows = mysql_num_rows($therows= mysql_query($sql_count));

////get the total amount of pages, round up
$totalpages = floor($total_rows/50);

////total items
$totalled_items = $totalpages * 50;
////the current page number
$curpage = ceil(($current) / 50);


$the_tmp .= "<br />";
$the_tmp .= "<form action=\"index.php?act=trans&method=search\" method=\"GET\">Search for a user's transactions:
<input type=\"hidden\" value=\"trans\" name=\"act\">
<input type=\"hidden\" value=\"search\" name=\"method\">
<input type=\"text\" name=\"user\" value=\"$user\"><input type=\"submit\" value=\"Search\"></form>";
$the_tmp .= "<center>";
$the_tmp .= "<br />";


///Before pages
$thetmpshow = $curpage + 1;
$the_tmp .= "<b>Current: $thetmpshow</b><br />";
$the_tmp .= "<a href=\"index.php?act=trans&current=0\"><<[</a> ";
$page_min = $curpage - 11;
if($page_min<0){
$page_min = 0;
$page_num = 1;
}
elseif($page_min>0){
$page_min = $page_min - 1;
if($page_min==0){
$page_num = 1;
}
else{
$page_num = $page_min+1;
}
}
$itmp = ($page_min*50);

while($itmp<($curpage*50) AND $page_num>$page_min) {
$the_tmp .= "<a href=\"index.php?act=trans&current=$itmp\"> $page_num</a> ";
$itmp = $itmp + 50;
$page_num = $page_num + 1;
}

$the_tmp .= "<b>$thetmpshow</b> ";

///after pages

$page_max = $curpage + 11;

if($page_max>$totalpages){
$page_max = $totalpages;
}
$page_num = $curpage + 1;
$items_max = $pages_max * 50;
$itmp = $page_num * 50;
if($curpage<$totalpages){
while($page_num < $page_max) {
$page_num = $page_num + 1;
$the_tmp .= "<a href=\"index.php?act=trans&current=$itmp\">$page_num</a> ";
$itmp = $itmp + 50;
}
}
$the_tmp .= "<a href=\"check.php?current=$totalled_items\">]>></a>";
$the_tmp .= "</center>";

$the_tmp .= "<br />";


$query = "SELECT * FROM ipb_store_logs ORDER by lid DESC LIMIT $current, 50";

$pigfuck = mysql_query($query);



$the_tmp .= "<br><br>";

$the_tmp .= "<div align=\"right\"></div>";
$the_tmp .= "<table border=\"1\" width=\"100%\" Cellpaddinng=\"2\">";
$the_tmp .= "<th width=\"5%\" nowrap>ID</th>";
$the_tmp .= "<th width=\"50%\" nowrap>Message</th>";
$the_tmp .= "<th width=\"10%\" nowrap>Username</th>";
$the_tmp .= "<th width=\"10%\" nowrap>Action</th>";
$the_tmp .= "<th width=\"25%\">Time</th>";


while($query_data = mysql_fetch_array($pigfuck)) {
$lid = $query_data["lid"];
$lmessage = $query_data["lmessage"];
$luserid = $query_data["luserid"];
$ltype = $query_data["ltype"];
$ltime = $query_data["ltime"];


$midgettoss = date('r',$ltime);
$midgettoss = str_replace(',','',$midgettoss);
$midgettoss = explode("-", $midgettoss);


if($ltype == "donate_m"){
$ltype = "Donated";
}

if($ltype == "bought_item"){
$ltype = "Purchase";
}

if($ltype == "titleeffect"){
$ltype = "Title";
}

//Edit

$dirt = "SELECT name FROM ipb_members WHERE id = '$luserid'";

$whore = mysql_query($dirt);

$try = mysql_fetch_array($whore);
$tip = $try["name"];
if($tip==""){
$tip = "Unkown user?!";
}


$the_tmp .= "<TR>\n";
$the_tmp .= "<TD width=\"5%\" align=\"center\">$lid</td>\n";
$the_tmp .= "<TD width=\"50%\" align=\"center\">$lmessage</td>\n";
$the_tmp .="<TD width=\"10%\" align=\"center\"><a href=\"index.php?showuser=$luserid\">$tip</a></td>\n";
$the_tmp .= "<TD width=\"10%\" align=\"center\">$ltype</td>\n";
$the_tmp .= "<TD width=\"25%\" align=\"center\">$midgettoss[0]</td>\n";
$the_tmp .= "</tr>\n";
}
$the_tmp .= "</table>";


$the_tmp .= "<br /> <br />";
$the_tmp .= "<center>";
$the_tmp .="<a href=\"index.php?act=trans&current=0\"><<[</a> ";
///Before pages

$page_min = $curpage - 11;
if($page_min<0){
$page_min = 0;
$page_num = 1;
}
elseif($page_min>0){
$page_min = $page_min - 1;
if($page_min==0){
$page_num = 1;
}
else{
$page_num = $page_min + 1;
}
}
$itmp = ($page_min*50);

while($itmp<($curpage*50) AND $page_num>$page_min) {
$the_tmp .= "<a href=\"index.php?act=trans&current=$itmp\"> $page_num</a> ";
$itmp = $itmp + 50;
$page_num = $page_num + 1;
}

$the_tmp .= "<b>$thetmpshow</b> ";

///after pages

$page_max = $curpage + 11;

if($page_max>$totalpages){
$page_max = $totalpages;
}
$page_num = $curpage + 1;
$items_max = $pages_max * 50;
$itmp = $page_num * 50;
if($curpage<$totalpages){
while($page_num < $page_max) {
$page_num = $page_num + 1;
$the_tmp .= "<a href=\"index.php?act=trans&current=$itmp\">$page_num</a> ";
$itmp = $itmp + 50;
}
}

$the_tmp .= "<a href=\"check.php?current=$totalled_items\">]>></a>";

$the_tmp .= "</center>";
break;
/////YAY !!!!1!~1`1!1 We're done with the global case!

default:
}
echo "</center>";
$this->output = $the_tmp;
$print->add_output("$this->output");
$print->do_output( array( 'TITLE' => $ibforums->lang['page_title'], 'JS' => 0, NAV => array( $ibforums->lang['page_title'] ) ) );
}
}
?>


$current is never checked, and it directly queries the database without any 'sanitisation'...any ideas?
View user's profile Send private message
PostPosted: Sat Jan 14, 2006 1:53 pm Reply with quote
Pi3cH
Regular user
Regular user
Joined: Dec 15, 2005
Posts: 7




could give me live example?

the $curpage limited at this line of code:
$curpage = ceil(($current) / 50);
View user's profile Send private message
PostPosted: Sat Jan 14, 2006 8:33 pm Reply with quote
e-rased
Beginner
Beginner
Joined: Jan 13, 2006
Posts: 2




$query = "SELECT * FROM ipb_store_logs ORDER by lid DESC LIMIT $current, 50";

$curpage is just a var for rendering the before/after links...current isn't touched
View user's profile Send private message
PostPosted: Tue Jan 17, 2006 2:24 pm Reply with quote
Pi3cH
Regular user
Regular user
Joined: Dec 15, 2005
Posts: 7




oh! i dont see the left part of =,

could you give live example?
View user's profile Send private message
Injectable?
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



PCWizardHub - Helping you fix, build, and optimize your PC life
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.030 Seconds