less-38(GET型、单引号、mysqli_multi_query()堆叠注入)
mysqli_multi_query()
mysqli_store_result()
mysqli_fetch_row()
mysqli_more_results()
less-39(GET型、数字型、mysqli_multi_query()堆叠注入)
less-40(GET型、单引号括号、mysqli_multi_query()堆叠注入)
less-41(GET型、数字型、mysqli_multi_query()堆叠注入)
less-38
标题:GET - Stacked Query Injection - String
这关代码改了,不是以前那种方式了
if (mysqli_multi_query($con1, $sql))
{
if ($result = mysqli_store_result($con1))
{
if($row = mysqli_fetch_row($result))
{
echo '';
printf("Your Username is : %s", $row[1]);
echo "
";
printf("Your Password is : %s", $row[2]);
echo "
";
echo "";
}
// mysqli_free_result($result);
}
if (mysqli_more_results($con1))
{
//printf("-----------------n");
}
//while (mysqli_next_result($con1));
}
mysqli_multi_query()
详见PHP mysqli_multi_query() 函数
定义和用法:
mysqli_multi_query() 函数执行一个或多个针对数据库的查询。多个查询用分号进行分隔。相比mysqli_query() ,mysqli_multi_query() 可以执行多个查询语句
语法:
mysqli_multi_query(connection,query);
| 参数 | 描述 |
|---|---|
| connection | 必需。规定要使用的 MySQL 连接。 |
| query | 必需。规定一个或多个查询,用分号进行分隔。 |
mysqli_store_result()
定义和用法:
mysqli_store_result 转移上一次查询返回的结果集,迁移之后的结果集可以 在 mysqli_data_seek() 函数中使用
语法:
mysqli_store_result ( mysqli $link [, int $option ] )
| 参数 | 描述 |
|---|---|
| link | 必需。由mysqli_connect() 或 mysqli_init() 返回的链接标识 |
mysqli_fetch_row()
定义和用法:
mysqli_fetch_row() 函数从结果集中取得一行,并作为枚举数组返回。
语法:
mysqli_fetch_row(result);
| 参数 | 描述 |
|---|---|
| result | 必需。规定由 mysqli_query()、mysqli_store_result() 或 mysqli_use_result() 返回的结果集标识符。 |
mysqli_more_results()
定义和用法:
mysqli_more_results() 函数检查一个多查询是否有更多的结果。
语法:
mysqli_more_results(connection);
这题关键点就在这个mysqli_multi_query()函数,这个函数可以执行多条SQL语句,以至于我们可以堆叠注入,输入多条查询语句(以;为间隔符)
所以堆叠注入怎么测?闭合后加个;不报错,应该就是可以堆叠注入
payload:
1';insert into users(id,username,password) values ('20','123','123')-- -
less-39
标题:GET - Stacked Query Injection - Intiger based
跟38关一样,就是是数字型堆叠注入
payload:
1;insert into users(id,username,password) values ('21','123','123')-- -
less-40
标题:GET - BLIND based - String - Stacked
index.php下是基于')的堆叠注入,或者联合查询均可
除了这个index.php还有其他文件
没找到什么东西
less-41
标题:GET - BLIND based - Intiger - Stacked
数字型的联合查询或堆叠注入,跟38、39、40关类似
less-42
标题:POST - Error based - String - Stacked



