Skip to content

[ASTS-62768] Update fork - #2

Open
nishiratavo wants to merge 120 commits into
devfrom
update-fork
Open

[ASTS-62768] Update fork#2
nishiratavo wants to merge 120 commits into
devfrom
update-fork

Conversation

@nishiratavo

Copy link
Copy Markdown

No description provided.

HansWeltar and others added 30 commits June 21, 2021 17:26
Fixes Issue cannatag#954: Socket never closed after certain exceptions, python warning
displayed

Connecting to a non-existing port will later trigger a
ResourceWarning: unclosed <socket.socket fd=3, ....>

This warning occurs whenever an exception is raised from _open_socket, after
the socket was allocated. When an exception is raised from _open_socket,
the connection will remain in state unbound, closed, and so the allocated
socket will never be freed again.
Solution is to free the socket before raising the exception.
`userCertificate` is a multi value. In Json it is represented as a list of dicts,
each dict contains the `encoded` certificate and the used `encoding`, often base64.
I am open to better suggestions here, but I do believe that "elaborate" does not fit in this context (I only know the verb "elaborate" to mean "explain something in (more) detail")
Although "removed by" could arguably correct in this context
("removed by the pool") means the pool (object) is the agent
actively removing the host; "removed from the pool" is easier
to read in my opinion.
This patch switches from using the legacy option `auto_bind=True` to the equivalent new `auto_bind=AUTO_BIND_NO_TLS` in the documentation.
This patch fixes a bug with TLS cipher settings not being honored.

If the cipher defaults are sufficiently strict (like they are in
python3.10 by default), certificate chains with a certificate signed
using MD5, for example, will be rejected with this error:

    wrap socket error: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:3874)

The cipher settings as specified by the user should be set before
loading the certificate chain.
A typo correction.
cannatag and others added 30 commits April 19, 2025 13:12
Fix parsing of objectGUIDs containing the byte 5C
The link to PDF copy of the manual was broken
fix excluded port number 65535
Add modify support for the RFC 4517 Postal Address format
…tamps

The format_ad_timestamp function can return bytes instead of datetime
objects when parsing certain malformed or edge-case AD LDAP attributes,
causing a TypeError when attempting timedelta subtraction.

This patch adds type checking before performing the subtraction operation
and gracefully handles the error by returning the raw value when the
expected datetime objects are not returned.

Fixes issue with LDAP enumeration failing on:
TypeError: unsupported operand type(s) for -: 'bytes' and 'datetime.datetime'
The format_ad_timestamp function can return bytes instead of datetime
objects when parsing certain malformed or edge-case AD LDAP attributes,
causing a TypeError during timedelta subtraction operations.

This patch adds type checking before performing the subtraction and
gracefully handles errors by returning the raw value when unexpected
types are encountered.

Fixes cannatag#639

Tested with:
- bloodhound-python enumeration against Active Directory
- Python 3.11
- Full LDAP enumeration completing successfully

Error resolved:
TypeError: unsupported operand type(s) for -: 'bytes' and 'datetime.datetime'

The fix maintains backward compatibility by:
- Preserving existing behavior for valid datetime conversions
- Returning raw values for edge cases (consistent with other formatters)
- No breaking changes to the public API
…ndexerror

Fix IndexError in auto_range search when response has no ranged attributes
…ta-typeerror

Fix TypeError in format_ad_timedelta with malformed AD timestamps (Issue cannatag#639)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.