Skip to content

Commit

Permalink
Add module docs for the ldap server module
Browse files Browse the repository at this point in the history
  • Loading branch information
smcintyre-r7 committed Dec 28, 2021
1 parent 25e2fbd commit d82b9ec
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions documentation/modules/auxiliary/server/ldap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
## Vulnerable Application
This module demonstrates setting up and running a basic LDAP server in Metasploit. The data it hosts is provided by the
`LDIF_FILE`.

## Verification Steps

1. Start msfconsole
1. Do: `use auxiliary/server/ldap`
1. Do: `set LDIF_FILE data/exploits/ldap/msf.ldif`
* This assumes the working directory is the top-level Metasploit Framework directory and configures the module to
use the included template.
1. Do: `run`
1. From a new shell, do: `ldapsearch -x -H ldap://192.168.159.128 -b "dc=metasploit,dc=com" "(objectClass=*)"`
* This runs a query using the `ldapsearch` utility to show the server is responsive.

## Options

### LDIF_FILE

Directory LDIF file path.

## Scenarios

### Metasploit Server Demonstration

```
msf6 > use auxiliary/server/ldap
msf6 auxiliary(server/ldap) > set LDIF_FILE data/exploits/ldap/msf.ldif
LDIF_FILE => data/exploits/ldap/msf.ldif
msf6 auxiliary(server/ldap) > show options
Module options (auxiliary/server/ldap):
Name Current Setting Required Description
---- --------------- -------- -----------
LDIF_FILE data/exploits/ldap/msf.ldif no Directory LDIF file path
SRVHOST 0.0.0.0 yes The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
SRVPORT 389 yes The local port to listen on.
Auxiliary action:
Name Description
---- -----------
Service Run LDAP server
msf6 auxiliary(server/ldap) > run
[*] Auxiliary module running as background job 0.
msf6 auxiliary(server/ldap) >
```

From another shell:

```
$ ldapsearch -x -H ldap://192.168.159.128 -b "dc=metasploit,dc=com" "(objectClass=*)"
# extended LDIF
#
# LDAPv3
# base <dc=metasploit,dc=com> with scope subtree
# filter: (objectClass=*)
# requesting: ALL
#
# metasploit.com
dn: dc=metasploit,dc=com
objectClass: dcObject
objectClass: organization
o: Metasploit Framework
dc: metasploit
# search result
search: 2
result: 0 Success
text: Success
# numResponses: 2
# numEntries: 1
```
File renamed without changes.

0 comments on commit d82b9ec

Please sign in to comment.