Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 03-13-2007, 04:31 PM Directory Isolation
Junior Talker

Posts: 2
Trades: 0
I have tons of extra disk space and bandwidth on my sever, and would like to allow some FTP space (which would be in a web-accessible directory) for my users. However, I'm afraid that doing so could pose a threat to security, since it would be fairly easy to write a script that would display the contents of a .php configuration file in the parent directory, which holds the passwords that my software uses to access the SQL tables.

I've been looking for a way to isolate a directory so that a script could not access any parent directories, or at least prevent the execution of scripts.

Since the server is shared, I do not have direct control over it; only CPanel and htaccess methods. So I've mainly been hoping there's a way to accomplish this with htaccess files.

I know I could use a web-based file management system, which would rename all files to a harmless extension, but I'd much rather stick with FTP.
ahf123 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-13-2007, 04:36 PM Re: Directory Isolation
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
If you used something to rename your files to some harmless extension, that would break your system. Say if someone wants to upload a jpeg so they can use it as a forum signature. Or really, people want to upload a particular type of file for any reason. So that method is out.

With cpanel, can you set up password protected subdirectories?
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 03-13-2007, 04:51 PM Re: Directory Isolation
Junior Talker

Posts: 2
Trades: 0
Quote:
Originally Posted by Learning Newbie View Post
With cpanel, can you set up password protected subdirectories?
Yes, I have the option, but don't think password protecting the directory would isolate it from parent directories, and a script running on the server could probably bypass those restrictions.
ahf123 is offline
Reply With Quote
View Public Profile
 
Old 03-14-2007, 06:58 AM Re: Directory Isolation
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
.htaccess in the folder you want to stop scripting on

Code:
RewriteEngine On
RewriteRule \.(php|php3)$ /noscript.html [L]
should redirect all requests for .php files to noscript.htm
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Directory Isolation
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.60891 seconds with 12 queries