![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Hmm
Industry Role:
Join Date: Sep 2005
Location: On an endless road around the world for rock and roll.
Posts: 12,642
|
Directories With 777 Permissions
It's widely said that keeping directory with 777 permissions on the sever is a very bad idea. But sometimes various scripts blogs, forums, CMSes require to have one directory with 777 permissions for the purpose of uploading image files (for example avatars at forums) and this bothers me. How to secure this directory, is it even possible? Are there any other solutions to make such directory a bit safer? I've read that some people recommend to put it above public html directory in the root directory and then point it to the remote directory. Would it make it safe? Do you have any ideas how to ensure it's safe?
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
|
nothin is safe
__________________
High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Registered User
Industry Role:
Join Date: Feb 2006
Posts: 22,511
|
don't worry your pretty little head about it.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Oct 2001
Location: Toronto
Posts: 7,103
|
666 works fine on all the evil blogs I run.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
aliasx
Join Date: Apr 2001
Posts: 19,010
|
Rollin 21.
__________________
https://porncorporation.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Registered User
Industry Role:
Join Date: Feb 2006
Posts: 22,511
|
666 the permissions of the beast.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Hmm
Industry Role:
Join Date: Sep 2005
Location: On an endless road around the world for rock and roll.
Posts: 12,642
|
Holly crap, I've asked about it at the wrong hour. All normal people are sleeping now and I should too.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Too lazy to set a custom title
Industry Role:
Join Date: Oct 2002
Location: Punta Cana, DR
Posts: 29,585
|
Quote:
For the basic safety, you can rename that directory to something very weird ( doing pointing changes accordingly ) : this helps for the kids looking for specific directory on specific scripts ...
__________________
I know that Asspimple is stoopid ... As he says, it is a FACT ! But I can't figure out how he can breathe or type , at the same time .... |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: the beach, SoCal
Posts: 107,090
|
Quote:
http://www.hackosis.com/10-ways-to-s...press-install/ has some securing information. http://codex.wordpress.org/Hardening_WordPress |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
Just make the owner of that directory the apache user
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Too lazy to set a custom title
Join Date: Jan 2002
Location: Holland
Posts: 9,870
|
use .htacsess and only give your script access
__________________
Don't let greediness blur your vision | You gotta let some shit slide icq - 441-456-888 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 | |
Hmm
Industry Role:
Join Date: Sep 2005
Location: On an endless road around the world for rock and roll.
Posts: 12,642
|
Ok. I presume that putting it outside public html and linking is the way. But how to do that. How to link a symbolic directory within public html to the real directory outside in the root. Should I use ssh and
Code:
ln -s source_file link_name ![]() Quote:
It's all about letting users to upload their image files to this directory but nothing else, only images. That's why I guess 777 is required but 777 is said to be unsafe... and this all confuses me. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Hmm
Industry Role:
Join Date: Sep 2005
Location: On an endless road around the world for rock and roll.
Posts: 12,642
|
Ok. I think I got it, now I need to check it all in practice.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Industry Role:
Join Date: Aug 2001
Posts: 832
|
you should have a PHP script between the user and the server.
Let the PHP script store the image in a safe directory which noone can access from the web. Then let the user request your PHP script, and let the PHP script deliver the image. Full control, although at the cost of performance. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 | |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
Quote:
As grumpy suggested, protect that 777 directory with a .htaccess file: Order deny,allow Deny from all then noone can access anything uploaded to that directory, yet your scripts can still process them Or move the entire directory (no links, cos that defeats the purpose) outside the doc root.
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Hmm
Industry Role:
Join Date: Sep 2005
Location: On an endless road around the world for rock and roll.
Posts: 12,642
|
Ok. thank you for taking time to post your answers!
![]() I will combine a few methods to make possibly the most secured solution of this unsecured thing. I think that most people don't do something like this and they don't care that they have directory with 777 permissions. But I'm always paranoid about the security but I guess it's good to be a bit paranoid after all. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Confirmed User
Industry Role:
Join Date: Apr 2006
Location: Germany
Posts: 4,323
|
It depends on how your apache server is set up. If it runs with the same owner/usergroup as your scripts, you do not need the 0777 permissions.
__________________
--- ICQ 14-76-98 <-- I don't use this at all |
![]() |
![]() ![]() ![]() ![]() ![]() |