I got to read an article today over on Illa.ws about how to use Google Hacking techniques for Google Code Search feature. The very good part of this is that people can get an idea of what open or exposed functions are within the Google code base search engine that could lead to a compromise.
If you are wondering if that open source code base you are using has a vulnerability and do not want to wander around lines of code, then using Google Code Search to find vulnerabilities in code is your ticket to finding awesome programming errors across the code that Google has indexed.
As an example I was curious to see if anyone still used the “query” string in their code, and did a quick search on PHP code that might have “query” in there.
Pretty cool actually: Here is a screen capture of it.
Here is what keeps this interesting; the entire Google code search base is the same Boolean construction as regular old Google search. If you have even a little programming then you can have an absolutely awesome time searching code for flaws that could lead to SQL injection attacks, Cross Site Scripting attacks, or other attack vectors for a web based system just by looking for flaws in the code.
This only works if the code is in the Google Code Search base, which from all appearances seems to be built upon what is available in open source code bases around the world. If the project is open source, and the code has been indexed, then you stand a very decent chance of looking for flaws that can be exploited using simple search strings.
This brings Google hacking to a whole new fun level, and surprised that I have not seen more of this over the last year. While open source is generally updated frequently, the end user might not update as often. Even with reminders people are often slow to update software.
But leaving open query strings is simply an open invitation to being hacked. Overall though, this is an interesting vector to discovering security flaws with computer code, and one that the hackers have been using for a while. You might want to check your own code bases using Google Hacking Code Search techniques, and it is well worth reading Illa as well for more information.