当前位置:网站首页>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');
边栏推荐
- [Intensive reading of the paper] iNeRF
- IJCAI2022 | 代数和逻辑约束的混合概率推理
- 网易云信圈组上线实时互动频道,「破冰」弱关系社交
- In Golang go-redis cluster mode, new connections are constantly created, and the problem of decreased efficiency is solved
- [QNX Hypervisor 2.2 User Manual]9.14 set
- I don't know what to do with sync issues
- SQL27 View user details of different age groups
- ThreadLocal
- [NLP] What is the memory of the model!
- Document management and tools in the development process
猜你喜欢

Memblaze released the first enterprise-grade SSD based on long-lasting particles. What is the new value behind it?

Qualcomm cDSP simple programming example (to query Qualcomm cDSP usage, signature), RK3588 npu usage query

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

21. Support Vector Machine - Introduction to Kernel Functions

ECCV 2022 Huake & ETH propose OSFormer, the first one-stage Transformer framework for camouflaging instance segmentation!The code is open source!...

如何减少软件设计和实现之间鸿沟

The old music player WinAmp released version 5.9 RC1: migrated to VS 2019, completely rebuilt, compatible with Win11

ICML2022 | 深入研究置换敏感的图神经网络

【ACM】2022.7.31训练赛

Student management system on the first day: complete login PyQt5 + MySQL5.8 exit the operation logic
随机推荐
A solution to the server encountered an internal error that prevented it from fulfilling this request [easy to understand]
Qualcomm cDSP simple programming example (to query Qualcomm cDSP usage, signature), RK3588 npu usage query
Recognize anomalies (you will understand after reading this)
C#中引用类型的变量做为参数在方法调用时加不加 ref 关键字的不同之处
信息学奥赛一本通 1941:【07NOIP普及组】Hanoi双塔问题 | 洛谷 P1096 [NOIP2007 普及组] Hanoi 双塔问题
BM5 merge k sorted linked lists
iNeuOS industrial Internet operating system, equipment operation and maintenance business and "low-code" form development tools
Socket Review and I/0 Model
10大主流3D建模技术
The latest masterpiece!Alibaba just released the interview reference guide (Taishan version), I just brushed it for 29 days
登录业务实现(单点登录+微信扫码+短信服务)
C language parsing json string (json object is converted to string)
输入输出优化
[Intensive reading of the paper] iNeRF
A high-quality WordPress download site template theme developed abroad
嵌入式开发没有激情了,正常吗?
[Code Hoof Set Novice Village 600 Questions] Leading to the combination of formulas and programs
[NLP] What is the memory of the model!
基于RT1052 Aworks nanopb string 类型固定长度使用方式(二十七)
二叉树非递归遍历