|
14 | 14 | from OpenSSL.SSL import SysCallError |
15 | 15 | from bloodhound.ad.authentication import ADAuthentication |
16 | 16 | from bloodhound.ad.domain import AD |
17 | | -from impacket.dcerpc.v5.epm import MSRPC_UUID_PORTMAP |
18 | | -from impacket.dcerpc.v5.rpcrt import DCERPCException, RPC_C_AUTHN_GSS_NEGOTIATE |
19 | 17 | from impacket.dcerpc.v5.samr import ( |
20 | 18 | UF_ACCOUNTDISABLE, |
21 | 19 | UF_DONT_REQUIRE_PREAUTH, |
22 | 20 | UF_TRUSTED_FOR_DELEGATION, |
23 | 21 | UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION, |
24 | 22 | UF_SERVER_TRUST_ACCOUNT, |
25 | 23 | ) |
26 | | -from impacket.dcerpc.v5.transport import DCERPCTransportFactory |
27 | 24 | from impacket.krb5 import constants |
28 | 25 | from impacket.krb5.kerberosv5 import getKerberosTGS, SessionKeyDecryptionError |
29 | 26 | from impacket.krb5.types import Principal, KerberosException |
30 | 27 | from impacket.ldap import ldap as ldap_impacket |
31 | 28 | from impacket.ldap import ldaptypes |
32 | 29 | from impacket.ldap import ldapasn1 as ldapasn1_impacket |
33 | 30 | from impacket.ldap.ldap import LDAPFilterSyntaxError |
34 | | -from impacket.smbconnection import SMBConnection, SessionError |
| 31 | +from impacket.smbconnection import SessionError |
35 | 32 | from impacket.ntlm import getNTLMSSPType1 |
36 | 33 |
|
37 | 34 | from nxc.config import process_secret, host_info_colors |
@@ -238,13 +235,13 @@ def enum_host_info(self): |
238 | 235 |
|
239 | 236 | ntlm_challenge = None |
240 | 237 | bindRequest = ldapasn1_impacket.BindRequest() |
241 | | - bindRequest['version'] = 3 |
242 | | - bindRequest['name'] = "" |
| 238 | + bindRequest["version"] = 3 |
| 239 | + bindRequest["name"] = "" |
243 | 240 | negotiate = getNTLMSSPType1() |
244 | | - bindRequest['authentication']['sicilyNegotiate'] = negotiate.getData() |
| 241 | + bindRequest["authentication"]["sicilyNegotiate"] = negotiate.getData() |
245 | 242 | try: |
246 | | - response = self.ldap_connection.sendReceive(bindRequest)[0]['protocolOp'] |
247 | | - ntlm_challenge = bytes(response['bindResponse']['matchedDN']) |
| 243 | + response = self.ldap_connection.sendReceive(bindRequest)[0]["protocolOp"] |
| 244 | + ntlm_challenge = bytes(response["bindResponse"]["matchedDN"]) |
248 | 245 | except Exception as e: |
249 | 246 | self.logger.debug(f"Failed to get target {self.host} ntlm challenge, error: {e!s}") |
250 | 247 |
|
|
0 commit comments