id: liferay-portal

info:
  name: Liferay Login Panel - Detect
  author: organiccrap,dwisiswant0,ricardomaia
  severity: info
  description: Liferay login panel was detected,
  reference:
    - https://www.liferay.com/
    - https://github.com/mzer0one/CVE-2020-7961-POC
  classification:
    cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
    cwe-id: CWE-200
    cpe: cpe:2.3:a:liferay:liferay_portal:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 3
    vendor: liferay
    product: liferay_portal
    shodan-query:
      - http.favicon.hash:129457226
      - cpe:"cpe:2.3:a:liferay:liferay_portal"
    fofa-query: icon_hash=129457226
  tags: panel,liferay,portal,discovery

http:
  - method: GET
    path:
      - "{{BaseURL}}"
      - "{{BaseURL}}/api/jsonws"
      - "{{BaseURL}}/api/jsonws/invoke"

    matchers-condition: or
    stop-at-first-match: true
    matchers:
      - type: word
        part: header
        words:
          - "Liferay-Portal"
        case-insensitive: true

      - type: word
        part: body
        words:
          - <title>json-web-services-api</title>
          - There are no services matching that phrase.
          - Unable to deserialize object
        condition: or

    extractors:
      - type: regex
        part: header
        name: version
        group: 2
        regex:
          - '(i?)Liferay-Portal:.*?(\d+\.?.*?)\s'
# digest: 490a0046304402204642334199c112e35f3e3e70499ba2a839eef294819505337bdc7d13e9c9f4f6022026b250aec0ae8791da03f12fd008022a5afdd1d0086be398069b3c1f300f13d4:922c64590222798bb761d5b6d8e72950