Proteksi folder chmod 777 dengan htaccess

by Perk1z on April 1, 2008

Folder dengan chmod 777 = bisa di tulis, baca dan di eksekusi oleh “siapa saja”

Biasanya kelemahan ini dianggap sepele (terabaikan begitu saja), padahal ini bisa berakibat fatal dari sisi sekuriti web, terutama pada folder upload/images. Sebaiknya jika menngunakan fasilitas upload untuk umum seperti upload file, image avatar, image profile, dll. Folder tujuan sebaiknya difilter, diantaranya menggunakan file htaccess. Berikut sedikit tips yang mungkin bisa membatasi akses ke folder tersebut :

Create file .htaccess di folder yang bersangkutan dan isi dengan :

php_flag engine off
<Files ~ "\.(php*|s?p?html|cgi|pl)$">
deny from all
</Files>

Penjelasan :
.htaccess diatas akan menolak (Deny) akses ke folder tersebut terhadap extensi file php,shtml,phtml,cgi,pl

Catatan :
Anda bisa menambah,modif FIle yang diinginkan/ditolak sesuai dengan kebutuhan

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • LinkedIn
  • Live
  • Print this article!
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb

Related Posts

Leave a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word