id: cockpit-project-panel

info:
  name: Cockpit Project Login Panel - Detect
  author: righettod
  severity: info
  description: |
    Cockpit Project products was detected.
  reference:
    - https://github.com/cockpit-project/cockpit
    - https://cockpit-project.org/
  metadata:
    max-request: 1
    verified: true
    shodan-query: http.html:"cockpit/static/login.css"
  tags: panel,cockpit,login,discovery

http:
  - method: GET
    path:
      - "{{BaseURL}}/"

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains_all(to_lower(body), "cockpit/", "is_cockpit_client")'
        condition: and

    extractors:
      - type: regex
        part: body
        name: os
        group: 1
        regex:
          - '(?i)"PRETTY_NAME"\s*:\s*"(.*?)"'
        internal: true

      - type: regex
        part: body
        name: hostname
        group: 1
        regex:
          - '(?i)"hostname"\s*:\s*"(.*?)"'
        internal: true

      - type: dsl
        dsl:
          - '"OS: " + os + " | Hostname: " + hostname'
# digest: 490a00463044022058e737a0040f1dff037c1810b3a2d1150d3af25958d1aaa5965e57fd0cba4d10022071bc8a3e7c36d1d434ce845d574203486aa56fc4b88019dc4ca87d770bd7a320:922c64590222798bb761d5b6d8e72950