Skip to content

Commit bb788a4

Browse files
committed
Autofix ruff whitepsaces
1 parent 21f6031 commit bb788a4

49 files changed

Lines changed: 101 additions & 102 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

nxc/database.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def initialize_db():
110110

111111
# Even if the default workspace exists, we still need to check if every protocol has a database (in case of a new protocol)
112112
init_protocol_dbs("default")
113-
113+
114114

115115
def format_host_query(q, filter_term, HostsTable):
116116
"""One annoying thing is that if you search for an ip such as '10.10.10.5',
@@ -127,16 +127,16 @@ def format_host_query(q, filter_term, HostsTable):
127127
else:
128128
nxc_logger.debug("Neither 'ip' nor 'host' columns found in the table")
129129
return q
130-
131-
# first we check if its an ip address
130+
131+
# first we check if its an ip address
132132
try:
133133
ipaddress.ip_address(filter_term)
134134
nxc_logger.debug(f"filter_term is an IP address: {filter_term}")
135135
q = q.filter(ip_column == filter_term)
136136
except ValueError:
137137
nxc_logger.debug(f"filter_term is not an IP address: {filter_term}")
138138
like_term = func.lower(f"%{filter_term}%")
139-
139+
140140
# check if the hostname column exists for hostname searching
141141
q = q.filter(ip_column.like(like_term) | func.lower(HostsTable.c.hostname).like(like_term)) if hasattr(HostsTable.c, "hostname") else q.filter(ip_column.like(like_term))
142142

nxc/helpers/even6_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ def xml(self, template=None):
145145
return ""
146146

147147
attrs = filter(lambda x: x is not None, (x.xml(template) for x in self._attributes))
148-
148+
149149
attrs = " ".join(attrs)
150150
if len(attrs) > 0:
151151
attrs = " " + attrs
152-
152+
153153
if self._empty:
154154
return f"<{self._name.val}{attrs}/>"
155155
else:

nxc/helpers/misc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,3 @@ def detect_if_ip(target):
145145
return True
146146
except Exception:
147147
return False
148-

nxc/helpers/ntlm_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ def parse_challenge(challange):
3131
target_info["os_version"] = f"{WIN_VERSIONS[product_build]} Build {product_build}"
3232
else:
3333
target_info["os_version"] = f"{major_version}.{minor_version} Build {product_build}"
34-
return target_info
34+
return target_info

nxc/modules/add-computer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def on_login(self, context, connection):
8686
# If SAMR fails now try over LDAPS
8787
if not self.noLDAPRequired:
8888
self.do_ldaps_add(connection, context)
89-
89+
9090
def do_samr_add(self, context):
9191
"""
9292
Connects to a target server and performs various operations related to adding or deleting machine accounts.

nxc/modules/bitlocker.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ def check_bitlocker_status(self):
4343
try:
4444
# Executing the PowerShell command to get BitLocker volumes status.
4545
check_bitlocker_command_str_output = self.connection.execute(check_bitlocker_command_str, True)
46-
46+
4747
if "'Get-BitLockerVolume' is not recognized" in check_bitlocker_command_str_output:
4848
self.context.log.fail("BitLockerVolume not found on target.")
4949
return
5050

5151
# Splitting the output into lines.
5252
lines = str(check_bitlocker_command_str_output).splitlines()
5353
data_lines = [line for line in lines if re.match(r"\w:", line)]
54-
54+
5555
for line in data_lines:
5656
# Checking every line for starting with drive
57-
if line[1] == ":":
57+
if line[1] == ":":
5858
parts = line.split()
5959
MountPoint, EncryptionMethod, protection_status = parts[0], parts[1], parts[2]
6060

@@ -85,15 +85,15 @@ def check_bitlocker_status(self):
8585
oxidResolver=True,
8686
doKerberos=self.connection.kerberos,
8787
kdcHost=self.connection.kdcHost)
88-
88+
8989
try:
9090
# CoCreateInstanceEx for WMI login
9191
i_interface = dcom_conn.CoCreateInstanceEx(wmi.CLSID_WbemLevel1Login, wmi.IID_IWbemLevel1Login)
9292
iWbemLevel1Login = wmi.IWbemLevel1Login(i_interface)
9393

9494
# Specify the namespace for BitLocker
9595
bitlockerNamespace = "root\\CIMv2\\Security\\MicrosoftVolumeEncryption"
96-
96+
9797
# NTLM login for WMI
9898
iWbemServices = iWbemLevel1Login.NTLMLogin(bitlockerNamespace, NULL, NULL)
9999

@@ -113,7 +113,7 @@ def check_bitlocker_status(self):
113113
6: "XTS_AES_128",
114114
7: "XTS_AES_256_WITH_DIFFUSER"
115115
}
116-
116+
117117
try:
118118
while True:
119119
iWbemClassObject = iEnumWbemClassObject.Next(0xffffffff, 1)

nxc/modules/daclread.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def options(self, context, module_options):
269269

270270
if "ACE_TYPE" in module_options:
271271
self.ace_type = module_options["ACE_TYPE"]
272-
272+
273273
if "RIGHTS" in module_options:
274274
self.rights = module_options["RIGHTS"]
275275

nxc/modules/dfscoerce.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ def options(self, context, module_options):
1515
self.listener = module_options["LISTENER"]
1616

1717
def on_login(self, context, connection):
18-
context.log.fail('[REMOVED] This module moved to the new module "coerce_plus"')
18+
context.log.fail('[REMOVED] This module moved to the new module "coerce_plus"')

nxc/modules/dpapi_hash.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ def on_admin_login(self, context, connection):
3434
no_pass=True,
3535
use_kcache=getattr(connection, "use_kcache", False),
3636
)
37-
37+
3838
conn = upgrade_to_dploot_connection(connection=connection.conn, target=target)
3939
if conn is None:
4040
context.log.debug("Could not upgrade connection")
4141
return
42-
42+
4343
try:
4444
context.log.display("Collecting DPAPI masterkeys, grab a coffee and be patient...")
4545
masterkeys_triage = MasterkeysTriage(
@@ -57,6 +57,6 @@ def on_admin_login(self, context, connection):
5757
else:
5858
for mkhash in [mkhash for masterkey in masterkeys_triage.all_looted_masterkeys for mkhash in masterkey.generate_hash()]:
5959
context.log.highlight(mkhash)
60-
60+
6161
except Exception as e:
62-
context.log.debug(f"Could not get masterkeys: {e}")
62+
context.log.debug(f"Could not get masterkeys: {e}")

nxc/modules/enum_av.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def LsarLookupNames(self, dce, policyHandle, service):
376376
{"name": "masvc", "description": "Trellix Agent Service"},
377377
{"name": "macmnsvc", "description": "Trellix Agent Common Service"},
378378
{"name": "mfetp", "description": "Trellix Endpoint Threat Prevention Service"},
379-
{"name": "mfewc", "description": "Trellix Endpoint Security Web Control Service"},
379+
{"name": "mfewc", "description": "Trellix Endpoint Security Web Control Service"},
380380
{"name": "mfeaack", "description": "Trellix Anti-Malware Core Service"}
381381
],
382382
"pipes": [

0 commit comments

Comments
 (0)