---
meta:
  author: "Christian Folini"
  description: Various SQL injection tests
  enabled: true
  name: 942101.yaml
tests:
  - test_title: 942101-1
    desc: "Simple SQL Injection"
    stages:
      - stage:
          input:
            dest_addr: 127.0.0.1
            headers:
              Host: localhost
            method: POST
            port: 80
            uri: "/1234%20OR%201=1"
            version: HTTP/1.0
          output:
            log_contains: id "942101"
  - test_title: 942101-2
    desc: "Basic SQL injection"
    stages:
      - stage:
          input:
            dest_addr: 127.0.0.1
            headers:
              Host: localhost
            method: POST
            port: 80
            uri: "/2010-01-01'+sleep(20.to_i)+'"
            version: HTTP/1.0
          output:
            log_contains: id "942101"
  - test_title: 942101-3
    desc: "Simple SQL injection"
    stages:
      - stage:
          input:
            dest_addr: 127.0.0.1
            headers:
              Host: localhost
            method: POST
            port: 80
            uri: "/EmptyValue'%20and%20526=527"
            version: HTTP/1.0
          output:
            log_contains: id "942101"
  - test_title: 942101-4
    desc: "Advanced SQL injection"
    stages:
      - stage:
          input:
            dest_addr: 127.0.0.1
            headers:
              Host: localhost
            method: POST
            port: 80
            uri: "/foo')waitfor%20delay'5%3a0%3a20'--"
            version: HTTP/1.0
          output:
            log_contains: id "942101"
  - test_title: 942101-5
    desc: "Simple function call"
    stages:
      - stage:
          input:
            dest_addr: 127.0.0.1
            headers:
              Host: localhost
            method: POST
            port: 80
            uri: "/sleep(20)"
            version: HTTP/1.0
          output:
            log_contains: id "942101"
  - test_title: 942101-6
    desc: "Advanced SQL injection"
    stages:
      - stage:
          input:
            dest_addr: 127.0.0.1
            headers:
              Host: localhost
            method: POST
            port: 80
            uri: "/unittests@coreruleset.org\"%20sleep(10.to_i)%20\""
            version: HTTP/1.0
          output:
            log_contains: id "942101"
