Web Wiz - Green Windows Web Hosting - Celebrating 25 Years!

  New Posts New Posts RSS Feed - Forum folder security evaluation
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum folder security evaluation

 Post Reply Post Reply Page  <12
Author
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2005 at 1:10pm
I think you're getting confused between anonymous user and your script user. In a normal shared hosting environment, there's three windows accounts involved in this discussion...

  1. myaccount - The login account given you to administer and ftp to your web site
  2. IUSR_myaccount - The account your asp scripts run under (IUSR = IIS User).
  3. anonymous - typically an ftp account that allows anyone to ftp to/from your web space without loggin in. Unless you want your site to be used by others to host warez and porn on your bandwidth dime, never allow an anonymous ftp account.

Some web hosts have utilities that allow myaccount to change directory permissions for IUSR_myaccount. The other hosts require that you submit a trouble ticket and they change the permissions.

As JJLatWebWiz noted, IUSR_myaccount should only have read permissions by default. If write permissions are needed for a specific directory, either a myaccount utility or the web host needs to set them to allow the IUSR_myaccount user (your script) to write.

So why do some web host allow read/write permissions for IUSR_myaccount by default? Typically, it's done for financial reasons rather than security reasons.
  1. If IUSR_myaccount has read/write permissions by default, they don't get trouble tickets and complaints from new users saying "my script don't work"
  2. They don't lay out cash for a utility that allows myaccount to set IUSR_myaccount permissions (Those utilities have their own set of security problems also).
  3. They dont spend time on trouble tickets asking for permission changes.
When your hosting provider is talking about "anonymouse user", he's really talking about the script user - IUSR_myaccount. If they allow the script user to write by default, it's for their convenience - not  because your site is secure. Time to shop for a new host.

P.S. - I've got three hacker programs that do what JJLatWebWiz described - one of them I wrote in VB2 using the windows api about 10 years ago so it's not like this is a new security risk.


Lead me not into temptation... I know the short cut, follow me.
Back to Top
JJLatWebWiz View Drop Down
Groupie
Groupie
Avatar

Joined: 02 March 2005
Location: United States
Status: Offline
Points: 136
Post Options Post Options   Thanks (0) Thanks(0)   Quote JJLatWebWiz Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2005 at 8:18pm
bhall007, your administrator is not correct.

But first, to be clear, when I say "anonymous user" or "anonymous web user", I mean the "IUSR_myaccount" (the actual account name could be anything) that dpyers is talking about. I do not mean the anonymous NT "Guest" account. With inconsequential exceptions, all actions taken by IIS to satisfy a request from a web browser are done on behalf of the "IUSR_myaccount" NT account.

The only folders in which the anonymous web user MUST have write permission are the folders in which the Access MDB is stored and the uploads folder, if you allow uploads. Otherwise, "Read-Only" is best. No "writes" are taking place in any other folders by the anonymous web user, so the extra security is just that, "extra security".

As far as the hacker utilities that dpyers is talking about, I think there are a couple things that make today's hacker utilities more dangerous than 10 years ago, probably most notably is the ADODB.Stream that lets hackers upload files without counting on other COM objects like ASPUpload.
p.s. I'm not affiliated with Web Wiz Guide in any way. I'm just an average Web Wiz user repaying my debt for the use of their fine forum by trying to help other Web Wiz Guide users.
Back to Top
bhall007 View Drop Down
Newbie
Newbie


Joined: 22 November 2005
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote bhall007 Quote  Post ReplyReply Direct Link To This Post Posted: 28 November 2005 at 10:17am
Thanks JJLatWebWiz and dypers for the great info.  I'll pass that along to my web host and hope that we get it all tied up.  Thanks!

Happy Holidays!


Back to Top
bhall007 View Drop Down
Newbie
Newbie


Joined: 22 November 2005
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote bhall007 Quote  Post ReplyReply Direct Link To This Post Posted: 28 November 2005 at 11:10am
One last question:  If you have the database in another private folder outside the root web folder (i.e., C:\Inetpub\private\Website.com), how can you enable the user to upload files to the private folder via FTP?  Can you setup a virtual folder/shortcut in FTP that will allow a user to upload to that folder in FTP, but that is inaccessible through HTTP?  Or will this have to be done by the administrator directly?

Thanks!
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 29 November 2005 at 2:12pm
ususally you have a set up where you have


Username
l
l
-- website (folder)
l
l
--Private (folder)


yu ussually login to ftp at username level so see both directories.



Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 29 November 2005 at 5:30pm
Most webhosts are set up the way dj air said.

The problem with allowing users to ftp is that windows hosts don't typically support sub-ftp accounts tthat restrict users to be able to execute ftp only on specific directories. You usually just have one ftp account - which allows ftp to any directory under your Username account in dj airs example.

The work-around is to upload via a script which has access to the proper directory and you control the user's access to the upload script by requiring them to login to use it. Unix hosts usually allow sub-ftp.

Uploading via a script is no where near as efficient as ftp. Most hosts will limit your uploads via script to a 2Mb file. You can also run into script time-out issues.

Lead me not into temptation... I know the short cut, follow me.
Back to Top
JJLatWebWiz View Drop Down
Groupie
Groupie
Avatar

Joined: 02 March 2005
Location: United States
Status: Offline
Points: 136
Post Options Post Options   Thanks (0) Thanks(0)   Quote JJLatWebWiz Quote  Post ReplyReply Direct Link To This Post Posted: 29 November 2005 at 6:07pm

Originally posted by bhall007 bhall007 wrote:

If you have the database in another private folder outside the root web folder (i.e., C:\Inetpub\private\Website.com), how can you enable the user to upload files to the private folder via FTP?

Make sure you are not confusing the "database" and the "forum code"?  The "database" is a single file, the one and only MDB file, and the "forum code" is the rest of the ASP, GIF, and JPG files and the folders.  You don't want the users to upload or download or directly touch anything in the same folder as the database.  When you use FTP with the credentials supplied by your host to upload files, you usually start at the highest folder that your host has granted you access, which is usually "above" your web root.

Here's a sample folder structure:
Sample folder structure

Everything in the wwwRoot folder and all subfolders is accessible directly from a web browser.  If you know the name of the file in any of those folders, you can enter it into the browser address line and the web server will probably send it to the browser.
 
Everything outside the wwwRoot folder is a sibling or parent and the web server provides no direct method to access files therein.  Files can be accessed above the web root via scripts or other programmatic objects (assuming the anonymous web user has permission).  So, in the example above, logs, privatedb, stats, and uploads (not the same as forum/uploads) can only be accessed via a script.  The uploads folder above the web root is in case I would want to enable anonymous FTP.  You should NEVER (NEVER, NEVER, NEVER) allow anonymous FTP in ANY web folder.
 
If your private folder is a sibling or parent of the web root, then that is the best place for you forum's Access MDB.  Remember, users are not uploading files to the database.

Originally posted by bhall007 bhall007 wrote:

Can you setup a virtual folder/shortcut in FTP that will allow a user to upload to that folder in FTP, but that is inaccessible through HTTP?  Or will this have to be done by the administrator directly?
 
It would be best to not allow users to FTP files at all.  Let web users use only the file upload functionality of WWF.
 
I hope I understood your questions correctly.
p.s. I'm not affiliated with Web Wiz Guide in any way. I'm just an average Web Wiz user repaying my debt for the use of their fine forum by trying to help other Web Wiz Guide users.
Back to Top
bhall007 View Drop Down
Newbie
Newbie


Joined: 22 November 2005
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote bhall007 Quote  Post ReplyReply Direct Link To This Post Posted: 30 November 2005 at 10:58pm
Thanks JJLatWebWiz, dj air and dpyers, and everyone else for the responses.  This is just the answer I was looking for.  I really appreciate the great info, and I'm going to pass it along and try to implement this setup.

So, the IUSR_SiteName "anonymous" account ought to have read/write NTFS permissions on the private and upload (if you're using it) folders, and read on everything else? 

Thanks!

Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.