المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : طريقة جديدة لحماية المنتدى


faris_3mash
03-04-2008, 08:11 PM
أخواني اليوم جايبلكم طريقة جديدة لا أعلم اذا كنتم تعرفها من قبل
طريقة الحماية تكون بعمل جدار ناري صغير بلغة ال php يعمل على صد أي انسان يحاول دخول الادارة حتى يوضع الباسورد ( أكيد يختلف عن باسورد المدير الأصلي ) يعني يصير في باسوردين للحماية واحدد للجدار الناري و الثاني لمدير المنتدى

عذرا على الاطالة هذا هو الشرح

أولا افتح ملف فارغ ببرنامج notepad و ض فيه الكود التالي ثم احفظ العمل باسم jedar.php

<?php
header("Content-type: text/html; charset=1256");
?>
<?
/**************************
* txtAuth v1.0 *
* ©2004 - Thomas Love *
* http://txtbox.co.za
* تعريب الجرافكس العربي www.o500o.com
**************************/


// Default config options.
// Override these by pasting them in the form $tacfg['....'] above the require() code in the actual
// page to be protected.

// Username and password
$tacfgd['uname'] = 'user';
$tacfgd['pword'] = 'pass';

// Title of page.
$tacfgd['title'] = 'تسجيـــــل الدخــــــول';

// Text to appear just above login form.
$tacfgd['helptext'] = 'أدخل اسم المستخدم والرقم السري';


// Set to true to enable the optional remember-me feature, which stores encrypted login details to
// allow users to be logged-in automatically on their return. Turn off for a little extra security.
$tacfgd['allowrm'] = true;

// If you have multiple protected pages, and there's more than one username / password combination,
// you need to group each combination under a distinct rmgroup so that the remember-me feature
// knows which login details to use.
$tacfgd['rmgroup'] = 'default';

// Set to true if you use your own sessions within your protected page, to stop txtAuth interfering.
// In this case, you _must_ call session_start() before you require() txtAuth. Logging out will not
// destroy the session, so that is left up to you.
$tacfgd['ownsessions'] = false;




foreach ($tacfgd as $key => $val) {
if (!isset($tacfg[$key])) $tacfg[$key] = $val;
}

if (!$tacfg['ownsessions']) {
session_name('txtauth');
session_start();
}

// Logout attempt made. Deletes any remember-me ****** as well
if (isset($_GET['txtlogout']) || isset($_POST['txtlogout'])) {
set******('txtauth_'.$rmgroup, '', time()-86400*14);
if (!$tacfg['ownsessions']) {
$_SESSION = array();
session_destroy();
}
else $_SESSION['txtauthin'] = false;
}
// Login attempt made
elseif (isset($_POST['login'])) {
if ($_POST['uname'] == $tacfg['uname'] && $_POST['pword'] == $tacfg['pword']) {
$_SESSION['txtauthin'] = true;
if ($_POST['rm']) {
// Set remember-me ****** for 2 weeks
set******('txtauth_'.$rmgroup, md5($tacfg['uname'].$tacfg['pword']), time()+86400*14);
}
}
else $err = 'خطا" أسم المستخدم او كلمة المرور غير صحيحة';
}
// Remember-me ****** exists
elseif (isset($_******['txtauth_'.$rmgroup])) {
if (md5($tacfg['uname'].$tacfg['pword']) == $_******['txtauth_'.$rmgroup] && $tacfg['allowrm']) {
$_SESSION['txtauthin'] = true;
}
else $err = 'Remember-me ****** disabled or invalid';
}
if (!$_SESSION['txtauthin']) {
?>
<html>
<head>
<title><?=$tacfg['title']?></title>
<style type="text/css">
body {
font-family: Arial, sans-serif;
font-size: 10pt;
}
td {
font-family: Arial, sans-serif;
font-size: 10pt;
}
.grey {
font-family: Arial, sans-serif;
font-size: 10pt;
color: #878787;
}
.txtbox {
font-family: Arial, sans-serif;
font-size: 10pt;
background-color: #ffffff;
border: #dedede 1px solid;
}
.smalltxt {
font-size: 8pt;
color: #cdcdcd;
}
.smalltxt A {
color: #cdcdcd;
}
</style>
</head>

<body>
<div style="font-size: 14pt;" align="center"><?=$tacfg['title']?></div>
<hr width="300" size="1" noshade color="#cdcdcd">
<p>
<div align="center" class="grey">
<?=$tacfg['helptext']?>
</div>
<p>
<?
if (isset($_SERVER['REQUEST_URI'])) $action = $_SERVER['REQUEST_URI'];
else $action = $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];
if (strpos($action, 'txtlogout=1', strpos($action, '?')) !== false) $action = str_replace('txtlogout=1', '', $action);
?>
<form name="txtauth" action="<?=$action?>" method="post">
<table border="0" cellpadding="4" cellspacing="0" bgcolor="#efefef" align="center" style="border: #dedede 3px double;">
<?=(isset($err))?'<tr><td colspan="2" align="center"><font color="red">'.$err.'</font></td></tr>':''?>
<?if (isset($tacfg['uname'])) {?>
<tr><td>أسم المستخدم:</td><td><input type="text" name="uname" value="" size="20" maxlength="100" class="txtbox"></td></tr>
<?}?>
<tr><td>كلمة المرور:</td><td><input type="password" name="pword" value="" size="20" maxlength="100" class="txtbox"></td></tr>
<?if ($tacfg['allowrm']) {?>
<tr><td align="left"><input type="submit" name="login" value=" login ">
</td><td align="right"><input type="checkbox" name="rm" id="rm"><label for="rm">حفظ كلمة المرور</label></td></tr>
<?} else {?>
<tr><td colspan="2" align="center"><input type="submit" name="login" value=" login "></td></tr>
<?}?>
</table>
</form>

<br><br><br>
<hr width="300" size="1" noshade

color="#cdcdcd"><div class="smalltxt"

align="center">powered by <a

href="http://txtbox.co.za/p_txtauth.php">txtAuth</a

> &middot; copyright &copy; 2004, Txtbox <span lang="ar-sa">
<a title="الجرافكس العربي" target="_blank" href="http://www.o500o.com/">
تعريب</a>&nbsp; </span></div>

</body>
</html>
<?
// Don't delete this!
exit();
}
?>

افتح العمل مرة اخرى و ابحث عن هذا الكود

// Username and password
$tacfgd['uname'] = 'user';
$tacfgd['pword'] = 'pass';

و عدل الاسم و الباسورد على راحتك

اذهب الى مجلد الادارة و ضع فيه الملف jedar.php
ثم قم بفتح ملف index.php داخل مجلد الادارة و ضع هذا الكود في السطر الثاني ( أي بعد كلمة php )

الكود هو
require('jedar.php');

تم تنصيب الجدار أرجو ان أكون توفقت بالشرح

3n!Gma
03-04-2008, 08:32 PM
لا مو مجربة قبلا
و جاري التدقيق فيها ....

شكرا لك على الطرح اخي

بارك الله فيك

السلام عليكم .

ضحايا فلسطين
05-04-2008, 07:02 PM
test is in way

Scream Hacked
17-07-2008, 03:46 AM
مشكوور يعطيك العافيه

shrshr471
05-09-2008, 09:18 PM
السلام عليكم ورحمة الله وبركاته
اعتقد هو هو نفس الوضع لو عملنا جدار نارى من لوحة التحكم على فولدر الادمن
وكمان طريقة السى بانال مضمونة
ممكن توضح لو فى فرق
؟؟؟؟؟؟؟؟؟