From 52400c1f882c2155b31bb2f837105d085248eb2b Mon Sep 17 00:00:00 2001 From: david Date: Mon, 3 May 2010 15:16:10 +0000 Subject: [PATCH] Normalize indentation in dns-recursion.nse. --- scripts/dns-recursion.nse | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/scripts/dns-recursion.nse b/scripts/dns-recursion.nse index 6316c2f3e..f10deaf4b 100644 --- a/scripts/dns-recursion.nse +++ b/scripts/dns-recursion.nse @@ -1,4 +1,3 @@ - description = [[ Checks if a DNS server allows queries for third-party names. @@ -26,20 +25,20 @@ portrule = shortport.portnumber(53, "udp") action = function(host, port) -- generate dns query, Transaction-ID 0xdead, www.wikipedia.org (type A, class IN) - local request = string.char(0xde, 0xad, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03) .. "www" .. string.char(0x09) .. "wikipedia" .. string.char(0x03) .. "org" .. string.char(0x00, 0x00, 0x01, 0x00, 0x01) + local request = string.char(0xde, 0xad, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03) .. "www" .. string.char(0x09) .. "wikipedia" .. string.char(0x03) .. "org" .. string.char(0x00, 0x00, 0x01, 0x00, 0x01) - local status, result = comm.exchange(host, port, request, {proto="udp"}) + local status, result = comm.exchange(host, port, request, {proto="udp"}) - if not status then - return - end + if not status then + return + end -- parse response for dns flags if (bit.band(string.byte(result,3), 0x80) == 0x80 - and bit.band(string.byte(result,4), 0x85) == 0x80) + and bit.band(string.byte(result,4), 0x85) == 0x80) then - return "Recursion appears to be enabled" + return "Recursion appears to be enabled" end - return + return end