repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
asp.mdMarkdown44 lines1.6 KiBsource raw download

title: "Server Side Template Injection - ASP.NET" topic: "Server Side Template Injection" topicSlug: "server-side-template-injection" sourcePath: "Server Side Template Injection/ASP.md" sourceUrl: "https://github.com/swisskyrepo/PayloadsAllTheThings/blob/3ac27901c711/Server%20Side%20Template%20Injection/ASP.md" sha: "3ac27901c711" isReadme: false#

Server Side Template Injection - ASP.NET#

Server-Side Template Injection (SSTI) is a class of vulnerabilities where an attacker can inject malicious input into a server-side template, causing the template engine to execute arbitrary code on the server. In the context of ASP.NET, SSTI can occur if user input is directly embedded into a template (such as Razor, ASPX, or other templating engines) without proper sanitization.

Summary#

ASP.NET Razor#

Official website

Razor is a markup syntax that lets you embed server-based code (Visual Basic and C#) into web pages.

ASP.NET Razor - Basic Injection#

@(1+2)

ASP.NET Razor - Command Execution#

@{
  // C# code
}

References#