id: reflected-xss

info:
  name: Reflected Cross-Site Scripting
  author: pdteam,0xKayala,AmirHossein Raeisi
  severity: medium
  metadata:
    max-request: 1
  tags: xss,rxss,dast,vuln

variables:
  first: "{{rand_int(10000, 99999)}}"

http:
  - pre-condition:
      - type: dsl
        dsl:
          - 'method == "POST"'
          - 'method == "GET"'
        condition: or

    payloads:
      reflection:
        - "'\"><{{first}}>"

    fuzzing:
      - part: body
        type: postfix
        mode: single
        fuzz:
          - "{{url_encode(reflection)}}"

      - part: query
        type: postfix
        mode: single
        fuzz:
          - "{{url_encode(reflection)}}"

      - part: path
        type: postfix
        mode: single
        fuzz:
          - "{{url_encode(reflection)}}"

    stop-at-first-match: true

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "{{reflection}}"

      - type: word
        part: content_type
        words:
          - "text/html"
# digest: 4a0a0047304502201f71f4b45c2da5dee0ab62eb4154bc61e208d3d7c0809dd5a80d040b0f10392c022100b9431765649131e7908db1de1bf6012edf733a1422e0508b822cdc47244e6e76:922c64590222798bb761d5b6d8e72950