当前位置:网站首页>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');
边栏推荐
- VOT2021比赛简介
- sqlite3简单操作
- 输入输出优化
- The principle of ReentrantLock (to be continued)
- LevelSequence source code analysis
- Golang - from entry to abandonment
- BOW/DOM (top)
- 景区手绘地图的绘制流程
- Summary of the classic drawing method of histogram
- ECCV 2022 Huake & ETH propose OSFormer, the first one-stage Transformer framework for camouflaging instance segmentation!The code is open source!...
猜你喜欢

useragent online lookup
I don't know what to do with sync issues

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

How to identify fake reptiles?

The latest masterpiece!Alibaba just released the interview reference guide (Taishan version), I just brushed it for 29 days

关注!海泰方圆加入《个人信息保护自律公约》

Daily practice——Randomly generate an integer between 1-100 and see how many times you can guess.Requirements: The number of guesses cannot exceed 7 times, and after each guess, it will prompt "bigger"

【论文精读】iNeRF

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

高效并发:Synchornized的锁优化详解
随机推荐
Several methods of mysql backup table
#yyds dry goods inventory# Interview must brush TOP101: the entry node of the ring in the linked list
How to identify fake reptiles?
A high-quality WordPress download site template theme developed abroad
C#中引用类型的变量做为参数在方法调用时加不加 ref 关键字的不同之处
renderjs usage in uni-app
Golang - from entry to abandonment
Judging decimal points and rounding of decimal operations in Golang
Structure of the actual combat battalion module eight operations
The latest masterpiece!Alibaba just released the interview reference guide (Taishan version), I just brushed it for 29 days
BM5 合并k个已排序的链表
BM3 flips the nodes in the linked list in groups of k
Commonly used security penetration testing tools (penetration testing tools)
输入输出优化
iNeuOS industrial Internet operating system, equipment operation and maintenance business and "low-code" form development tools
Douyin fetches video list based on keywords API
C程序设计-方法与实践(清华大学出版社)习题解析
VOT2021比赛简介
[QNX Hypervisor 2.2用户手册]9.14 set
A few permanent free network transmission, convenient and simple (Intranet through tutorials)