博客
关于我
sqli-labs ————less -26a
阅读量:172 次
发布时间:2019-02-28

本文共 905 字,大约阅读时间需要 3 分钟。

Less-26a

查看一下源代码:

查询语句:

$sql="SELECT * FROM users WHERE id=('$id') LIMIT 0,1";
过滤机制:
function blacklist($id){	$id= preg_replace('/or/i',"", $id);			//strip out OR (non case sensitive)	$id= preg_replace('/and/i',"", $id);		//Strip out AND (non case sensitive)	$id= preg_replace('/[\/\*]/',"", $id);		//strip out /*	$id= preg_replace('/[--]/',"", $id);		//Strip out --	$id= preg_replace('/[#]/',"", $id);			//Strip out #	$id= preg_replace('/[\s]/',"", $id);		//Strip out spaces	$id= preg_replace('/[\s]/',"", $id);		//Strip out spaces	$id= preg_replace('/[\/\\\\]/',"", $id);		//Strip out slashes	return $id;}

这一关与26关的区别在于,这一关中的SQL语句在构建的时候添加了一个括号,同时在SQL语句执行抛出错误后并不在前台页面输出。所以这里报错注入直接排除,不可以使用,但是我们可以使用联合查询。

这里我们可以使用')来闭合前面的(',之后在后面加入自己构造的SQL注入语句,同时在最后仍然需要闭合后面的')才可以,在这个过程中我们仍然需要绕过过滤机制,至于绕过的方法在上一节中已经有所说明了,这里不再重复了,下面给出一个简易payload:

http://192.168.11.136/sqli-labs/Less-26a?id=1')union%a0select%a01,user(),3||('1

你可能感兴趣的文章
mysqldump: Got error: 1044: Access denied for user ‘xx’@’xx’ to database ‘xx’ when using LOCK TABLES
查看>>
Mysqldump参数大全(参数来源于mysql5.5.19源码)
查看>>
mysqldump备份时忽略某些表
查看>>
mysqldump实现数据备份及灾难恢复
查看>>
mysqldump数据库备份无法进行操作只能查询 --single-transaction
查看>>
mysqldump的一些用法
查看>>
mysqli
查看>>
MySQLIntegrityConstraintViolationException异常处理
查看>>
mysqlreport分析工具详解
查看>>
MySQLSyntaxErrorException: Unknown error 1146和SQLSyntaxErrorException: Unknown error 1146
查看>>
Mysql_Postgresql中_geometry数据操作_st_astext_GeomFromEWKT函数_在java中转换geometry的16进制数据---PostgreSQL工作笔记007
查看>>
mysql_real_connect 参数注意
查看>>
mysql_secure_installation初始化数据库报Access denied
查看>>
MySQL_西安11月销售昨日未上架的产品_20161212
查看>>
Mysql——深入浅出InnoDB底层原理
查看>>
MySQL“被动”性能优化汇总
查看>>
MySQL、HBase 和 Elasticsearch:特点与区别详解
查看>>
MySQL、Redis高频面试题汇总
查看>>
MYSQL、SQL Server、Oracle数据库排序空值null问题及其解决办法
查看>>
mysql一个字段为空时使用另一个字段排序
查看>>