H-Sphere WebShell远程命令执行漏洞

漏洞信息详情

H-Sphere WebShell远程命令执行漏洞

漏洞简介

Webshell是一款基于WEB的应用程序,可以作为文件管理器进行文件上传和下载处理,使用用户名/密码方式进行认证,以suid root属性运行。
Webshell中多处代码对用户提交的请求缺少正确过滤检查,远程攻击者可以利用这个漏洞以root用户权限在系统上执行任意命令。
Webshell中的\’\’command.C\’\’114-117行中:
string file = dirname + \’\’/\’\’ + cgi.varByName(\”file\”);
string mode = cgi.varByName(\”mode\”);
string tmp=CHMOD+mode+\” \”+shquote(encodeFileName(file));
if (0==system(tmp.c_str())) {
由于对HTTP查询字段中的\’\’mode\’\’变量缺少正确检查,提交包含恶意命令的参数给\’\’mode\’\’变量,可以导致以root用户权限执行(如 \’\’mode=$(cat /etc/passwd) 0755\’\’)。
在\’\’command2.cc\’\’中的170-228之间也存在对输入缺少正确过滤问题:
void Command::compress(bool download) {
string zipfile=encodeFileName(cgi.varByName(\”zipfile\”));
string compression=cgi.varByName(\”compression\”);
.
.
if (compression.compare(\”zip\”)==0) {
.
.
cmd=ZIP\” -q -r -b /tmp \”+zipfile+tmp;
}
.
.
if (!error) {
if (download)
html.header(\”application/x-unknown\”);
error= !((chdir(dirname.c_str())==0) && (system(cmd.c_str())==0));
由于对HTTP查询中的\’\’zipfile\’\’字段数据缺少正确检查,提交包含元字符加SHELL命令的数据作为\’\’zipfile\’\’值,可能以root用户权限执行这些恶意命令(如\’\’zipfile=xyzzy`ls -l`\’\’)。

漏洞公告

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

升级程序:

http://www.hsphere.com/WebShell-2.4.tar.gz” target=”_blank”>
http://www.hsphere.com/WebShell-2.4.tar.gz

或下载补丁:

http://www.psoft.net/misc/webshell_patch.html” target=”_blank”>
http://www.psoft.net/misc/webshell_patch.html

参考网址

来源: BID
名称: 6539
链接:http://www.securityfocus.com/bid/6539

来源: BID
名称: 6537
链接:http://www.securityfocus.com/bid/6537

来源: BUGTRAQ
名称: 20030106 Remote root vuln in HSphere WebShell
链接:http://www.securityfocus.com/archive/1/305313

来源: XF
名称: hsphere-webshell-encodefilename-execution(11001)
链接:http://www.iss.net/security_center/static/11001.php

来源: psoft.net
链接:http://psoft.net/misc/webshell_patch.html

来源: SECTRACK
名称: 1005893
链接:http://www.securitytracker.com/id?1005893

来源:NSFOCUS
名称:4164※4171※4169
链接:http://www.nsfocus.net/vulndb/4164※4171※4169

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享