Lucene search
+L

LDAP allows null bases

🗓️ 03 Nov 2005 00:00:00Reported by Copyright (C) 2005 John LampeType 
openvas
 openvas
🔗 plugins.openvas.org👁 57 Views

LDAP servers vulnerable to null base queries, allowing unauthorized information disclosure

Code
# SPDX-FileCopyrightText: 2005 John Lampe
# Some text descriptions might be excerpted from (a) referenced
# source(s), and are Copyright (C) by the respective right holder(s).
#
# SPDX-License-Identifier: GPL-2.0-only

if(description)
{
  script_oid("1.3.6.1.4.1.25623.1.0.10722");
  script_version("2023-07-12T05:05:05+0000");
  script_tag(name:"last_modification", value:"2023-07-12 05:05:05 +0000 (Wed, 12 Jul 2023)");
  script_tag(name:"creation_date", value:"2005-11-03 14:08:04 +0100 (Thu, 03 Nov 2005)");
  script_tag(name:"cvss_base", value:"5.0");
  script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:P/I:N/A:N");
  script_name("LDAP allows null bases");
  script_category(ACT_GATHER_INFO);
  script_family("General");
  script_copyright("Copyright (C) 2005 John Lampe");
  script_dependencies("ldap_detect.nasl");
  script_require_ports("Services/ldap", 389);
  script_mandatory_keys("ldap/detected");

  script_tag(name:"solution", value:"Disable NULL BASE queries on your LDAP server.");

  script_tag(name:"summary", value:"It is possible to disclose LDAP information.");

  script_tag(name:"insight", value:"Improperly configured LDAP servers will allow the
  directory BASE to be set to NULL. This allows information to be culled without any
  prior knowledge of the directory structure. Coupled with a NULL BIND, an anonymous
  user can query your LDAP server using a tool such as 'LdapMiner'.

  Note: NULL BASE is required for LDAPv3. Therefore this plugin will not run
  against LDAPv3 servers.");

  script_tag(name:"qod_type", value:"remote_probe");
  script_tag(name:"solution_type", value:"Workaround");

  exit(0);
}

include("ldap.inc");
include("port_service_func.inc");

port = ldap_get_port( default:389 );

if( ldap_is_v3( port:port ) )
  exit( 99 );

soc = open_sock_tcp( port );
if( ! soc )
  exit( 0 );

string1 = raw_string( 0x30, 0x0C, 0x02, 0x01, 0x01, 0x60, 0x07, 0x02, 0x01, 0x02, 0x04, 0x00, 0x80, 0x80 );
string2 = raw_string( 0x30, 0x25, 0x02, 0x01, 0x02, 0x63, 0x20, 0x04, 0x00, 0x0A, 0x01, 0x00, 0x0A, 0x01, 0x00, 0x02,
                      0x01, 0x00, 0x02, 0x01, 0x00, 0x01, 0x01, 0x00, 0x87, 0x0B, 0x6F, 0x62, 0x6A, 0x65, 0x63, 0x74,
                      0x63, 0x6C, 0x61, 0x73, 0x73, 0x30, 0x00 );
mystring = string( string1, string2 );

send( socket:soc, data:mystring );
res = recv( socket:soc, length:4096 );
close( soc );
if( ! res )
  exit( 0 );

len = strlen( res );
if( len > 6 ) {
  error_code = substr( res, len - 7, len - 5 );
  if( hexstr( error_code ) == "0a0100" ) {
    security_message( port:port );
    set_kb_item( name:"LDAP/" + port + "/NULL_BASE", value:TRUE );
    exit( 0 );
  }
}

exit( 99 );

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

12 Jul 2023 00:00Current
7High risk
Vulners AI Score7
57