mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +00:00
Rename scripts (almost all of them) to make their names more consistent and
make them look better in output. The full list of changes is anonFTP => ftp-anon ASN => asn-query brutePOP3 => pop3-brute bruteTelnet => telnet-brute daytimeTest => daytime dns-safe-recursion-port => dns-random-srcport dns-safe-recursion-txid => dns-random-txid dns-test-open-recursion => dns-recursion ftpbounce => ftp-bounce HTTPAuth => http-auth HTTP_open_proxy => http-open-proxy HTTPpasswd => http-passwd HTTPtrace => http-trace iax2Detect => iax2-version ircServerInfo => irc-info ircZombieTest => irc-zombie MSSQLm => ms-sql-info MySQLinfo => mysql-info popcapa => pop3-capabilities PPTPversion => pptp-version promiscuous => sniffer-detect RealVNC_auth_bypass => realvnc-auth-bypass robots => robots.txt showHTMLTitle => html-title showOwner => identd-owners skype_v2-version => skypev2-version smb-enumdomains => smb-enum-domains smb-enumsessions => smb-enum-sessions smb-enumshares => smb-enum-shares smb-enumusers => smb-enum-users smb-serverstats => smb-server-stats smb-systeminfo => smb-system-info SMTPcommands => smtp-commands SMTP_openrelay_test => smtp-open-relay SNMPcommunitybrute => snmp-brute SNMPsysdescr => snmp-sysdescr SQLInject => sql-injection SSH-hostkey => ssh-hostkey SSHv1-support => sshv1 SSLv2-support => sslv2 strangeSMTPport => smtp-strangeport UPnP-info => upnp-info xamppDefaultPass => xampp-default-auth zoneTrans => zone-transfer
This commit is contained in:
39
scripts/dns-recursion.nse
Normal file
39
scripts/dns-recursion.nse
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
description = [[
|
||||
Checks if a DNS server allows queries for third-party names.
|
||||
|
||||
It is expected that recursion will be enabled on your own internal nameservers.
|
||||
]]
|
||||
|
||||
author = "Felix Groebert <felix@groebert.org>"
|
||||
|
||||
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
||||
|
||||
categories = {"default", "intrusive"}
|
||||
|
||||
require "bit"
|
||||
require "comm"
|
||||
require "shortport"
|
||||
|
||||
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 status, result = comm.exchange(host, port, request, {proto="udp"})
|
||||
|
||||
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)
|
||||
then
|
||||
return "Recursion appears to be enabled"
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
Reference in New Issue
Block a user