Skip to content

Standardize examples requirements and common functionality#1918

Closed
gabrielg5 wants to merge 15 commits into
masterfrom
techdebt_examples_bootstrapping
Closed

Standardize examples requirements and common functionality#1918
gabrielg5 wants to merge 15 commits into
masterfrom
techdebt_examples_bootstrapping

Conversation

@gabrielg5

Copy link
Copy Markdown
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:'):

Ridter and others added 6 commits March 21, 2025 10:44
…1908)

* fixed NETLOGON auth error

* use getSSPType1 func to create NlAuthMessage
* Add option to dump relayed hashes to console (ntlmrelayx)

* Add Documentation

* Simplify print statements

* Update README.md

Reverted changes in the README.md file in preparation for merge.

---------

Co-authored-by: p0rtL6 <p0rtl.pue@gmail.com>
Co-authored-by: Gabriel Gonzalez <gabriel.gonzalez@fortra.com>
Co-authored-by: laxa <laxa@ddracepro.net>
A small contribution to add autocomplete functionality to the `cat command, similar to `cd`.
@gabrielg5 gabrielg5 closed this Mar 21, 2025
gabrielg5 added a commit that referenced this pull request Mar 27, 2025
Removed extra parameter in _init_ldap_connection()

(From #1918)
gabrielg5 added a commit that referenced this pull request Mar 27, 2025
Removed some exception handling in _get_machine_name to make it valid for all examples using it

(From #1918 and #1923 (comment))
@gabrielg5 gabrielg5 deleted the techdebt_examples_bootstrapping branch July 11, 2025 14:42
NtAlexio2 pushed a commit to NtAlexio2/impacket that referenced this pull request Jul 13, 2025
Removed extra parameter in _init_ldap_connection()

(From fortra#1918)
NtAlexio2 pushed a commit to NtAlexio2/impacket that referenced this pull request Jul 13, 2025
Removed some exception handling in _get_machine_name to make it valid for all examples using it

(From fortra#1918 and fortra#1923 (comment))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Examples high High priority item Library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants