id: db-schema

info:
  name: Discover db schema files
  author: geeknik
  severity: info
  description: This file is auto-generated from the current state of the database.
  metadata:
    max-request: 3
  tags: exposure,backup,files

http:
  - method: GET
    path:
      - "{{BaseURL}}/db/schema.rb"
      - "{{BaseURL}}/database/schema.rb"
      - "{{BaseURL}}/schema.rb"

    matchers-condition: and
    matchers:
      - type: word
        words:
          - "This file is auto-generated from the current state of the database."
          - "ActiveRecord::Schema.define"
        condition: and

      - type: status
        status:
          - 200

    extractors:
      - type: regex
        name: version
        part: body
        regex:
          - 'eRecord::Schema\.define\(version: ([0-9_]+)\) do'
# digest: 4a0a00473045022100e5b0d7d646a1a5e914d2697f2c6382fbdc687d535b2b9836f52005da11e04067022012d390e2febaa87e63e902c1e50919703b1b347090d47a03cab7f64dc2b6256f:922c64590222798bb761d5b6d8e72950