<?php require_once('Connections/admin.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_admin, $admin);
$query_Recordset1 = "SELECT * FROM haber";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $admin) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
mysql_select_db($database_admin, $admin);
$query_Recordset2 = "SELECT defterno FROM defter";
$Recordset2 = mysql_query($query_Recordset2, $admin) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/index.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<?php $baskin= "Baskindan Selamlar"; ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Ya Sensizlik Başıma Musallat Olursa?</title>
<!-- InstanceEndEditable -->
<style type="text/css">
<!--
body {
background-color: #000;
}
.altkisim {
font-family: Verdana, Geneva, sans-serif;
font-weight: bold;
text-align: center;
}
.altustorta {
border: medium solid #333;
text-align: center;
}
-->
</style>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<script src="SpryAssets/SpryEffects.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
function MM_effectShake(targetElement)
{
Spry.Effect.DoShake(targetElement);
}
//-->
</script>
<!-- InstanceBeginEditable name="head" -->
<style type="text/css">
<!--
.baslikmesaj {
font-weight: bold;
font-family: Verdana, Geneva, sans-serif;
color: #FFF;
text-decoration: none;
font-size: 16px;
font-style: normal;
font-variant: normal;
text-transform: none;
}
.kenarlik {
border: medium dashed #333;
}
.baskin {
border: thin dotted #000;
font-weight: bold;
}
.bebegim {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 14px;
font-style: normal;
text-decoration: none;
font-weight: bold;
color: #000;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_effectAppearFade(targetElement, duration, from, to, toggle)
{
Spry.Effect.DoFade(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
}
//-->
</script>
<!-- InstanceEndEditable -->
<style type="text/css">
<!--
a:link {
color: #FFF;
text-decoration: none;
}
a:visited {
color: #FFF;
text-decoration: none;
}
a:hover {
color: #999;
text-decoration: none;
}
a:active {
color: #999;
text-decoration: none;
}
-->
</style></head>
<body>
<blockquote> </blockquote>
<table width="812" border="0" align="center" class="altustorta">
<tr>
<td width="798" height="202" bgcolor="#8C6CAF"><img src="cemg.jpg" width="791" height="200" onclick="MM_effectShake(this)" /></td>
</tr>
<tr>
<td bgcolor="#333333"><ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="index.php">Ana Sayfa</a></li>
<li><a href="#" class="MenuBarItemSubmenu">Bizden</a>
<ul>
<li><a href="videolar.php">Videolar</a></li>
<li><a href="zoneler.php">Zoneler</a></li>
<li><a href="resimler.php">Resimler</a></li>
</ul>
</li>
<li><a href="defter.php">Hatira Defteri</a> </li>
<li><a href="dostlar.php">Dostlar</a></li>
</ul></td>
</tr>
<tr>
<td bgcolor="#CCCCCC"><!-- InstanceBeginEditable name="orta" -->
<?php do { ?>
<table width="692" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="4" background="ust.gif" class="baslikmesaj"><img src="arrow-follow.gif" width="11" height="11" />Mesaj:<a href="detaylar.php?haberid=<?php echo $row_Recordset1['haberid']; ?>"><?php echo $row_Recordset1['baslik']; ?></a></td>
</tr>
<tr>
<td width="163" rowspan="2" bgcolor="#666666" onclick="MM_effectAppearFade(this, 1000, 100, 0, false)"><?php echo $row_Recordset1['haberresmi']; ?></td>
<td width="13" background="sss.gif"><p class="baslikmesaj"> </p>
<p class="baslikmesaj"> </p></td>
<td width="507" bgcolor="#666666"><span class="bebegim"><?php echo $row_Recordset1['haberkonu']; ?></span><a href="detaylar.php?haberid=<?php echo $row_Recordset1['haberid']; ?>"><a href="index.php"></a></td>
<td width="9" background="sss.gif"> </td>
</tr>
<tr>
<td colspan="3" background="backtotop.gif"> </td>
</tr>
</table>
<p><a href="index.php"><img src="yenile.JPG" alt="Yenile" width="23" height="20" border="0" align="top" class="kenarlik" /></a><a href="detaylar.php?haberid=<?php echo $row_Recordset1['haberid']; ?>"><img src="numberone.gif" alt="Devami" width="23" height="20" align="top" class="kenarlik" /></a></p>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="alt" -->
<center> <table width="549" border="0" cellpadding="1" cellspacing="1" class="baskin">
<tr>
<td width="247" height="21" bgcolor="#999999"><strong>Security Shield.</strong></td>
<td width="288" bgcolor="#7A756B">Online.</td>
</tr>
<tr>
<td height="21" bgcolor="#999999"><strong>Your İp Number Saving to System.</strong></td>
<td bgcolor="#7A756B"><strong>[<?php echo $_SERVER['REMOTE_ADDR']; ?>] </strong></td>
</tr>
<tr>
<td height="21" bgcolor="#999999">Toplam Duyuru:</td>
<td bgcolor="#7A756B"><?php echo $totalRows_Recordset1 ?></td>
</tr>
<tr>
<td height="21" bgcolor="#999999">Toplam GB Yazan:</td>
<td bgcolor="#7A756B"><?php echo $totalRows_Recordset2 ?></td>
</tr>
</table></center>
<p><strong><img src="kalkan.png" width="62" height="40" alt="Güvenlik Kalkani" /></strong>
<table border="0">
<tr>
<td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>">First</a>
<?php } // Show if not first page ?></td>
<td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>">Previous</a>
<?php } // Show if not first page ?></td>
<td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>">Next</a>
<?php } // Show if not last page ?></td>
<td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>">Last</a>
<?php } // Show if not last page ?></td>
</tr>
</table>
</p>
<!-- InstanceEndEditable -->
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
<tr>
<td bgcolor="#8C6CAD" class="altkisim"><?php echo $baskin; ?></td>
</tr>
</table>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($Recordset1);
mysql_free_result($Recordset2);
?>merhaba arkadaşlar index.phpden sitem sql yiyiyor uptade edilebiliyor haber. acaba ne yapilmali kapatilmak için.. yardimci olabilirseniz sevinirim.
sql açigi
6
●708
- 26-07-2009, 16:26:09Eposta Aktivasyonu Gerekmekte
- 26-07-2009, 17:18:14giriş şifresi olucak
COOKIE ya da Session ile şifreyi admin diye kayıt ediceksin sonra eğer $_SESSION[admin] sifreye eşit ya da boyle bir session yok ise login.php sayfasına yönelndireceksin eğer session admindeki şifre ile admin şifresi birbirleri ile uyuşuyorsa işlemi gerçekleştirecek
bu şekildeki bir dosyayı her sayfaya include ediceksin tamamdır. - 26-07-2009, 20:02:21sessionda o sayfanın istediğin kısmına girmesini engelleyebiliyorsun örneğin;cemcapan adlı üyeden alıntı: mesajı görüntüle
<?php session_start(); $kullanici = $_REQUEST["kullanici"]; $sifre = $_REQUEST["sifre"]; if ( ( $sifre==123456 ) && ($kullanici=="cemcapan" ) ) { session_register("cemcapan");// oturum açıldı echo "Giriş tamam Butun işlemleri burda yapabilirsin.<br>"; } else { echo "Kullanıcı adı veya şifre hatalı"; } ?>Bu şekilde oturumu dogruladıkdan sonra diğer sayfalarda en üste bunu:
<?php session_start(); if(session_is_registered ("cemcapan")){ ?>burdada sayfanın içeriği...
en altada bunu:
<? } ?>
eklediğin sürece kimse bişey yapamaz... yalnız oturumları kullandıgın hersayfada ilk satıra <?php session_start(); ?> bunu yazmalısın...
Veya normal ziyaretçilere açık bir sayfada sadece senin görmen gerek bişey oldugunda sayfa en üstünde gene <?php session_start(); ?> yaptıkdan sonra istediğin yereif(session_is_registered ("cemcapan")){ echo "Yorumu yazanın Email: xxx@yy.com"; } ?>gene echo komutunun oldugu yerde isdeğin şeyi sadece sen görebilir veya yapabilirsin//
Phpde oturumu bir güvenlik kalkanı olarak düşünebilirsin session oturumu açmayan kişi senin istediğin herhangi biryeri göremez, dokunamaz, sql sorgulatamaz
pencereyi kapattıgında oturum kapanır - 26-07-2009, 23:18:54Ben Xss sql ve rfi açıkları için cbackın yaptığı bir dosyayı kullanıyorum onu config.php ye dahil ederek tüm sayfalarda çalışmasını sağlıyorum array la kodları alıyor mesela dediğin gibi
?id=1 den update fln oluyor diorsun şimdi sql de kolon sayısını almaları lzm onun için order by 1 vs gibi gidiorlar bu brzdan vereceğim dosyada 'order', 'by', 'union', update' gibi sql cümleciklerini ekleyerek sql xssyi engellersin rfiyide http:// ekleyerek veya www ekleyerekte rfiyi engelleyebilirsin lfi içinse ../ eklersen olur sanırım yada /etc/passwd gibi önemli dosyaları da browserden yazılarak görünmesini engelersin eğer işte dediğim gib .php?id=http://site/c99.txt? çalıştırsalar rfi den hata verecek engellenecek o sayfayada istediğini yazabilirsin .php?id=1+update veya .php?id=1+union gibi bişi yazınca da aynı olay hata çıkacak css yani xss de de aynı olay olack lfide de
Olay bu sanırım bende yeniyim phpde
ve kullandığım dosya ekte onu config gibi database bağlantısı olan bir dosyaya include edersen olay belli bir ölçüde tmmlanır ve bu dosyada phpbb için yapılmış ama her scripte olur include edin yeter 
ekleyemiyorum rapide upload edecem artık ordan indirirsin...
RapidShare: 1-CLICK Web hosting - Easy Filehosting
ve ordaki kat_adi ve makale_id yi kendine göre düzenle .php?id dediğine göre oralar id olacak birinide kullanabilirsin... kolay gelsin

