Skip to content

[DEV] Global host option/SMB server rewrite/LDAP server rewrite#39

Open
MatrixEditor wants to merge 17 commits intomasterfrom
feat/host-option
Open

[DEV] Global host option/SMB server rewrite/LDAP server rewrite#39
MatrixEditor wants to merge 17 commits intomasterfrom
feat/host-option

Conversation

@MatrixEditor
Copy link
Copy Markdown
Owner

@MatrixEditor MatrixEditor commented Apr 6, 2026

This pull request tracks the latest changes and preparations for the 1.0.0.dev22 release: global host option, SMB server rewrite, LDAP server rewrite, NetBIOS NETLOGON support and code cleanup.

Most important changes:

Changes

  • filters.py: remove FilterObj.from_string() constructor alias (pure passthrough)
  • loader.py: replace os.path.join/exists/isfile/basename with pathlib equivalents, remove import os
  • paths.py: add get_dementor_path() and get_config_path() that re-resolve
    HOME on each call, for use in test contexts where HOME changes post-import
  • servers.py: extract _ThreadingServerInitMixin to eliminate duplicate init
    in ThreadingUDPServer and ThreadingTCPServer; remove get_service_name()
    abstract method, consolidating into service_name property directly
  • msrpc/rpc.py: add -> None to all setter methods, fix set_rcp -> set_rpc typo
  • WinRM.apply_config: call super().apply_config() first so TOML [WinRM]
    Server entries are honoured; fall back to hardcoded 5985/5986 defaults
    only when user has not configured anything
  • imap.py Add @overload decorators to challenge_auth() expressing bytes vs str
    conditional return based on decode parameter (Literal[True/False])
  • ldap.py: replace 3 inline fqdn.split() with ntlm_split_fqdn()
  • ldap.py: convert triple-quoted string inside if-block to proper # comments
  • kerberos.py: rename KRB5_Err → krb5_err, KRB5_ASREQ_to_hashcat_format ->
    krb5_asreq_to_hashcat_format (snake_case consistent with ntlm_* convention)
  • mysql.py: rename SERVER_STATUS_flags_enum → ServerStatusFlags (PascalCase)
  • ntlm.py: extract _apply_ntlm_field() helper, remove 7 duplicate try/except blocks

Closes #35

- filters.py: remove FilterObj.from_string() constructor alias (pure passthrough)
- loader.py: replace os.path.join/exists/isfile/basename with pathlib equivalents, remove import os
- paths.py: add get_dementor_path() and get_config_path() that re-resolve
HOME on each call, for use in test contexts where HOME changes post-import
- servers.py: extract _ThreadingServerInitMixin to eliminate duplicate __init__
in ThreadingUDPServer and ThreadingTCPServer; remove get_service_name()
abstract method, consolidating into service_name property directly
completer.py:
- Add -> Iterable[Completion] return annotation to get_completions()

- move TLS cert generation to config/tls.py
- config/__init__.py: introduce init_config(default_path, user_path) as
an explicit application startup function
- Migrate all _CLEARTEXT/_NO_USER/_HOST_INFO private aliases to public names
across 11 files (ftp, http, imap, ldap, mssql, mysql, pop3, smtp, x11,
ntlm, tui/commands/database)
- tui/commands/proto.py: update caller to use property access
- msrpc/rpc.py: add -> None to all setter methods, fix set_rcp -> set_rpc typo
- WinRM.apply_config: call super().apply_config() first so TOML [WinRM]
Server entries are honoured; fall back to hardcoded 5985/5986 defaults
only when user has not configured anything

imap.py:
- Add @overload decorators to challenge_auth() expressing bytes vs str
conditional return based on decode parameter (Literal[True/False])
- ldap.py: replace 3 inline fqdn.split() with ntlm_split_fqdn()
- ldap.py: convert triple-quoted string inside if-block to proper # comments
- kerberos.py: rename KRB5_Err → krb5_err, KRB5_ASREQ_to_hashcat_format →
krb5_asreq_to_hashcat_format (snake_case consistent with ntlm_* convention)
- mysql.py: rename SERVER_STATUS_flags_enum → ServerStatusFlags (PascalCase)
- ntlm.py: extract _apply_ntlm_field() helper, remove 7 duplicate try/except blocks
- ntlm_auth_create_challenge(): thin wrapper for LDAP callers
- Extract _store_ntlm_captures() from ntlm_handle_authenticate_message to separate
auth-parsing from credential-storage concerns
- Extract _decode_ntlm_identity_string() to remove duplicate user/domain decode try/excepts
- ntlm.py: extract _build_smb1_host_info() helper
pop3.py:
- Add @overload decorators to challenge_auth() expressing bytes vs str
conditional return based on decode parameter (Literal[True/False])
- remove FQDN config attribute (unused)

- smtp.py/quic.py: convert get_service_name() overrides to service_name property
- smb.py: Extracted _fill_smb1_negotiate_params() helper in SMBHandler to eliminate
verbatim duplication of 9 field assignments (DialectIndex, SecurityMode,
MaxMpxCount, MaxNumberVcs, MaxBufferSize, MaxRawSize, SessionKey, LowDateTime,
HighDateTime, ServerTimeZone) between the extended and non-extended security
paths of handle_smb1_negotiate
- Refactor smb.py handle_smb1_negotiate: remove duplicated command build/send;
- smb.py: add missing support for custom error code
- SMTP.create_server_thread: add type annotations (SessionConfig, SMTPServerConfig -> BaseServerThread)
- standalone.py: fix supress_output typo -> suppress_output
- standalone.py: remove dead 'if not supress_output: pass' block
+ smb/ntlm tests: update method names and config
+ replace unicode symbols with ascii equivalents
@MatrixEditor MatrixEditor self-assigned this Apr 6, 2026
@MatrixEditor MatrixEditor added Type - Enhancement Protocol: SMB Errors/Features related to the SMB server Protocol: LDAP Errors/Features related to the LDAP server TUI Issues or pull requests related to the CLI or TUI labels Apr 6, 2026
@MatrixEditor MatrixEditor added the Protocol: LLMNR/mDNS/NetBIOS Errors/Features related to the LLMNR/mDNS/NetBIOS poisoner label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Protocol: LDAP Errors/Features related to the LDAP server Protocol: LLMNR/mDNS/NetBIOS Errors/Features related to the LLMNR/mDNS/NetBIOS poisoner Protocol: SMB Errors/Features related to the SMB server TUI Issues or pull requests related to the CLI or TUI Type - Enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Single configuration source for hostname and domain

1 participant