Securing Directories
#1
Posted 08 July 2010 - 02:27 AM
#2
Posted 08 July 2010 - 02:08 PM
phpVMS Hosting - Cheap, fast, and reliable! Check it out here
#3
Posted 08 July 2010 - 10:40 PM
Nabeel, on 08 July 2010 - 09:08 AM, said:
hmmmm I am not so sure about that...
by default you can access the /lib, avatars, skins, and many other folders, from the internet in most phpvms installations.
if there was a "Bad Guy" a hacker, could easily steal your hard work and/or destroy all your efforts, this is something I have been trying to explain to you Nabeel, but had no time. If you can tell us (Whats is the best way to protect those folders) from not being available to see or copy from the internet.?
This could be an issue related to the hosting service more likely than a phpvms problem. BUT I suggest making this (flaw) PUBLIC, before having a hacker cracking all phpvms sites.
I use several tricks to "protect" our contents, but sometimes they are not enough, but I will share with you all what I have found so far.
SK
Note: This problem is in no way related to fivedev hosting service.
I guess I posted in the wrong place, oops sorry. Different topic.
Attached File(s)
-
phpvms folders in the Open.jpg (25.05K)
Number of downloads: 59
#4
Posted 09 July 2010 - 12:36 AM
(create a file called .htaccess - note the period in front)
<Files ~ "\.tpl{:content:}quot;>
Order allow,deny
Deny from all
</Files>
<File "layout.tpl">
Order allow,deny
Deny from all
</File>
<File "header.tpl">
Order allow,deny
Deny from all
</File>
<File "footer.tpl">
Order allow,deny
Deny from all
</File>
That'll keep .tpl files from being allowed.
In cPanel, under Index Manager, I'd select your folders, and say "No Indexing" (that's the default I have set on fivedev). That way they can't browse the list of files. You can also use "Hotlink Protection" and add tpl files into that, and any other files.
Another thing is putting a blank index.php file in the folder, that'll prevent browsing.
phpVMS Hosting - Cheap, fast, and reliable! Check it out here
#5
Posted 10 July 2010 - 01:14 AM
Nabeel, on 08 July 2010 - 07:36 PM, said:
(create a file called .htaccess - note the period in front)
<Files ~ "\.tpl{:content:}quot;>
Order allow,deny
Deny from all
</Files>
<File "layout.tpl">
Order allow,deny
Deny from all
</File>
<File "header.tpl">
Order allow,deny
Deny from all
</File>
<File "footer.tpl">
Order allow,deny
Deny from all
</File>
That'll keep .tpl files from being allowed.
In cPanel, under Index Manager, I'd select your folders, and say "No Indexing" (that's the default I have set on fivedev). That way they can't browse the list of files. You can also use "Hotlink Protection" and add tpl files into that, and any other files.
Another thing is putting a blank index.php file in the folder, that'll prevent browsing.
That is one thing I do, but not an empty index.php file, instead I added some info: "You´re Not allowed to access this area, your IP address is: xxx.xxx.xxx.xxx and has been logged!"
But I will add the .htaccess file also. Besides I use a java script to deny the use of mouse right click. (to avoid checking the source_code)
a little late but, happy Birthday Nabeel!
SK
#6
Posted 10 July 2010 - 02:38 PM
I wouldn't do the blocking right click, that mostly just annoys people. You can just goto the menu and view source anyway. The htaccess is probably the best protection
phpVMS Hosting - Cheap, fast, and reliable! Check it out here
#7
Posted 11 July 2010 - 09:40 PM
#8
Posted 12 July 2010 - 01:26 PM
#9
Posted 12 July 2010 - 03:20 PM
phpVMS Hosting - Cheap, fast, and reliable! Check it out here
#10
Posted 13 July 2010 - 03:15 AM
1.- First prevent access to your .htaccess file (.htaccess security) just in case.
<Files .htaccess>
order allow,deny
deny from all
</Files>
2.- Then restrict directory listing/browsing:
When directory browsing is on, people accessing a URL from your site with no index page or no pages at all, will see a list of files and folders. To prevent such directory access, just place the following line in your .htaccess file.
IndexIgnore */*
3.- Preventing hot linking of images from your website:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?your-domain.com/.*$ [NC]
RewriteRule .(gif|jpg)$ – [F]
In the above code, replace [your-domain] with your actual domain name [without www].
5.- Allow/Deny certain IP addresses:
order allow,deny
deny from 123.45.6.7
deny from 012.34.5.
allow from all
SK
#11
Posted 13 July 2010 - 04:13 PM
Nabeel, on 12 July 2010 - 10:20 AM, said:
I tryied the .htacces file, and lock up everything! hehe
so I am going back to my old methods.
I gained access to the remote server via FTP, to be able to remove the file.
so, you have to be very carefull when using this file.
Thanks!
#12
Posted 13 July 2010 - 05:55 PM
Solution in the root of your site add the below to your .htaccess file.
<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh|tpl)$"> Order Allow,Deny Deny from all </FilesMatch>
As you can see this will produce access denied for the following extensions in brackets ()
#13
Posted 13 July 2010 - 06:23 PM
phpVMS Hosting - Cheap, fast, and reliable! Check it out here
#14
Posted 13 July 2010 - 06:24 PM
Custom ACARS - PIREP Filing / ACARS Live Map Update / Full Flight Log / Flight info / Aircraft info / More to come
FS-Products | Support Forum
#15
Posted 13 July 2010 - 06:29 PM
I would urge all to implement this asap.
It would take less than 2 minutes and save a lot of heartache,
#16
Posted 13 July 2010 - 06:35 PM
Thanks!
phpVMS Hosting - Cheap, fast, and reliable! Check it out here
#17
Posted 13 July 2010 - 06:41 PM
# disable directory browsing
Options All -Indexes
#18
Posted 13 July 2010 - 08:26 PM
<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh|tpl)$">
Order Allow,Deny
Deny from all
</FilesMatch>
# disable directory browsing
Options All -Indexes
Why do some directories show just a blank white screen, while others say "forbidden"?
#19
Posted 13 July 2010 - 10:16 PM
CPC900, on 13 July 2010 - 09:26 PM, said:
<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh|tpl)$">
Order Allow,Deny
Deny from all
</FilesMatch>
# disable directory browsing
Options All -Indexes
Why do some directories show just a blank white screen, while others say "forbidden"?
Hi that could be to do with your server setup.
#20
Posted 14 July 2010 - 12:31 AM
phpVMS Hosting - Cheap, fast, and reliable! Check it out here
Help



Promote to Article
MultiQuote












