SQL 注入 OrderBy/0ctf simplesqlin

Posted 歇马

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SQL 注入 OrderBy/0ctf simplesqlin相关的知识,希望对你有一定的参考价值。

https://www.cnblogs.com/claricre/p/6187672.html

http://www.w3school.com.cn/sql/sql_orderby.asp

1.  select 字段列表/* from 表名 where 条件 order by 字段名1 asc/desc, 字段名2 asc/desc,.......

2.  select 字段列表/* from 表名 where 条件 order by 字段序号 asc/desc, 字段序号 asc/desc,....... (此时字段序号要从1开始)

3.  select 字段列表/* from 表名 where 条件 order by 字段别名1 asc/desc, 字段别名2 asc/desc,.......(这里类似于第一种,无非就是把字段名加了个别名来代替而已。)

 

order by 是用来排序的,后面的数字代表列数
order by 1 第一列进行排序
。。。
order by 10 错误,即没有第10列
由此可得一共有9列


0CTF2017 simplesqlin

一听名字就大概知道是个sql注入,简单判断下是个数字注入
然后试了试,同样通过orderby判断出有三列。
然后发现select被过滤了,然后发现插入%00之后就能绕过

id=1 and 1=2 union se%00lect 1,2,3
  • 1

接下来有可以爆破了,之后的from和where都被过滤了。
同样可以插入%00进行绕过,得到表名flag,news
flag表的列名也是flag
所以,payload如下:

id=1 and 1=2 union s%00elect 1,flag,3 fro%00m flag
  • 1

这里写图片描述

以上是关于SQL 注入 OrderBy/0ctf simplesqlin的主要内容,如果未能解决你的问题,请参考以下文章

使用Simple Injector注入IUrlHelper

BugKu:Simple_SSTI(SSTI模板注入)

使用 Quartz.NET 和 Simple Injector 进行构造函数注入

Simple Injector 无法在 Web API 控制器中注入依赖项

安全-Simple_SSTI1(BugkuCTF)

springboot自定义注解,项目启动时扫描注解类并注入容器