html:"viewindex.shtml"
or
http.title:"Index of" http.html:"viewindex.shtml"
No. Using Google search operators is legal in almost all jurisdictions. However, accessing a private directory without permission—even if Google found it—may violate local computer misuse laws (like the CFAA in the US). inurl viewindexshtml
In Google search syntax, inurl: is an advanced operator that instructs the search engine to look for a specific string of text inside the URL of a webpage. For example, if you search inurl:login, Google will return all indexed pages that have the word "login" in their web address (e.g., www.example.com/login or login.example.com). html:"viewindex