While scanning my website with uniscan it found my robots.txt
file which disallows access to /cgi-bin/
and other directories, but they are not accessible in browser. Is there a way to access the directories or files which are Disallowed?
3 Answers
The robots.txt does not disallow you to access directories. It tells Google and Bing not to index certain folders. If you put secret folders in there, Google and Bing will ignore them, but other malicious scanners will probably do the opposite. In effect you're giving away what you want to keep secret. To disallow folders you should set this in Apache vhost or .htaccess. You can set a login on the folder if you want.
-
3As a side note; It is possible to build a trap page in robots.txt, to stop bad crawlers. Ref.: bsdguides.org/2012/a-simple-bot-trap-using-robots-txt - But this is not effective against humans, as they can comprehend that they triggered a trap, and continue the list with a new ip-address. Apr 30, 2014 at 14:12
-
-
1"not to index certain folders" - actually, it tells the good bots not to crawl certain files and folders. Disallowed pages can still be indexed (link only), particularly if other pages are linking to them.– MrWhiteMay 1, 2014 at 11:19
-
I wonder how this works. You could put a page inside such a folder with its own robot metatag to allow indexing, and I can imagine that has precedence. But I guess that if I link to a page in a folder with a disallow-index setting, that page should not be indexed. Google should follow the robots.txt guide, and the only exception should be a metatag in the page itself.– SPRBRNMay 1, 2014 at 12:23
The robots.txt file isn't a security measure and has no incidence on access permission. This file only tells 'good' robots to skip a part of your website to avoid indexation. Bad robots don't even abide by those rules and scan all they can find. So security can never rely on the robots.txt file (that's not its purpose).
Is there a way to access the directories or files which are Disallowed?
Check your webserver's permissions.
Yes, just go to the directory.
robots.txt
is nothing more than something a crawler follows out of courtesy. Crawlers are free to entirely ignore the file. It isn't a real method to keep directories private.
robots.txt
is not a security feature, it's not even a set of rules, it's just a "suggestion" really