http://www.microsoft.com/japan/technet/security/advisory/954462.mspx
MSが、SQL Injection対策ツールを3つほど紹介しています。
そのうち、Scrawlrを試してみました。
Technical details for Scrawlr
* Identify Verbose SQL Injection vulnerabilities in URL parameters
http://www.communities.hp.com/securitysoftware/blogs/spilabs/archive/2008/06/23/finding-sql-injection-with-scrawlr.aspx
* Can be configured to use a Proxy to access the web site
* Will identify the type of SQL server in use
* Will extract table names (verbose only) to guarantee no false positives
とりあえず、きちんとエラーメッセージが返されないとダメみたいです。
他にもいくつか制約があります。
Scrawlr does have some limitations versus our professional solutions and our fully functional SQL Injector tool
* Will only crawls up to 1500 pages
http://www.communities.hp.com/securitysoftware/blogs/spilabs/archive/2008/06/23/finding-sql-injection-with-scrawlr.aspx
* Does not support sites requiring authentication
* Does not perform Blind SQL injection
* Cannot retrieve database contents
* Does not support JavaScript or flash parsing
* Will not test forms for SQL Injection (POST Parameters)
少々不安はありますが、ともかく自宅の簡単なアプリで試してみます。
もう遅いので要点だけ。
- Java+Oracle/MySQLで試した
- Aタグのhref属性、FORMのaction属性に書かれたURLは辿ってくれる。
- URLのクエリストリングのパラメータをテストしてくれる。
- MSのページにはCookieもテストすると書いてあるが、うまくいかない。
- UNIONでテーブル名を取りに行く。SELECTしているカラム数が10個くらいのSQL文では失敗する(脆弱性を検出しない)。
- MySQL(Version5が前提)では、「--」の後ろにスペース(+か%20)を付け忘れてるクエリがあってうまく動かない。Proxyを挟んで、スペースを足してやると動く。
- Oracleの場合、エラーメッセージが日本語だとダメ。
残念ながら、肝心のASP+MS SQL Serverは家に環境が無いので試してません。