iran.1440

ایا این فایل .htaccess امنیتش خوب است یا نه!؟

14 پست در این موضوع

با سلام

می خواستم از استاد های بزرگوارد که در مورد .htaccess نظر بدهند و اگر عیبی دارند به بنده حقیر بگوید یا کدی هم دارد بفرمایند

اگر امنیتش خوب نیت بفرمایند تا من اون را کامل کنم

کد:

##
# @version $Id: htaccess.txt 21064 2011-04-03 22:12:19Z dextercowley $
# @package Joomla
# @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


#####################################################
#  READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that diss    allows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
#
#####################################################

##  Can be commented out if causes errors, see notes above.
#Options +FollowSymLinks

#
#  mod_rewrite in use
########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
## Deny access to extension xml files (uncomment out to activate)
#<Files ~ "\.xml$">
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode data within the URL
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
########## End - Rewrite rules to block out some common exploits


########## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
########## End - Custom redirects


#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update Your Joomla! Directory (just / for root)

# RewriteBase /


########## Begin - Joomla! core SEF Section
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} (/[^.]*|\.(php|html?|feed|pdf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#

# php to asp
AddType application/x-httpd-php .asp .jsp
# php to asp

# sql injection

# sql injection
# index
Options -Indexes
# index
# htaccess
<files ".htaccess">
order allow,deny
deny from all
</files>
# htaccess
# php.ini
<FilesMatch "^php5?\.(ini|cgi)$">
Order Deny,Allow
Deny from All
Allow from env=REDIRECT_STATUS
</FilesMatch>
#

#

#
########## End - Joomla! core SEF Section

البته این htaccess استاد بزرگوار Hojjat MardaneZadeh قرار داده که من یک مقداری کدهای که در انجمن را یاد گرفتم بهش اضافه کردام .

از همین استان جنوبی دست استاد را می بوسم و تشکر می کنم بابات این فایل

حالا می خواهم کاملش کنم

با تشکر

ویرایش شده در توسط iran.1440

Share this post


Link to post
Share on other sites
آموزش ووکامرس قالب جوملا قالب وردپرس قالب رایگان وردپرس قالب رایگان جوملا هاست نامحدود هاست جوملا هاست لاراول هاست وردپرس هاست ارزان هاست ربات تلگرام خرید دامنه آموزش ساخت ربات تلگرام با php آموزش html و css آموزش لاراول آموزش cPanel آموزش php آموزش سئو وردپرس آموزش امنیت وردپرس آموزش وردپرس آموزش فرم ساز RSform آموزش سئو جوملا آموزش فروشگاه ساز Hikashop آموزش فروشگاه ساز ویرچومارت آموزش طراحی سایت آگهی تبلیغاتی آموزش امنیت جوملا آموزش طراحی سایت فروش فایل آموزش طراحی قالب ریسپانسیو با Helix آموزش جوملا 3 آموزش ساخت ربات دکمه ی شیشه ای آموزش ساخت ربات همکاری در فروش آموزش ساخت ربات جذب ممبر آموزش ساخت ربات ضد اسپم آموزش ساخت ربات پیوست فایل سورس ربات مدیر گروه | ربات مدیر گروه همسریابی

درود

میتونید trace mod رو هم غیر فعال کنید که xss نشید

میتونید دستورات قوی تری برای جلوگیری از sql inject اتخاذ کنید

میتونید تنظیمات هدر رو تغییر بدید

میتونید دسترسی یکسری آی پی رو هم ببندید

میتونید پوشه مدیریت رو رمز نگاری کنید

میتونید پوشه مدیریت رو ip base کنید

میتونید دسترسی یکسری سایت های ارجاع دهنده رو ببندید

میتونید آپلود فایل رو محدود کنید

میتونید ثبت نام رو بر اساس آی پی تنظیم کنید

میتونید برای پوشه هاتون تنظیمات اختصاصی بزارید

میتونید انواع ماژول ها رئ فعال و غیر فعال کنید

میتونید فایل php.ini رو پیکر بندی کنید

تنظیمات وبسرور آپاچی یه دنیاست

میتونید...... :21:

در واقع تنظیمات این فایل بستگی به نوع سایت، نوع فعالیت، هدف از امنیت، تصمیم گیری در خصوص حوزه امنیت داره و بسته به اینا تنظیمات متغیره

بر حال جناب مردانه زاده بزرگوار تنظیمات خوب و امنی رو اتخاذ کردند و شما هم بسته به هدف از امنیت و نوع فعالیت میتونید تغییر و یا اضافه کنید

:auizz3ffy9vla57584x

پایدار باشید

ویرایش شده در توسط Pooyan Afzali

Share this post


Link to post
Share on other sites

بنظرم خیلی خوبه اگه بدرستی از کد ها استفاده کنی ، اگه کد هایی که 4ria عزیز گفته رو درست استفاده نکنی ممکنه برات مشکل ساز بشه

Share this post


Link to post
Share on other sites

احتمال غیر فعال شدن .htaccess بر اثر فشار سرور هست(خیلی به ندرت پیش میاد، ولی پیش میاد!). پس روش های خیلی حساس رو روش اجرا نکنید.

Share this post


Link to post
Share on other sites

با سلام درسته

سایت من تعطیل شد گویا اما مشکل حل کردام حرف استاد های محترم درسته

اگر زیادی هم استفاده شود سایت مشکل پیدا می کنند

اخه اگر این کار ها را انجام ندهیم که سایت امینتش بالا نمی رود

این هم یک مشکل!؟

با تشکر

Share this post


Link to post
Share on other sites

بازم تکرار میکنم دوست عزیز

از کد ها با توجه به نیازتون استفاده کنید

قرار نیست همه رو استفاده کنید و htaccess فقط بخشی از امنیت رو تامین میکنه

تاپیک مقالات آموزشی ارتقای امنیت سایت رو مطالعه کنید متوجه میشید

سایت هم اگه خطایی 500 رو داده به علت دستورات اشتباه htaccess غیر فعال شده

Share this post


Link to post
Share on other sites

حرف های همتون درسته ولی در نظر داشته باشید که پیکربندی فایل های htaccess قدرت بسیار زیادی داره ولی خب بعضی هاتون میاین دم به دم htacess می ذارید که این زیاد صحیح نیست ولی به طور مثال اگه یه htaccess به صفحه ی کنترل پنل سایت اضافه کنید می تونید بگید "کسی از این قسمت نمی تونه وارد بشه" و حرفتون درست هم هست.

و جمله ی آخر:

" htaccess فقط و الزاما برای امنیت نیست"

Share this post


Link to post
Share on other sites
من وقتی htaccess رو رینیم می کنم ارور 500 میده مشکل از چیه؟

درود

باید داخل فایل Htacccess کنار عبارت Options +FollowSymLinks (اولی نه دومی) یک # بزارید بعد ذخیره کنید

Share this post


Link to post
Share on other sites

میذارم ولی باز ارور 500 میده

از هاسته که اینو ساپورت نمی کنه؟

حذف این خط مشکلی ایجاد نمیکنه؟

Share this post


Link to post
Share on other sites

اصلا حذف نکنید

عزیزم وقتی تغییر نام میدی باید htaccess. اینجوری باشه که مشکلی نداشته باشه

Share this post


Link to post
Share on other sites

همونطور که می بینید بعضی از هاست ها با این کد مشکل دارند

The line just below this section: 'Options +FollowSymLinks' may cause problems

# with some server configurations. It is required for use of mod_rewrite, but may already

# be set by your server administrator in a way that dissallows changing it in

# your .htaccess file. If using it causes your server to error out, comment it out (add # to

# beginning of line), reload your site in your browser and test your sef url's. If they work,

# it has been set by your server administrator and you do not need it set here.

##

## Can be commented out if causes errors, see notes above.

برای هاست من این کد جواب داد

#Options +SymLinksIfOwnerMatc

Share this post


Link to post
Share on other sites

برای ارسال نظر یک حساب کاربری ایجاد کنید یا وارد حساب خود شوید

برای اینکه بتوانید نظر ارسال کنید نیاز دارید که کاربر سایت شوید

ایجاد یک حساب کاربری

برای حساب کاربری جدید در انجمن ما ثبت نام کنید. عضویت خیلی ساده است !


ثبت نام یک حساب کاربری جدید

ورود به حساب کاربری

دارای حساب کاربری هستید؟ از اینجا وارد شوید


ورود به حساب کاربری