IIS Directory Browing - iis

If I enable directory browsing in IIS it displays folder contents to user. Is there any way of controlling the way it shows the list. For example, I don't want to show full physical path of the folder. Is it possible to achieve? If yes, how?

Enable Directory browsing will not show the full path in the browser. Where do you see the full path?

Related

Directory browsing disable in IIS however application log files were disclosed within the ‘log’ folder

I set the Directory Browsing to false in IIS. After that it is not possible to list files in directories on website. It works! However I can browse the file path through the http link. The following example screenshot below shows that sensitive information such as application log were disclosed within the ‘log’ folder through directory listing of the web server
How to disable file browsing also?
You can set permissions for these files so that users don’t have access. Click on your website in the sites and right-click find switch to the content view, you can see your website documents and then edit the permissions for the file. You can directly select the hidden option in the attributes. In this way, the visiting user will not be able to see it.

Kentico permanent link vs direct path

I'm working on some site that all links (dynamic + hard-coded) to media library are permanent links (with getmedia...), which made it so hard to locate the exact folder of the files and update them. I've asked some developer and heard that permanent links are more secure as the system can check who have access to download the materials. Is it a fair statement and why/why not? Thanks for your input!
This is not a fair or correct statement. Access is set at the individual medial library directory, not an individual file level.
For example, if you have an Images media library which has no security behind it, you can access it directly with a URL of:
/site/media/images/logo.png or /getmedia/<guid>/logo.png
and the image will display without issue.
Now you have another media library called "Secure_Files", if you attempt to access:
/site/media/secure_files/file1.pdf
You'll get an error or a login page because the security is set on the
/site/media/secure_files directory.
Here is the documentation on securing media libraries.
By default, Kentico does not check the See library content permission for visitors on the live site. If you wish to require users to have this permission to view media library content, you need to enable the following settings in the Content -> Media category of the Settings application:
Use permanent URLs
Check file permissions
See the note at the very bottom of this documentation page.
Permanent Link is made up of:
/getmedia/
Guid ID
Image Path
.aspx
Eg: /getmedia/C73B5-6A0-4F6-878-3C29D792014/IMG_3860.jpg.aspx
Direct Path is made up of:
/
Site Name
Media Library Folder Name
Image Path
Eg: /google/media/Blog-images-from-Kentico-Cloud/IMG_360.jpg

How to hide web.config from directory browsing?

I use IIS8 and I'm trying to hide web.config from the files list on my site but I just can't seem to find a solution for that. Can you help me please? :)
Right click the file and mark it as hidden. It will stop showing up in IIS directory browsing.
Use the command prompt for each web.config file
attrib +H web.config
You can also do a Find with Windows Explorer and search for "web.config" in the directory where you store all of your web data, then right-click on each one there to enable the Hidden flag as well. With the Find GUI > View options - you can hide already hidden files so you know which ones you've already changed.

How can I prevent people from viewing my files when they browse my website?

How can I prevent people from viewing my files, when they browse my website?
I wish to prevent users from reading the files present at, say, http://domainname.com/css/. When they do that, all the files in that folder are visible to the user.
You can change the permissions on that folder or move it out of public_html folder on server
Put a dummy index.html file into the folder.
If you're using an Apache web server, you can use the -Indexes option in your server configuration to disable directory indexing.

IIS denying access to simple HTML file in virtual directory

I'm trying to display simple HTML files in a folder on my web site. No ASP.NET, no application, just a virtual directory. I'm getting "Access denied" in the browser when I try to open a web page.
This is through a hosting provider; I have access through FTP and IIS Manager only.
Authorization Rules show Allow - All Users - Inherited.
I'm far from an expert on IIS, and most search results either suggest checking folder permissions in the file system (which I have no direct access to) or are relevant to applications.
How can I diagnose this?
More information:
Through trial and error, I found out the cause, and worked around it with URL Rewrite. I'd still like to know why it's happening (the root cause) and how to change IIS's behavior.
I'm moving my site from Linux hosting to Windows hosting. Some of the old URLs are of the form:
http://www.MYSITE/myblog/index.php/2013/04/29/SOMEFILE.html
The ones I'm moving are HTML files, not PHP files, but I tried to mirror the folder structure.
The problem is in the index.php folder name. No matter what I do, even if I enable directory browsing, IIS won't let me access any files in a folder with that name. If I rename the folder (or even the "extension" part), it all works.
I've scanned through many of the IIS settings and haven't found any mention of forbidding a .php extension. What's going on?
You need to add permission for IIS users.Try adding permission to the folder by adding user
IIS_IUSRS and give required permission .
1.Right click on folder, go to properties
2.Go to security tab
3.Click on Edit, if you don't see IIS_IUSRS in the user list who have permission
4.Click on Add , In the box , add IIS_IUSRS and click on check names, it will
get the qualified name .
5.Click OK and apply
Hopefully it should work then
Through trial and error, I found out the cause, and worked around it with URL Rewrite.
For URLs of the form:
http://www.MYSITE/myblog/index.php/2013/04/29/SOMEFILE.html
The problem is in the index.php folder name. IIS won't let me access any files in a folder with that name. If I rename the folder (or even the "extension" part), it all works.
This is reminiscent of Joomla virtual (SEO) URLs. I'm assuming that you don't really have static files at all, but the CMS program running your site parses this information after the "index.php" as parameters for a database query to create the html page on the fly. In this case, the only file that's really being served by the web server is index.php, and the program includes other php files depending on the parameters entered. You're on the right track though, with creating a small file on the destination server and try to load it, but this means the index.php directory structure is moot.

Resources