PDA

View Full Version : آيا اين كد ميتونه خطر ساز باشه ؟



dezchilds
شنبه 11 دی 1389, 21:22 عصر
سلام من بوسيله اين كد با يه iframe نام كاربري كاربر رو ميگيرم(به وسيله session ) و تو ديتابيس جست و جو ميكنم و عكسشو بهش نشون ميدم حالا ميخواستم ببين اين كد خطري نداره ؟؟؟ مثلآ Sql injection يا چيز ديگه اي ؟؟؟


<?
include "includes/config.php"; $us = $_GET['us']; $co = $_GET['co'];
$link=mysql_connect($conf['db_hostname'],$conf['db_username'],$conf['db_password']);
mysql_select_db($conf['db_name'], $link ) or die ("Moshkel dar etesal be DB");
$res = mysql_query( "SELECT * FROM " . $conf['db_prefix'] . "members WHERE username='$us' ") or die ( mysql_error());
$arow = mysql_fetch_array($res);
$pi = $arow[picture];
$pi = get_media_path($arow[joindate],$arow[member_id]).'photo_'.$pi;
function get_media_path($str, $member_id){return substr($str, -1, 1).'/'. substr($str, -2, 1).'/'.substr($str, -3, 1).'/'.substr($str, -4, 1).'/'.$member_id.'/';}
if ($_GET['s'] == "frame")**?>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="Content-Language" content="fa"></head><body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0"><div style="position: absolute; width: 91px; height: 91px; z-index: 1; left: 15px; top: 15px"><a target="_blank" href="<? echo $conf['virtual_path'].$us ?>">
<img border="0px" src="<? echo $conf['virtual_path'] ?>media/uploads/<? echo $pi ?>" height="100%" width="100%"/></a></div>
<a target="_blank" href="<? echo $conf['virtual_path'].$us ?>"><img border="0px" src="<? echo $conf['virtual_path'] ?>media/me_in_lilik/<? echo $co ?>.jpg"/></a><? echo $stat ?></body>
<? }else{ ?>
document.write('<center><iframe width="120" height="200" src="<? echo $conf['virtual_path']."code.php?s=frame&co=$co&pic=$pi&us=$us" ?>" scrolling="no" border="0" frameborder="0"></iframe></center><div style="display:none"></div>');
<? } ?>


ميخواستم ببينم تهديدي ايجاد نميكنه ؟؟؟ مثلآ باهاش نميتونن sql injection كنن ؟ چون كسي كه اين كد رو واسم نوشته شديدآ به خونم تشنه است !!! خودمم زياد php سرم نميشه لطفآ دوستان راهنمايي كنند