pkg

package
v0.0.0-...-7d5f610 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SPRING = 0
	SUMMER = 1
	AUTUMN = 2
	WINTER = 3
)
View Source
const (
	LEET_BASIC      = 0
	LEET_BASIC_PLUS = 1
)
View Source
const (
	COMBO = 0
	USER  = 1
	PASS  = 2
)

Variables

View Source
var (
	NoColor = 0
	Red     = 1
	Yellow  = 2
	Green   = 3
	Cyan    = 4
	Blue    = 5
	Magenta = 6
)

Functions

func ApplyPattern

func ApplyPattern(input string, pattern string) (string, error)

ApplyPattern applies the pattern replacements to the input string

func ConvertCacheToLDAPEntries

func ConvertCacheToLDAPEntries(cachedData *CachedLDAPData) []*ldap.Entry

ConvertCacheToLDAPEntries converts cache entries back to LDAP entries

func Print

func Print(msg string, c int)

func PrintDebug

func PrintDebug(msg string)

PrintDebug prints a debug message in blue

func PrintError

func PrintError(msg string)

PrintError prints an error message in red with an X

func PrintFatal

func PrintFatal(msg string)

func PrintInfo

func PrintInfo(msg string)

PrintInfo prints an info message in cyan with an info symbol

func PrintSuccess

func PrintSuccess(msg string)

PrintSuccess prints a success message in green with a checkmark

func PrintWarning

func PrintWarning(msg string)

PrintWarning prints a warning message in yellow with a warning symbol

func Reverse

func Reverse(s string) string

Reverse returns the reversed string

func RunLDAPQuery

func RunLDAPQuery(ldapServer string, ldapPort int, ldapS, ntlm bool, ldapUsername, ldapPassword, ntlmHash, ldapDomain, ldapOU, ldapFilter, outputFile, outputFormat, mask string, pageSize int, silent bool, cacheFile string, noCache bool, forceRefresh bool)

func SaveLDAPDataToCache

func SaveLDAPDataToCache(entries []*ldap.Entry, searchBase, ldapFilter string, attributes []string, ldapServer string, ldapPort int, cacheFile string) error

SaveLDAPDataToCache stores the LDAP data in a JSON file

func ShouldUpdateCache

func ShouldUpdateCache(cachedData *CachedLDAPData, ldapServer string, ldapPort int) bool

ShouldUpdateCache determines if the cache should be updated based on server information

Types

type CachedLDAPData

type CachedLDAPData struct {
	Entries    []LDAPEntry `json:"entries"`
	CachedAt   time.Time   `json:"cached_at"`
	SearchBase string      `json:"search_base"`
	LDAPFilter string      `json:"ldap_filter"`
	Attributes []string    `json:"attributes"`
	LDAPServer string      `json:"ldap_server"`
	LDAPPort   int         `json:"ldap_port"`
}

CachedLDAPData represents the cached LDAP data

func LoadLDAPDataFromCache

func LoadLDAPDataFromCache(cacheFile string) (*CachedLDAPData, error)

LoadLDAPDataFromCache loads the LDAP data from a JSON file

type LDAPEntry

type LDAPEntry struct {
	DN         string              `json:"dn"`
	Attributes map[string][]string `json:"attributes"`
}

LDAPEntry represents a single LDAP entry

type PatternReplacement

type PatternReplacement struct {
	From string
	To   string
}

PatternReplacement represents a single pattern replacement rule

func ParsePattern

func ParsePattern(pattern string) ([]PatternReplacement, error)

ParsePattern parses a pattern string in the format "from>to;from2>to2"

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL