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

People Online:
Visitors: 612
Members: 0
Total: 612
PacketStorm News
·301 Moved Permanently

read more...
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> Newbies corner -> Can i execute php code stored in a database?
Post new topic  Reply to topic View previous topic :: View next topic 
Can i execute php code stored in a database?
PostPosted: Fri Apr 20, 2007 3:47 pm Reply with quote
Lord_Saigon
Beginner
Beginner
 
Joined: Apr 19, 2007
Posts: 2




Hi here.

How can i execute php code stored in a database?

I have a script like this on a webserver :

<?php
$dbConn = mysql_connect("localhost", "user", "pass");
mysql_select_db("db_name", $dbConn);

$sqlQuery = "SELECT * FROM test_table ORDER BY id";
$qResult = mysql_query($sqlQuery, $dbConn);

while( $Stored = mysql_fetch_array($qResult, MYSQL_ASSOC) ){
print($Stored["code"]);
}

?>

The "code" field has been filled with php code like that :

<?php echo("<b>It's a test</b>"); ?>

This code above does make a simple blank page...

My question is : there is an exploit to do something like that?

Thanks
View user's profile Send private message
PostPosted: Fri Apr 20, 2007 4:10 pm Reply with quote
Chb
Valuable expert
Valuable expert
 
Joined: Jul 23, 2005
Posts: 206
Location: Germany




You could eval() the stuff (executes PHP-commands at the runtime). Do not ask how, just take a look at the PHP documentation.

_________________
www.der-chb.de
View user's profile Send private message Visit poster's website ICQ Number
PostPosted: Fri Apr 20, 2007 4:35 pm Reply with quote
Lord_Saigon
Beginner
Beginner
 
Joined: Apr 19, 2007
Posts: 2




Chb wrote:
You could eval() the stuff (executes PHP-commands at the runtime). Do not ask how, just take a look at the PHP documentation.


Thank you Cool.
View user's profile Send private message
Can i execute php code stored in a database?
  www.waraxe.us Forum Index -> Newbies corner
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






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