ming-soft/MCMS

SSTI、Delete any file

Closed this issue · 0 comments

n1ec commented

SSTI
FreeMarker template is used in the project,and there is no secure configuration
Insert the payload in the background - > system settings - > template management
<#assign value="freemarker.template.utility.Execute"?new()>${value("whoami")}
image

image
net/mingsoft/basic/action/TemplateAction.java There's a suffix check, it's written to the file
image

net/mingsoft/basic/util/BasicUtil.java GetRealTemplatePath of this class is called
image

coverage /target/classes/WEB-INF/manager/main.ftl ,Refresh the home page
image

Delete any file
If the oldFileName argument exists, the corresponding file is deleted
image
Call the FileUtil.class
image
poc:
fileName=x&oldFileName=file destination