Do You PHP はてブロ

Do You PHPはてなからはてブロに移動しました

Google Code Searchの正しい使い方

先日公開されたGoogle Code Searchですが、こんな使い方もあるようです。


Stephen de Vries sent an email to SecurityFocus's web application security mailing list earlier today to comment on the new Google Code Search:

Google's code search provides an easy way to find obvious software flaws in open source and example applications.
He provided a few example queries to illustrate his point:

「脆弱なコードパターンで検索するだけで、簡単に発見することができる」というものですが、全くその通りですね :-)
PHPに関しては、コア開発者のIlia Alshanetsky氏のBlogで紹介されています。


To start things off lets look at our common friend, XSS (Cross Site Scripting):

lang:php (echo|print).*\$_(GET|POST|COOKIE|REQUEST)
        :
Next lets take a glance at another old favorite, SQL injection:

lang:php query\(.*\$_(GET|POST|COOKIE|REQUEST).*\)
        :
Perhaps one of the more dangerous security exploits is remote code execution, let check it out:

lang:php (include|require)\s*(\(|\s).*\$_(GET|POST|COOKIE|REQUEST)