The technique is officially called or Google hacking. Google’s crawlers index millions of unprotected directories every day. A malicious actor simply types the following into Google:
Searching for "index of password.txt extra quality top" is not illegal by itself—it is just a search query. However, the files you find without explicit permission is illegal in most jurisdictions under the Computer Fraud and Abuse Act (CFAA) in the US or similar laws globally. index of passwordtxt extra quality top