Skip to content

Commit

Permalink
using ldap.DialURL for ldaps banners as DialTLS is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberRoute committed Dec 23, 2024
1 parent 6928998 commit 0bcc48c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scanme/grabbers.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ func GrabMysqlBanner(ipAddress string, port int) (string, error) {
}

func GetLDAPBanner(ipAddress string, port int) (string, error) {
ldapURL := fmt.Sprintf("ldaps://%s:%d", ipAddress, port)

tlsConfig := &tls.Config{InsecureSkipVerify: true}
l, err := ldap.DialTLS("tcp", fmt.Sprintf("%s:%d", ipAddress, port), tlsConfig)

l, err := ldap.DialURL(ldapURL, ldap.DialWithTLSConfig(tlsConfig))
if err != nil {
return "", err
}
Expand Down Expand Up @@ -105,7 +107,7 @@ func GetLDAPBanner(ipAddress string, port int) (string, error) {
var serverInfo string
for _, entry := range searchResult.Entries {
for _, attr := range entry.Attributes {
serverInfo += fmt.Sprintf("%s: %s", attr.Name, attr.Values)
serverInfo += fmt.Sprintf("%s: %s\n", attr.Name, attr.Values)
}
}

Expand Down

0 comments on commit 0bcc48c

Please sign in to comment.