Skip to content

Commit eadd3a1

Browse files
fix ruff errors
1 parent ecbbb9a commit eadd3a1

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

nxc/modules/coerce_plus.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
from impacket import uuid
21
from impacket.dcerpc.v5 import transport, rprn, even, epm
32
from impacket.dcerpc.v5.ndr import NDRCALL, NDRSTRUCT, NDRPOINTER, NDRUniConformantArray, NDRPOINTERNULL
43
from impacket.dcerpc.v5.dtypes import LPBYTE, USHORT, LPWSTR, DWORD, ULONG, NULL, WSTR, LONG, BOOL, PCHAR, RPC_SID
54
from impacket.dcerpc.v5.rpcrt import RPC_C_AUTHN_GSS_NEGOTIATE, RPC_C_AUTHN_LEVEL_PKT_PRIVACY
65

76
from impacket.uuid import uuidtup_to_bin
7+
import contextlib
88

99

1010
def get_dynamic_endpoint(interface: bytes, target: str, timeout: int = 5) -> str:
@@ -13,8 +13,8 @@ def get_dynamic_endpoint(interface: bytes, target: str, timeout: int = 5) -> str
1313
rpctransport.set_connect_timeout(timeout)
1414
dce = rpctransport.get_dce_rpc()
1515
dce.connect()
16-
endpoint = epm.hept_map(target, interface, protocol="ncacn_ip_tcp", dce=dce)
17-
return endpoint
16+
return epm.hept_map(target, interface, protocol="ncacn_ip_tcp", dce=dce)
17+
1818

1919
class NXCModule:
2020
name = "coerce_plus"
@@ -539,10 +539,8 @@ def connect(self, username, password, domain, lmhash, nthash, aesKey, target, do
539539

540540
# activates EFS
541541
# https://specterops.io/blog/2025/08/19/will-webclient-start/
542-
try:
542+
with contextlib.suppress(Exception):
543543
get_dynamic_endpoint(uuidtup_to_bin(("df1941c5-fe89-4e79-bf10-463657acf44d", "0.0")), target, timeout=1)
544-
except:
545-
pass
546544

547545
rpctransport = transport.DCERPCTransportFactory(binding_params[pipe]["stringBinding"])
548546
rpctransport.set_dport(445)

nxc/modules/efsr_spray.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import ntpath
21
from nxc.context import Context
32

3+
44
class NXCModule:
55
name = "efsr_spray"
66
description = "[REMOVED] Tries to activate the EFSR service by creating a file with the encryption attribute on some available share."
@@ -13,7 +13,6 @@ def options(self, context: Context, module_options: dict[str, str]):
1313
SHARE_NAME If set, ONLY this share will be used
1414
EXCLUDED_SHARES List of share names which will not be used, seperated by comma
1515
"""
16-
pass
1716

1817
def on_login(self, context: Context, connection):
1918
context.log.fail('[REMOVED] This module has been made obsolete and EFS will be activated automatically by "coerce_plus"')

0 commit comments

Comments
 (0)