.htaccess and security.

Folders to be covered covered:
777 album_mod/upload
777 album_mod/upload/cache
777 album_mod/upload/med_cache
777 album_mod/upload/wm_cache
.htaccess location should be:
album_mod/upload/.htaccess
This will cover all attached folders too, example album_mod/upload/cache inherited the rules of the higher folder.
Add/Create this in a .htaccess file.
This will stop off site use of the folder and is the least you should have!
Access from your site/forums/portal will still function.
Please note:
This may not stop a .script/shell if it's already on the your site! where and how the shell is installed would decide this.
Any of your overrides for php need to be carried over from the root level,
this will match your folder and sub folders to the root values.
Example]php_value register_globals off[/code]
This is the rest of the folders listed in the install as set to chmod 777.
You'll need to cover them too.
777 backup
777 cache
777 cgi-bin/tmp
777 files
777 files/thumbs
777 images/avatars
777 images/smiles
777 includes/cache_tpls
777 modules
777 modules/cache
777 modules/cache/explain
777 pafiledb/cache
777 pafiledb/cache/templates
777 pafiledb/cache/templates/XXXXXX
777 pafiledb/cache/templates/XXXXXX/admin
777 pafiledb/images/screenshots
777 pafiledb/uploads
777 profilcp/def
777 var_cache
You can test how you forum handles the folders before and after with wannabrowser, just use the path to any file in the folder your testing. [url=http]http://www.wannabrowser.com/index.php[/url]
I recommend testing your site now to make sure everything is still working and and we have not stopped any thing from functioning like cashe/uploads ect. If something does not function remove the rule from it's folder.
If you wish to be even more secure you can work with this too.
You can add or remove file extensions as you need. A good example of a place to use this is your uploads folder. As it's storage of uploaded files only, code does not need to run from it!
**edit **
Note: This will stop a installed .script/shell from running as long as it covers the folders it's in and you match the file extension. Please use with care it can stop a lot of things from running.
** end edit **
I hope this brief tutorial is of help.
777 album_mod/upload
777 album_mod/upload/cache
777 album_mod/upload/med_cache
777 album_mod/upload/wm_cache
.htaccess location should be:
album_mod/upload/.htaccess
This will cover all attached folders too, example album_mod/upload/cache inherited the rules of the higher folder.
Add/Create this in a .htaccess file.
This will stop off site use of the folder and is the least you should have!
Access from your site/forums/portal will still function.
Please note:
This may not stop a .script/shell if it's already on the your site! where and how the shell is installed would decide this.
- Code: Select all
# access only from inside site. order deny,allowdeny from allallow from localhost 127.0.0.1
Any of your overrides for php need to be carried over from the root level,
this will match your folder and sub folders to the root values.
Example]php_value register_globals off[/code]
This is the rest of the folders listed in the install as set to chmod 777.
You'll need to cover them too.
777 backup
777 cache
777 cgi-bin/tmp
777 files
777 files/thumbs
777 images/avatars
777 images/smiles
777 includes/cache_tpls
777 modules
777 modules/cache
777 modules/cache/explain
777 pafiledb/cache
777 pafiledb/cache/templates
777 pafiledb/cache/templates/XXXXXX
777 pafiledb/cache/templates/XXXXXX/admin
777 pafiledb/images/screenshots
777 pafiledb/uploads
777 profilcp/def
777 var_cache
You can test how you forum handles the folders before and after with wannabrowser, just use the path to any file in the folder your testing. [url=http]http://www.wannabrowser.com/index.php[/url]
I recommend testing your site now to make sure everything is still working and and we have not stopped any thing from functioning like cashe/uploads ect. If something does not function remove the rule from it's folder.
If you wish to be even more secure you can work with this too.
- Code: Select all
# no reasion any code should be able to run in this folder!AddHandler cgi-.script .php .js .pl .py .jsp .asp .htm .shtml .sh .cgiOptions -ExecCGI
You can add or remove file extensions as you need. A good example of a place to use this is your uploads folder. As it's storage of uploaded files only, code does not need to run from it!
**edit **
Note: This will stop a installed .script/shell from running as long as it covers the folders it's in and you match the file extension. Please use with care it can stop a lot of things from running.
** end edit **
I hope this brief tutorial is of help.