Skip to content

SSTI、Delete any file #59

@n1ec

Description

@n1ec

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions