Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
3519793
Update ruff to latest version
NeffIsBack Apr 3, 2025
b35cfe0
Update ruff settings declaration to reflect latest recommendations
NeffIsBack Apr 3, 2025
2c29856
Update ruff settings declaration to reflect latest recommendations
NeffIsBack Apr 3, 2025
f4ad706
Fix LOG015 and replace all calls to root logger
NeffIsBack Apr 3, 2025
31373e4
Don't check for D413, missing-blank-line-after-last-section
NeffIsBack Apr 3, 2025
66e9927
Fix UP031, remove percent string replacements
NeffIsBack Apr 3, 2025
61e2e58
Fix UP031, remove percent string replacements
NeffIsBack Apr 3, 2025
dc415e7
Fixed string concatination that is only available in py3.12+
NeffIsBack Apr 3, 2025
1289a0e
Enable preview mode as recommended in our doc guidelines
NeffIsBack Apr 3, 2025
5782352
Remove rule which converts 'x if x else y' and deletes unused variables
NeffIsBack Apr 3, 2025
a42c664
Autofix with ruff
NeffIsBack Apr 3, 2025
ae6721a
Remove all FURB rules, makes code more complicated
NeffIsBack Apr 3, 2025
52008c1
Remove unnecessary cast to int
NeffIsBack Apr 3, 2025
42538e4
Disable false positive
NeffIsBack Apr 3, 2025
8923370
Disable A004, as it complains about sys.exit which supposes to be sup…
NeffIsBack Apr 3, 2025
bde58c4
Apply SIM401, use .get() over 'x if x else y'
NeffIsBack Apr 3, 2025
542452a
Apply C419, removing unnecessary list comprehensions
NeffIsBack Apr 3, 2025
67abbf8
Disable RUF052, these are considered private not dummy
NeffIsBack Apr 3, 2025
f386434
Lint daclread
NeffIsBack Apr 3, 2025
4255cab
Adding exceptions for false positives
NeffIsBack Apr 3, 2025
768a401
Leaving as is for readability
NeffIsBack Apr 3, 2025
1520f3c
Remove unnecessary code and format string
NeffIsBack Apr 3, 2025
2f63732
One liner return values and format strings
NeffIsBack Apr 3, 2025
a4bdf2b
Mostly ignore firefox because it will be removed anyway
NeffIsBack Apr 3, 2025
eb88dc5
Rename ElementTree to ET for consistency
NeffIsBack Apr 3, 2025
bcf6b37
Use context manager for files and improve code
NeffIsBack Apr 3, 2025
d016fb6
make nxc compatible with bloodhound-ce
mpgn Apr 26, 2025
26588a4
fix ruff
mpgn Apr 26, 2025
3af68e3
Now check trusted domains DCs
termanix Mar 4, 2025
bab540d
Add missing trust_type_text value, ref: MS-ADTS
NeffIsBack Mar 30, 2025
23769d7
Remove unnecessary try&except block and display trust domains we are …
NeffIsBack Mar 30, 2025
c1a0f14
Thought, would implement it with netlogon but not have time for now, …
termanix Apr 1, 2025
e993fbd
Refactored to enforce direct attribute access, preventing misleading …
termanix Apr 1, 2025
981ad11
Merge branch 'main' into dc-list
termanix Apr 27, 2025
b8dfb52
took the old branch, it was fixed.
termanix Apr 27, 2025
b7b454e
Update ldap.py
termanix Apr 27, 2025
a517be8
Merge branch 'Pennyw0rth:main' into dc-list
termanix Apr 27, 2025
a47431c
fix hostname info if no ntlm
mpgn Apr 29, 2025
a083405
Merge branch 'Pennyw0rth:main' into dc-list
termanix May 4, 2025
7fdca67
Merge branch 'main' into dc-list
termanix May 5, 2025
602498f
Merge branch 'Pennyw0rth:main' into dc-list
termanix May 7, 2025
c87d0c2
integrated enum_trusts
termanix May 7, 2025
2cf004d
fix review
mpgn May 15, 2025
ee945fa
fix review
mpgn May 15, 2025
c25640c
Merge branch 'Pennyw0rth:main' into dc-list
termanix May 20, 2025
a689cd1
Replaced Reprecated with Removed
termanix May 20, 2025
500eaa7
enum_trust ruff fixed
termanix May 20, 2025
789edeb
Switch to the fixed ldap signing version from zblurx
NeffIsBack May 25, 2025
263b1df
Revert #682 and reenable ldap signing
NeffIsBack May 25, 2025
7d3dd40
make bloodhound-ce default
mpgn May 25, 2025
95ca5b4
Merge branch 'main' into be
mpgn May 25, 2025
15fb6a3
update poetry lock
mpgn May 25, 2025
5c36c98
Merge pull request #704 from Pennyw0rth/neff-fix-ldap
NeffIsBack May 25, 2025
e53f1cf
Now checking for dc with win server 2025 and not functional domain le…
NeffIsBack May 25, 2025
ded34e0
Merge pull request #705 from Pennyw0rth/neff-fix-badsuccessor
NeffIsBack May 25, 2025
2164b4c
Merge branch 'main' into be
mpgn May 25, 2025
65e6e8c
fix poetry lock
mpgn May 25, 2025
09ca4c9
Implement unlimited querying with MSEven
NeffIsBack May 25, 2025
379641e
Allow setting the limit to UNLIMITED
NeffIsBack May 25, 2025
2c12ab7
Improve regex match and reduce false positives
NeffIsBack May 25, 2025
c3c4876
Add missing check if config section is missing
NeffIsBack May 25, 2025
614de0b
Use already existing config object
NeffIsBack May 25, 2025
ff53155
Merge pull request #706 from Pennyw0rth/neff-improve-eventlog_creds
NeffIsBack May 25, 2025
962a7ec
Add info if 'bloodhound' package not found
NeffIsBack May 25, 2025
51dfd51
Actually as the poetry file now says 'bloodhound-ce' we must uninstal…
NeffIsBack May 25, 2025
09cb12d
Swap command order, otherwise pipx will complain
NeffIsBack May 25, 2025
7091022
Move bloodhound package info function to the helpers
NeffIsBack May 25, 2025
e5d3b66
Add comments
NeffIsBack May 25, 2025
b73e51c
Merge branch 'main' into neff-update-ruff
NeffIsBack May 25, 2025
1281b0f
Merge pull request #671 from Pennyw0rth/fix_host_info
mpgn May 25, 2025
dd32695
Update lock file
NeffIsBack May 25, 2025
1afef2f
Merge branch 'main' into be
mpgn May 25, 2025
b1f0368
Merge pull request #664 from Pennyw0rth/be
mpgn May 25, 2025
c91c9dd
Linting
NeffIsBack May 25, 2025
769f82f
Linting
NeffIsBack May 25, 2025
9e1c44b
Merge branch 'main' into neff-update-ruff
NeffIsBack May 25, 2025
730a4bf
Linting
NeffIsBack May 25, 2025
1b750d8
Don't test change-password module otherwise we can't log in anymore...
NeffIsBack May 25, 2025
81e4977
Fix remove-mic module
NeffIsBack May 25, 2025
d0f9b2d
Display proper info when there is no adcs in the domain
NeffIsBack May 25, 2025
3fcb377
Regenerate lock file
NeffIsBack May 25, 2025
6a0a985
Merge pull request #629 from Pennyw0rth/neff-update-ruff
NeffIsBack May 25, 2025
e2f225a
Merge branch 'main' into dc-list
NeffIsBack May 26, 2025
f61e90b
Switch impacket branch to Pennyw0rth fork
NeffIsBack May 27, 2025
3bf9de3
Merge pull request #707 from Pennyw0rth/neff-switch-impacket
NeffIsBack May 27, 2025
66642a5
implement the checks from ldap-checker module in core ldap protocol
zblurx May 27, 2025
f8033d6
fix ldap-signing check
zblurx May 27, 2025
5bbdb70
update cbt check
zblurx May 28, 2025
267bd93
change colors and add values into db
zblurx May 28, 2025
f808948
update e2e
zblurx May 28, 2025
3fb002c
update poetry lock
zblurx May 28, 2025
3b0f74f
cleanup the code
zblurx May 28, 2025
8fd0e39
Rename variable to more meaningful name
NeffIsBack May 28, 2025
0d87cc5
Update impacket to add the latest changes by zblurx regarding the cbt
NeffIsBack May 28, 2025
8fb6334
Add debug log statements
NeffIsBack May 28, 2025
a651678
Add exception handling if no TLS cert is available
NeffIsBack May 28, 2025
dd2a053
Add debug log statements
NeffIsBack May 28, 2025
f36c53f
Formatting
NeffIsBack May 28, 2025
f3d5f8d
Readd ldap-checker module with 'REMOVED' note
NeffIsBack May 28, 2025
a6542ca
Fix spec file
NeffIsBack May 28, 2025
1a37573
Merge pull request #710 from Pennyw0rth/neff-fix-spec
NeffIsBack May 28, 2025
ccd39ff
Fix error handling when resolving the DCs
NeffIsBack May 28, 2025
1904ee4
Simplify logic
NeffIsBack May 28, 2025
5456154
Fix trust bits
NeffIsBack May 28, 2025
23bab54
Remove duplicate if list is empty check
NeffIsBack May 28, 2025
87c95a4
Move int casting to value source
NeffIsBack May 28, 2025
fdfafb6
Separate domain trusts visually by using succes instead of hightlight
NeffIsBack May 28, 2025
b2fe25a
Change domain color on trust enumeration
NeffIsBack May 28, 2025
4883957
Merge branch 'main' into dc-list
termanix May 28, 2025
155553a
revert db changes
zblurx May 28, 2025
36bdf2f
added author to pi
termanix May 28, 2025
ed88bee
added remove sign to description on enum_trust
termanix May 28, 2025
1c1194a
Merge pull request #666 from termanix/dc-list
NeffIsBack May 28, 2025
71ccfd9
Merge pull request #709 from Pennyw0rth/ldap_checker_removal
zblurx May 28, 2025
1cd38c3
WIP: update poetry.lock before upstream merge
Mercury0 May 29, 2025
d6953c0
Resolve merge conflicts and sync fork with upstream
Mercury0 May 29, 2025
e752d04
Restore custom logic for atexec.py
Mercury0 May 29, 2025
104dfa5
Restore BLS pyproject.toml
Mercury0 May 29, 2025
b0fa540
Apply ruff lint fix [RUF100]
Mercury0 May 29, 2025
c6766f4
Apply numerous ruff linting fixes
Mercury0 May 29, 2025
fb2c166
Update ruff version pinning
Mercury0 May 29, 2025
3b66ba9
Update poetry.lock to match pyproject.toml changes
Mercury0 May 29, 2025
e2e196f
Update pyproject.toml
Mercury0 May 29, 2025
b3ce231
Numerous ruff linter adjustments and fixes
Mercury0 May 29, 2025
af6b69d
Extend LDAP admin check to ccache auth
Mercury0 May 29, 2025
3665d05
Update pyproject.toml to utilize BLS fork of Bloodhound.py CE branch
Mercury0 May 30, 2025
2c69310
Regenerate lockfile with updated dependency
Mercury0 May 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions netexec.spec
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ a = Analysis(
'impacket.dcerpc.v5.gkdi',
'impacket.dcerpc.v5.rprn',
'impacket.dcerpc.v5.even',
'impacket.dcerpc.v5.even6',
'impacket.dpapi_ng',
'impacket.tds',
'impacket.version',
Expand All @@ -43,6 +44,7 @@ a = Analysis(
'nxc.parsers.ldap_results',
'nxc.helpers.bash',
'nxc.helpers.bloodhound',
'nxc.helpers.even6_parser',
'nxc.helpers.msada_guids',
'nxc.helpers.ntlm_parser',
'paramiko',
Expand Down
5 changes: 5 additions & 0 deletions nxc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@

# Check if there are any missing options in the config file
for section in nxc_default_config.sections():
if not nxc_config.has_section(section):
nxc_logger.display(f"Adding missing section '{section}' to nxc.conf")
nxc_config.add_section(section)
with open(path_join(NXC_PATH, "nxc.conf"), "w") as config_file:
nxc_config.write(config_file)
for option in nxc_default_config.options(section):
if not nxc_config.has_option(section, option):
nxc_logger.display(f"Adding missing option '{option}' in config section '{section}' to nxc.conf")
Expand Down
6 changes: 2 additions & 4 deletions nxc/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,7 @@ def call_modules(self):
module.on_admin_login(context, self)

def inc_failed_login(self, username):
global global_failed_logins
global user_failed_logins
global global_failed_logins, user_failed_logins

if username not in user_failed_logins:
user_failed_logins[username] = 0
Expand All @@ -305,8 +304,7 @@ def inc_failed_login(self, username):
self.failed_logins += 1

def over_fail_limit(self, username):
global global_failed_logins
global user_failed_logins
global global_failed_logins, user_failed_logins

if global_failed_logins == self.args.gfail_limit:
return True
Expand Down
3 changes: 3 additions & 0 deletions nxc/data/nxc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ bh_port = 7687
bh_user = neo4j
bh_pass = bloodhoundcommunityedition

[BloodHound-CE]
bhce_enabled = True

[Empire]
api_host = 127.0.0.1
api_port = 1337
Expand Down
2 changes: 2 additions & 0 deletions nxc/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def initialize_db():
# Even if the default workspace exists, we still need to check if every protocol has a database (in case of a new protocol)
init_protocol_dbs("default")


def format_host_query(q, filter_term, HostsTable):
"""One annoying thing is that if you search for an ip such as '10.10.10.5',
it will return 10.10.10.5 and 10.10.10.52, so we have to check if its an ip address first
Expand Down Expand Up @@ -141,6 +142,7 @@ def format_host_query(q, filter_term, HostsTable):

return q


class BaseDB:
def __init__(self, db_engine):
self.db_engine = db_engine
Expand Down
1 change: 1 addition & 0 deletions nxc/helpers/args.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from argparse import ArgumentDefaultsHelpFormatter, SUPPRESS, OPTIONAL, ZERO_OR_MORE
from argparse import Action


class DisplayDefaultsNotNone(ArgumentDefaultsHelpFormatter):
def _get_help_string(self, action):
help_string = action.help
Expand Down
9 changes: 9 additions & 0 deletions nxc/helpers/even6_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from datetime import datetime


class Substitution:
def __init__(self, buf, offset):
(sub_token, sub_id, sub_type) = struct.unpack_from("<BHB", buf, offset)
Expand Down Expand Up @@ -46,6 +47,7 @@ def xml(self, template=None):
else:
print("Unknown value type", hex(value.type))


class Value:
def __init__(self, buf, offset):
token, string_type, length = struct.unpack_from("<BBH", buf, offset)
Expand All @@ -56,6 +58,7 @@ def __init__(self, buf, offset):
def xml(self, template=None):
return self._val


class Attribute:
def __init__(self, buf, offset):
struct.unpack_from("<B", buf, offset)
Expand All @@ -75,13 +78,15 @@ def xml(self, template=None):
val = self._value.xml(template)
return None if val is None else f'{self._name.val}="{val}"'


class Name:
def __init__(self, buf, offset):
hashs, length = struct.unpack_from("<HH", buf, offset)

self.val = buf[offset + 4:offset + 4 + length * 2].decode("utf16")
self.length = 4 + (length + 1) * 2


class Element:
def __init__(self, buf, offset):
token, dependency_id, length = struct.unpack_from("<BHI", buf, offset)
Expand Down Expand Up @@ -151,6 +156,7 @@ def xml(self, template=None):
children = (x.xml(template) for x in self._children)
return "<{}{}>{}</{}>".format(self._name.val, attrs, "".join(children), self._name.val)


class ValueSpec:
def __init__(self, buf, offset, value_offset):
self.length, self.type, value_eof = struct.unpack_from("<HBB", buf, offset)
Expand All @@ -159,6 +165,7 @@ def __init__(self, buf, offset, value_offset):
if self.type == 0x21:
self.template = BinXML(buf, value_offset)


class TemplateInstance:
def __init__(self, buf, offset):
token, unknown0, guid, length, next_token = struct.unpack_from("<BB16sIB", buf, offset)
Expand All @@ -179,6 +186,7 @@ def __init__(self, buf, offset):
def xml(self, template=None):
return self._xml.xml(self)


class BinXML:
def __init__(self, buf, offset):
header_token, major_version, minor_version, flags, next_token = struct.unpack_from("<BBBBB", buf, offset)
Expand All @@ -195,6 +203,7 @@ def __init__(self, buf, offset):
def xml(self, template=None):
return self._element.xml(template)


class ResultSet:
def __init__(self, buf):
total_size, header_size, event_offset, bookmark_offset, binxml_size = struct.unpack_from("<IIIII", buf)
Expand Down
73 changes: 71 additions & 2 deletions nxc/helpers/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import inspect
import os

from ipaddress import ip_address


def identify_target_file(target_file):
with open(target_file) as target_file_handle:
Expand All @@ -22,7 +24,7 @@ def gen_random_string(length=10):


def validate_ntlm(data):
allowed = re.compile("^[0-9a-f]{32}", re.IGNORECASE)
allowed = re.compile(r"^[0-9a-f]{32}", re.IGNORECASE)
return bool(allowed.match(data))


Expand All @@ -40,7 +42,7 @@ def called_from_cmd_args():
# Stolen from https://github.com/pydanny/whichcraft/
def which(cmd, mode=os.F_OK | os.X_OK, path=None):
"""Find the path which conforms to the given mode on the PATH for a command.

Given a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file.
`mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path.
Note: This function was backported from the Python 3 source code.
Expand Down Expand Up @@ -77,3 +79,70 @@ def _access_check(fn, mode):
name = os.path.join(p, thefile)
if _access_check(name, mode):
return name


def get_bloodhound_info():
"""
Detect which BloodHound package is installed (regular or CE) and its version.

Returns
-------
tuple: (package_name, version, is_ce)
- package_name: Name of the installed package ('bloodhound', 'bloodhound-ce', or None)
- version: Version string of the installed package (or None if not installed)
- is_ce: Boolean indicating if it's the Community Edition
"""
import importlib.metadata
import importlib.util

# First check if any BloodHound package is available to import
if importlib.util.find_spec("bloodhound") is None:
return None, None, False

# Try to get version info from both possible packages
version = None
package_name = None
is_ce = False

# Check for bloodhound-ce first
try:
version = importlib.metadata.version("bloodhound-ce")
package_name = "bloodhound-ce"
is_ce = True
except importlib.metadata.PackageNotFoundError:
# Check for regular bloodhound
try:
version = importlib.metadata.version("bloodhound")
package_name = "bloodhound"

# Even when installed as 'bloodhound', check if it's actually the CE version
if version and ("ce" in version.lower() or "community" in version.lower()):
is_ce = True
except importlib.metadata.PackageNotFoundError:
# No bloodhound package found via metadata
pass

# In case we can import it but metadata is not working, check the module itself
if not version:
try:
import bloodhound
version = getattr(bloodhound, "__version__", "unknown")
package_name = "bloodhound"

# Check if it's CE based on version string
if "ce" in version.lower() or "community" in version.lower():
is_ce = True
package_name = "bloodhound-ce"
except ImportError:
pass

return package_name, version, is_ce


def detect_if_ip(target):
try:
ip_address(target)
return True
except Exception:
return False

45 changes: 15 additions & 30 deletions nxc/helpers/pfx.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import secrets
import hashlib
import datetime
import logging
import random
import base64

Expand All @@ -47,8 +46,7 @@
from minikerberos.pkinit import PKINIT, DirtyDH
from minikerberos.protocol.constants import NAME_TYPE, PaDataType
from minikerberos.protocol.encryption import Enctype, _enctype_table, Key
from minikerberos.protocol.asn1_structs import KDC_REQ_BODY, PrincipalName, KDCOptions, EncASRepPart, AS_REQ, PADATA_TYPE, \
PA_PAC_REQUEST
from minikerberos.protocol.asn1_structs import KDC_REQ_BODY, PrincipalName, KDCOptions, EncASRepPart, AS_REQ, PADATA_TYPE, PA_PAC_REQUEST
from minikerberos.protocol.rfc4556 import PKAuthenticator, AuthPack, PA_PK_AS_REP, KDCDHKeyInfo, PA_PK_AS_REQ

from pyasn1.codec.der import decoder, encoder
Expand All @@ -70,6 +68,7 @@
from impacket.krb5.ccache import CCache as impacket_CCache

from nxc.paths import NXC_PATH
from nxc.logger import nxc_logger


class myPKINIT(PKINIT):
Expand Down Expand Up @@ -304,8 +303,8 @@ def truncate_key(value, keysize):

key = Key(cipher.enctype, t_key)
enc_data = as_rep["enc-part"]["cipher"]
logging.info("AS-REP encryption key (you might need this later):")
logging.info(hexlify(t_key).decode("utf-8"))
nxc_logger.info("AS-REP encryption key (you might need this later):")
nxc_logger.info(hexlify(t_key).decode("utf-8"))
dec_data = cipher.decrypt(key, 3, enc_data)
encasrep = EncASRepPart.load(dec_data).native
cipher = _enctype_table[int(encasrep["key"]["keytype"])]
Expand All @@ -327,34 +326,27 @@ def printPac(self, data, key=None):
for _bufferN in range(pacType["cBuffers"]):
infoBuffer = PAC_INFO_BUFFER(buff)
data = pacType["Buffers"][infoBuffer["Offset"] - 8:][:infoBuffer["cbBufferSize"]]
if logging.getLogger().level == logging.DEBUG:
print("TYPE 0x%x" % infoBuffer["ulType"])
nxc_logger.debug(f"TYPE 0x{infoBuffer['ulType']}")
if infoBuffer["ulType"] == 2:
found = True
credinfo = PAC_CREDENTIAL_INFO(data)
if logging.getLogger().level == logging.DEBUG:
credinfo.dump()
newCipher = _enctype_table[credinfo["EncryptionType"]]
out = newCipher.decrypt(key, 16, credinfo["SerializedData"])
type1 = TypeSerialization1(out)
# I'm skipping here 4 bytes with its the ReferentID for the pointer
newdata = out[len(type1) + 4:]
pcc = PAC_CREDENTIAL_DATA(newdata)
if logging.getLogger().level == logging.DEBUG:
pcc.dump()
for cred in pcc["Credentials"]:
credstruct = NTLM_SUPPLEMENTAL_CREDENTIAL(b"".join(cred["Credentials"]))
if logging.getLogger().level == logging.DEBUG:
credstruct.dump()

logging.info("Recovered NT Hash")
logging.info(hexlify(credstruct["NtPassword"]).decode("utf-8"))
nxc_logger.info("Recovered NT Hash")
nxc_logger.info(hexlify(credstruct["NtPassword"]).decode("utf-8"))
nthash = hexlify(credstruct["NtPassword"]).decode("utf-8")

buff = buff[len(infoBuffer):]

if not found:
logging.info("Did not find the PAC_CREDENTIAL_INFO in the PAC. Are you sure your TGT originated from a PKINIT operation?")
nxc_logger.info("Did not find the PAC_CREDENTIAL_INFO in the PAC. Are you sure your TGT originated from a PKINIT operation?")
return nthash

def __init__(self, username, domain, kdcHost, key, tgt):
Expand Down Expand Up @@ -399,10 +391,8 @@ def dump(self):
authenticator["cusec"] = now.microsecond
authenticator["ctime"] = KerberosTime.to_asn1(now)

if logging.getLogger().level == logging.DEBUG:
logging.debug("AUTHENTICATOR")
print(authenticator.prettyPrint())
print("\n")
nxc_logger.debug("AUTHENTICATOR")
nxc_logger.debug(authenticator.prettyPrint() + "\n")

encodedAuthenticator = encoder.encode(authenticator)

Expand Down Expand Up @@ -452,23 +442,18 @@ def dump(self):

myTicket = ticket.to_asn1(TicketAsn1())
seq_set_iter(reqBody, "additional-tickets", (myTicket,))
if logging.getLogger().level == logging.DEBUG:
logging.debug("Final TGS")
print(tgsReq.prettyPrint())
if logging.getLogger().level == logging.DEBUG:
logging.debug("Final TGS")
print(tgsReq.prettyPrint())
nxc_logger.debug("Final TGS")
nxc_logger.debug(tgsReq.prettyPrint())

message = encoder.encode(tgsReq)
logging.info("Requesting ticket to self with PAC")
nxc_logger.info("Requesting ticket to self with PAC")

r = sendReceive(message, self.__domain, self.__kdcHost)

tgs = decoder.decode(r, asn1Spec=TGS_REP())[0]

if logging.getLogger().level == logging.DEBUG:
logging.debug("TGS_REP")
print(tgs.prettyPrint())
nxc_logger.debug("TGS_REP")
nxc_logger.debug(tgs.prettyPrint())

cipherText = tgs["ticket"]["enc-part"]["cipher"]

Expand Down
Loading