Reply
Website folder contents
Old 01-14-2009, 10:32 AM Website folder contents
Novice Talker

Posts: 11
Name: Eric
Trades: 0
Hi,

I'm not exactly sure which section to post this in, because it doesn't fall exactly under any of the categories. Anyways, is there a way for someone to see the contents of the folder "http://www.example.com/examplefolder/" if there already is a "http://www.example.com/examplefolder/index.html"?

Thanks.
yangez is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 01-14-2009, 10:37 AM Re: Website folder contents
tripy's Avatar
Do not try this at home!

Posts: 3,176
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
It should not, but it depends of the web server.
But, the default behavior (of the web servers) is usually to display index.[htm|html|php|asp|aspx] if it exists.
And to display a list of the files if this is enabled.
If the listing is disabled, the user receives an "access denied" page
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is online now
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 01-14-2009, 11:16 AM Re: Website folder contents
Novice Talker

Posts: 11
Name: Eric
Trades: 0
Thanks tripy.

What if the listing was enabled, and someone wanted to see the contents of /examplefolder/? Is there a possible way to do so, even if index.html is present? I guess bypassing index.html to view the file listing?
yangez is offline
Reply With Quote
View Public Profile
 
Old 01-14-2009, 12:28 PM Re: Website folder contents
tripy's Avatar
Do not try this at home!

Posts: 3,176
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
No, it should not be possible, at least, not with apache.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is online now
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 01-15-2009, 10:36 PM Re: Website folder contents
anderswc's Avatar
Super Talker

Posts: 132
Name: Will Anderson
Location: Terre Haute, IN
Trades: 0
As said previously, if there is an index.[valid extension] file in the folder, the contents aren't displayed. There is no way to see them.

If you want to hide the contents of a folder, but don't want to add an index.html file, you can use .htaccess if your web host has it enabled. I actually wrote up a post about this a month or so ago.

http://www.itsananderson.com/2008/12...-security-tip/

Check it out if that's what you're trying to do.
__________________
Will Anderson
It's An Anderson | Twitter | Anderson Web Solutions
anderswc is offline
Reply With Quote
View Public Profile Visit anderswc's homepage!
 
Old 01-16-2009, 06:17 AM Re: Website folder contents
magicvw's Avatar
Extreme Talker

Posts: 197
Name: Vicky
Location: Brit in Bulgaria
Trades: 0
How would one go about displaying the contents of a folder which doesn't have an index.xxx file?
__________________
My Music Theory

Blog
magicvw is offline
Reply With Quote
View Public Profile Visit magicvw's homepage!
 
Old 01-22-2009, 07:19 PM Re: Website folder contents
Junior Talker

Posts: 1
Name: Michael Sim
Location: Chicago, IL
Trades: 0
why would you want to make that info public?
graphicsms is offline
Reply With Quote
View Public Profile Visit graphicsms's homepage!
 
Old 01-22-2009, 07:43 PM Re: Website folder contents
stevej's Avatar
Professional Multitasker

Posts: 991
Location: In a flying house
Trades: 0
Quote:
Originally Posted by magicvw View Post
How would one go about displaying the contents of a folder which doesn't have an index.xxx file?
Normally it will all show itself. But if the host is denying it, you could create an index.xxx file with some code like this:
PHP Code:
<?php
function list_files($dir)
{
  if(
is_dir($dir))
  {
    if(
$handle opendir($dir))
    {
      while((
$file readdir($handle)) !== false)
      {
        if(
$file != "." && $file != ".." && $file != "Thumbs.db"/*pesky windows, images..*/)
        {
          echo 
'<a target="_blank" href="'.$dir.$file.'">'.$file.'</a><br>'."\n";
        }
      }
      
closedir($handle);
    }
  }
}
?>
<?php list_files
("/directoryyouwanttolist/"); ?>
- Steve

Last edited by stevej; 01-22-2009 at 07:45 PM..
stevej is offline
Reply With Quote
View Public Profile
 
Old 01-23-2009, 03:42 AM Re: Website folder contents
magicvw's Avatar
Extreme Talker

Posts: 197
Name: Vicky
Location: Brit in Bulgaria
Trades: 0
Sorry, I didn't explain what I meant!

I don't want to show anyone the full contents of a directory. I have some directories which I don't want other people to be able to see the full contents of - all the files have very obscure names but I don't want them password protected. If someone wanted to try to find out what the contents of the directory is, how would they go about it?
__________________
My Music Theory

Blog
magicvw is offline
Reply With Quote
View Public Profile Visit magicvw's homepage!
 
Old 01-23-2009, 05:09 AM Re: Website folder contents
chrishirst's Avatar
Super Moderator

Posts: 22,241
Location: Blackpool. UK
Trades: 0
Quote:
If someone wanted to try to find out what the contents of the directory is, how would they go about it?
If you link to the files anywhere on your site, very easily. They just go back up the directory tree.

If your server allows directory browsing, up will pop a list of files and folders.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-23-2009, 06:34 AM Re: Website folder contents
magicvw's Avatar
Extreme Talker

Posts: 197
Name: Vicky
Location: Brit in Bulgaria
Trades: 0
Quote:
Originally Posted by chrishirst View Post
If you link to the files anywhere on your site, very easily. They just go back up the directory tree.

If your server allows directory browsing, up will pop a list of files and folders.
I don't link to them - i send people to them via paypal's redirect after purchase whatsit.

How do I find out if the server allows directory browsing? (it's not my server)
__________________
My Music Theory

Blog
magicvw is offline
Reply With Quote
View Public Profile Visit magicvw's homepage!
 
Old 01-23-2009, 06:41 AM Re: Website folder contents
chrishirst's Avatar
Super Moderator

Posts: 22,241
Location: Blackpool. UK
Trades: 0
Quote:
How do I find out if the server allows directory browsing?
Type the folder URI into a browser.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-23-2009, 07:40 AM Re: Website folder contents
magicvw's Avatar
Extreme Talker

Posts: 197
Name: Vicky
Location: Brit in Bulgaria
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Type the folder URI into a browser.
I get

Forbidden

You don't have permission to access /xxxxxxx/xxx/ on this server.



But how safe is it?
__________________
My Music Theory

Blog
magicvw is offline
Reply With Quote
View Public Profile Visit magicvw's homepage!
 
Old 01-23-2009, 07:58 AM Re: Website folder contents
tripy's Avatar
Do not try this at home!

Posts: 3,176
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
It's either forbidden because the function is not activated, your ip address is in a black list, or you didn't provided a valid username/pasword to the server.

Either case, this cannot be avoided.
It's as safe as the web server program is safe, but given the coverage of apache, I'd say you don't risk too much trusting it.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is online now
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 01-23-2009, 08:23 AM Re: Website folder contents
andrei155's Avatar
CEO of BLD Hosting

Latest Blog Post:
Cpanel Update
Posts: 1,340
Name: Andrei
Location: Canada
Trades: 6
Options -Indexes in .htaccess.
__________________
No Overselling Guarantee
Now Includes a Free Domain
BLD Hosting - Web Hosting | Web Hosting Blog
andrei155 is offline
Reply With Quote
View Public Profile Visit andrei155's homepage!
 
Old 01-23-2009, 08:32 AM Re: Website folder contents
magicvw's Avatar
Extreme Talker

Posts: 197
Name: Vicky
Location: Brit in Bulgaria
Trades: 0
Quote:
Originally Posted by tripy View Post
It's either forbidden because the function is not activated, your ip address is in a black list, or you didn't provided a valid username/pasword to the server.

Either case, this cannot be avoided.
It's as safe as the web server program is safe, but given the coverage of apache, I'd say you don't risk too much trusting it.

Well it must be the first one, so that's good. Not that I stand to lose very much as I'm not exactly hot property, but it's nice to know. Thanks!
__________________
My Music Theory

Blog
magicvw is offline
Reply With Quote
View Public Profile Visit magicvw's homepage!
 
Old 01-23-2009, 02:39 PM Re: Website folder contents
chrishirst's Avatar
Super Moderator

Posts: 22,241
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by magicvw View Post
I get

Forbidden

You don't have permission to access /xxxxxxx/xxx/ on this server.



But how safe is it?
Security by Obscurity.

If they can't see it they can't steal it
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Website folder contents
 

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.22575 seconds with 13 queries