Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize examples requirements and common functionality #1918

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

gabrielg5
Copy link
Collaborator

This PR aims to standardize some examples requirements and group them in a single utils script that could be leveraged by existing and future examples.

Shared Functionality

Logging initialization

  • Added flags -ts and -debug to every example
  • Created a single function to initialize logging and call it from all examples...
    def init(ts=False, debug=False):

LDAP Login

  • Extracted common LDAP login functions - calling them from examples that were redefining it
    def ldap3_kerberos_login(connection, target, user, password, domain='', lmhash='', nthash='', aesKey='', kdcHost=None, TGT=None, TGS=None, useCache=True):

    def init_ldap_session(domain, username, password, lmhash, nthash, k, dc_ip, aesKey, use_ldaps):

Identity Parsing

  • Extracted identity parsing functionality and replaced it in examples that were needing it
    def parse_identity(credentials, hashes=None, no_pass=False, aesKey=None, k=False, getpass_msg='Password:'):

@anadrianmanrique anadrianmanrique self-assigned this Mar 13, 2025
@anadrianmanrique anadrianmanrique added the medium Medium priority item label Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Examples Library medium Medium priority item
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants