官术网_书友最值得收藏!

Checking for DNS recursion with NSE

DNS recursion isn't typically an issue, but if you allow outside hosts to use your internal DNS servers for recursion, you are setting yourself up for potential attacks. DNS amplification attacks can be leveraged using these types of setup, where hackers will use these DNS servers to send spoofed requests to them, and they will respond back to the original host and, if there are a large number of these, a DDOS situation.

To check for DNS recursion, we can use Nmap with the NSE engine. The command is straightforward, as we will do a UDP scan on port 53 and turn on the recursive script with the command nmap -sU -p53 -script=dns-recursion HOST.

In this example, the DNS server is correctly set up as they do not allow DNS recursion:

root@pi-kali:~# nmap -sU -p53 --script=dns-recursion NS.XXX.NET
Starting Nmap 7.40 ( https://nmap.org ) at 2017-05-06 18:24 UTC
Nmap scan report for NS.XXX.NET (XXX.XXX.XXX.XXX)
Host is up (0.096s latency).
PORT STATE SERVICE
53/udpopen domain
Nmap done: 1 IP address (1 host up) scanned in 3.06 seconds

Next, this particular server allows recursion to happen and, hence, potentially participate in the DNS amplification attack:

root@pi-kali:~# nmap -sU -p53 --script=dns-recursion 1.xxx.xxx.xxx
Starting Nmap 7.40 ( https://nmap.org ) at 2017-05-06 18:24 UTC
Nmap scan report for 1.xxx.xxx.xxx
Host is up (0.27s latency).
PORT STATE SERVICE
53/udpopen domain
|_dns-recursion: Recursion appears to be enabled
Nmap done: 1 IP address (1 host up) scanned in 7.29 seconds
主站蜘蛛池模板: 江口县| 南溪县| 芒康县| 库车县| 成安县| 江口县| 华宁县| 遵义市| 武平县| 开鲁县| 梁河县| 旌德县| 桦甸市| 苍南县| 太和县| 齐齐哈尔市| 萍乡市| 江口县| 成安县| 梁山县| 三原县| 宁国市| 洛浦县| 滨海县| 岳普湖县| 浦县| SHOW| 盐边县| 海兴县| 桑日县| 长沙市| 贞丰县| 都兰县| 察雅县| 扬州市| 惠安县| 肇庆市| 祁门县| 新宾| 南京市| 沾益县|