Simply searching for the term is not a crime; it just yields a list of URLs. However, clicking on those links and attempting to inject code (like the SQL injection example above) is a violation of the Computer Fraud and Abuse Act (in the US) and similar laws globally.
Stay safe online. Patch your parameters. inurl index php id 1 shop free
Google Dorking: An Introduction for Cybersecurity Professionals Simply searching for the term is not a