{"id":8,"date":"2007-04-08T18:59:47","date_gmt":"2007-04-08T18:59:47","guid":{"rendered":"http:\/\/pentestmonkey.net\/?p=8"},"modified":"2011-08-20T16:06:15","modified_gmt":"2011-08-20T16:06:15","slug":"mssql-dns","status":"publish","type":"post","link":"https:\/\/pentestmonkey.net\/blog\/mssql-dns","title":{"rendered":"Exfiltrating Data From MS SQL Server Via DNS"},"content":{"rendered":"

Exfiltrating data via Blind SQL Injection<\/a> vulnerabilities can be slow, or the very least undesirably noisy. DNS may provide a faster alternative if the target system is connected to the Internet.
\n<\/p>\n

Below are some notes I made on exfiltrating data from MS SQL Server 2005.<\/p>\n

Preamble<\/h2>\n

Why Blind SQL Injection can be a Pain<\/h3>\n

Since the injection is blind, you don’t have the luxury of getting data out fast with a UNION SELECT, or using MS SQL server error messages.<\/p>\n

Depending on your definition of “Blind SQL Injection” you might be able to use differing responses from the app to extract data 1 bit at time by asking “yes or no” questions. In the worst case, you’ll have to use something like WAITFOR DELAY<\/a> or BENCHMARK<\/a> to painstakingly extract data in a bitwise fashion.<\/p>\n

Even with the help of automated tools, this process can be slow. Owing to the fact you normally need 1 request for each bit of data you extract, you’ll typically need hundreds or even thousands of queries. Traditional exploitation of blind SQL injection is therefore a very noisy attack.<\/p>\n

Some Potential Alternatives<\/h3>\n

There may not be any other options open to you, but if you’re lucky there’ll be a shortcut. For example you might be able to:<\/p>\n