mirror of
https://github.com/nmap/nmap.git
synced 2025-12-30 03:19:02 +00:00
Remove trailing whitespace in lua files
Whitespace is not significant, so this should not be a problem. https://secwiki.org/w/Nmap/Code_Standards
This commit is contained in:
@@ -17,7 +17,7 @@ Retrieves the LDAP root DSA-specific Entry (DSE)
|
||||
-- @output
|
||||
-- PORT STATE SERVICE
|
||||
-- 389/tcp open ldap
|
||||
-- | ldap-rootdse:
|
||||
-- | ldap-rootdse:
|
||||
-- | currentTime: 20100112092616.0Z
|
||||
-- | subschemaSubentry: CN=Aggregate,CN=Schema,CN=Configuration,DC=cqure,DC=net
|
||||
-- | dsServiceName: CN=NTDS Settings,CN=LDAPTEST001,CN=Servers,CN=Default-First-Site,CN=Sites,CN=Configuration,DC=cqure,DC=net
|
||||
@@ -69,7 +69,7 @@ Retrieves the LDAP root DSA-specific Entry (DSE)
|
||||
--
|
||||
-- The root DSE object may contain a number of different attributes as described in RFC 2251 section 3.4:
|
||||
-- * namingContexts: naming contexts held in the server
|
||||
-- * subschemaSubentry: subschema entries (or subentries) known by this server
|
||||
-- * subschemaSubentry: subschema entries (or subentries) known by this server
|
||||
-- * altServer: alternative servers in case this one is later unavailable.
|
||||
-- * supportedExtension: list of supported extended operations.
|
||||
-- * supportedControl: list of supported controls.
|
||||
@@ -77,7 +77,7 @@ Retrieves the LDAP root DSA-specific Entry (DSE)
|
||||
-- * supportedLDAPVersion: LDAP versions implemented by the server.
|
||||
--
|
||||
-- The above example, which contains a lot more information is from Windows 2003 accessible without authentication.
|
||||
-- The same request against OpenLDAP will result in significantly less information.
|
||||
-- The same request against OpenLDAP will result in significantly less information.
|
||||
--
|
||||
-- The ldap-search script queries the root DSE for the namingContexts and/or defaultNamingContexts, which it sets as base
|
||||
-- if no base object was specified
|
||||
@@ -102,13 +102,13 @@ function action(host,port)
|
||||
|
||||
local socket = nmap.new_socket()
|
||||
local status, searchResEntries, req, result, opt
|
||||
|
||||
|
||||
-- In order to discover what protocol to use (SSL/TCP) we need to send a few bytes to the server
|
||||
-- An anonymous bind should do it
|
||||
local ldap_anonymous_bind = string.char( 0x30, 0x0c, 0x02, 0x01, 0x01, 0x60, 0x07, 0x02, 0x01, 0x03, 0x04, 0x00, 0x80, 0x00 )
|
||||
local _
|
||||
socket, _, opt = comm.tryssl( host, port, ldap_anonymous_bind, nil )
|
||||
|
||||
|
||||
if not socket then
|
||||
return
|
||||
end
|
||||
@@ -117,17 +117,17 @@ function action(host,port)
|
||||
socket:close()
|
||||
status = socket:connect(host, port, opt)
|
||||
socket:set_timeout(10000)
|
||||
|
||||
|
||||
-- Searching for an empty argument list against LDAP on W2K3 returns all attributes
|
||||
-- This is not the case for OpenLDAP, so we do a search for an empty attribute list
|
||||
-- Then we compare the results against some known and expected returned attributes
|
||||
req = { baseObject = "", scope = ldap.SCOPE.base, derefPolicy = ldap.DEREFPOLICY.default }
|
||||
status, searchResEntries = ldap.searchRequest( socket, req )
|
||||
|
||||
|
||||
-- Check if we were served all the results or not?
|
||||
if not ldap.extractAttribute( searchResEntries, "namingContexts" ) and
|
||||
not ldap.extractAttribute( searchResEntries, "supportedLDAPVersion" ) then
|
||||
|
||||
|
||||
-- The namingContexts was not there, try to query all attributes instead
|
||||
-- Attributes extracted from Windows 2003 and complemented from RFC
|
||||
local attribs = {"_domainControllerFunctionality","configurationNamingContext","currentTime","defaultNamingContext",
|
||||
@@ -136,19 +136,19 @@ function action(host,port)
|
||||
"rootDomainNamingContext","schemaNamingContext","serverName","subschemaSubentry",
|
||||
"supportedCapabilities","supportedControl","supportedLDAPPolicies","supportedLDAPVersion",
|
||||
"supportedSASLMechanisms", "altServer", "supportedExtension"}
|
||||
|
||||
|
||||
req = { baseObject = "", scope = ldap.SCOPE.base, derefPolicy = ldap.DEREFPOLICY.default, attributes = attribs }
|
||||
status, searchResEntries = ldap.searchRequest( socket, req )
|
||||
status, searchResEntries = ldap.searchRequest( socket, req )
|
||||
end
|
||||
|
||||
|
||||
if not status then
|
||||
socket:close()
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
result = ldap.searchResultToTable( searchResEntries )
|
||||
socket:close()
|
||||
|
||||
|
||||
-- if taken a way and ldap returns a single result, it ain't shown....
|
||||
result.name = "LDAP Results"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user