|
|
|
|
Menu |
|
|
Home |
| |
|
Discussions |
| |
|
Tools |
| |
|
Affiliates |
| |
|
Content |
| |
|
Info |
| | |
|
|
|
|
|
User Info |
|
Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144
People Online:
Visitors: 48
Members: 0
Total: 48
|
|
|
|
|
|
Full disclosure |
|
|
|
|
|
|
|
|
|
IT Security and Insecurity Portal |
|
|
Can i execute php code stored in a database? |
|
Posted: Fri Apr 20, 2007 3:47 pm |
|
|
Lord_Saigon |
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 |
|
|
|
|
Posted: Fri Apr 20, 2007 4:10 pm |
|
|
Chb |
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. |
|
|
|
|
Posted: Fri Apr 20, 2007 4:35 pm |
|
|
Lord_Saigon |
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 . |
|
|
|
|
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
|
|
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|
|
|
|
|