博客
关于我
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

你可能感兴趣的文章
mysql8的安装与卸载
查看>>
MySQL8,体验不一样的安装方式!
查看>>
MySQL: Host '127.0.0.1' is not allowed to connect to this MySQL server
查看>>
Mysql: 对换(替换)两条记录的同一个字段值
查看>>
mysql:Can‘t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock‘解决方法
查看>>
MYSQL:基础——3N范式的表结构设计
查看>>
MYSQL:基础——触发器
查看>>
Mysql:连接报错“closing inbound before receiving peer‘s close_notify”
查看>>
mysqlbinlog报错unknown variable ‘default-character-set=utf8mb4‘
查看>>
mysqldump 参数--lock-tables浅析
查看>>
mysqldump 导出中文乱码
查看>>
mysqldump 导出数据库中每张表的前n条
查看>>
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异常处理
查看>>