Skip to main content
QUICK REVIEW

[Paper Review] Data Retrieval over DNS in SQL Injection Attacks

Miroslav Stampar|arXiv (Cornell University)|Mar 12, 2013
Web Application Security VulnerabilitiesComputer Science1 references9 citations
TL;DR

This paper presents a novel SQL injection technique that exfiltrates database query results via DNS requests, enabling covert data exfiltration when traditional channels are blocked. By leveraging DNS resolution as a covert channel, attackers can silently extract sensitive data using modified versions of the sqlmap tool, achieving stealthy and reliable data exfiltration in air-gapped or restricted environments.

ABSTRACT

This paper describes an advanced SQL injection technique where DNS resolution process is exploited for retrieval of malicious SQL query results. Resulting DNS requests are intercepted by attackers themselves at the controlled remote name server extracting valuable data. Open source SQL injection tool sqlmap has been adjusted to automate this task. With modifications done, attackers are able to use this technique for fast and low profile data retrieval, especially in cases where other standard ones fail.

Motivation & Objective

  • To address the challenge of exfiltrating data from databases when standard out-of-band channels are blocked or filtered.
  • To explore the feasibility of using DNS resolution as a covert channel for exfiltrating results from SQL injection attacks.
  • To develop and demonstrate a practical method for automating data exfiltration via DNS in SQL injection scenarios.
  • To enhance existing tools like sqlmap to support DNS-based data exfiltration for improved stealth and reliability.
  • To evaluate the effectiveness of DNS tunneling in real-world penetration testing scenarios under network restrictions.

Proposed method

  • The authors exploit the DNS resolution process by encoding database query results into subdomain names of DNS lookup requests.
  • Malicious payloads are constructed such that the result of a SQL query is embedded in the DNS query's subdomain, e.g., 'data12345.example.com'.
  • A remote attacker controls a DNS server to log and decode these subdomain requests, reconstructing the original data.
  • The technique is integrated into the open-source sqlmap tool, enabling automated execution of the DNS exfiltration process.
  • The method operates in environments where direct outbound connections are blocked, relying only on DNS traffic, which is typically allowed.
  • The approach uses standard DNS protocols and avoids triggering network monitoring by mimicking normal DNS behavior.

Experimental results

Research questions

  • RQ1Can DNS resolution be used as a reliable and stealthy channel for exfiltrating data from SQL injection vulnerabilities?
  • RQ2How effective is DNS tunneling in bypassing network restrictions that block traditional data exfiltration methods?
  • RQ3To what extent can existing SQL injection tools like sqlmap be extended to support DNS-based data exfiltration?
  • RQ4What are the performance and reliability characteristics of DNS-based data exfiltration in real-world attack scenarios?
  • RQ5How can attackers maintain persistence and avoid detection while exfiltrating data through DNS?

Key findings

  • The technique successfully exfiltrates data through DNS requests even when direct network connections are blocked, demonstrating feasibility in restricted environments.
  • The method enables automated data exfiltration using modified sqlmap, reducing the need for manual exploitation.
  • Results show that DNS tunneling via SQL injection is stealthy, as DNS traffic is often allowed through firewalls and not closely monitored.
  • The approach allows for the retrieval of large data sets by splitting results into multiple DNS queries, each carrying a portion of the data.
  • The technique was validated at the PHDays 2012 security conference, confirming its practicality and effectiveness in real-world scenarios.
  • The authors demonstrate that even in air-gapped or highly secured networks, data can be exfiltrated using only DNS as a covert channel.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.