Skip to content

Commit 5101a96

Browse files
committed
Replace config paths with variable and formatting
1 parent 029ec26 commit 5101a96

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

nxc/modules/enum_dns.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from nxc.helpers.logger import write_log
33
from nxc.paths import NXC_PATH
44

5+
56
class NXCModule:
67
"""
78
Uses WMI to dump DNS from an AD DNS Server.
@@ -34,7 +35,7 @@ def on_admin_login(self, context, connection):
3435
else:
3536
domains = [self.domains]
3637
data = ""
37-
38+
3839
for domain in domains:
3940
output = connection.wmi(
4041
f"Select TextRepresentation FROM MicrosoftDNS_ResourceRecord WHERE DomainName = {domain}",

nxc/netexec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from nxc.loaders.protocolloader import ProtocolLoader
1010
from nxc.loaders.moduleloader import ModuleLoader
1111
from nxc.first_run import first_run_setup
12-
from nxc.paths import NXC_PATH, WORKSPACE_DIR
12+
from nxc.paths import CONFIG_PATH, NXC_PATH, WORKSPACE_DIR
1313
from nxc.console import nxc_console
1414
from nxc.logger import nxc_logger
1515
from nxc.config import nxc_config, nxc_workspace, config_log, ignore_opsec
@@ -195,7 +195,7 @@ def main():
195195
nxc_logger.debug("ignore_opsec is set in the configuration, skipping prompt")
196196
nxc_logger.display("Ignore OPSEC in configuration is set and OPSEC unsafe module loaded")
197197
else:
198-
ans = input(highlight("[!] Module is not opsec safe, are you sure you want to run this? [Y/n] For global configuration, change ignore_opsec value to True on ~/nxc/nxc.conf", "red"))
198+
ans = input(highlight(f"[!] Module is not opsec safe, are you sure you want to run this? [Y/n] For global configuration, change ignore_opsec value to True on {CONFIG_PATH}", "red"))
199199
if ans.lower() not in ["y", "yes", ""]:
200200
exit(1)
201201

nxc/protocols/ldap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
from nxc.parsers.ldap_results import parse_result_attributes
4545
from nxc.helpers.ntlm_parser import parse_challenge
4646
from nxc.helpers.misc import get_bloodhound_info
47-
from nxc.paths import NXC_PATH
47+
from nxc.paths import CONFIG_PATH, NXC_PATH
4848

4949
ldap_error_status = {
5050
"1": "STATUS_NOT_SUPPORTED",
@@ -1355,7 +1355,7 @@ def bloodhound(self):
13551355

13561356
if use_bhce and not is_ce:
13571357
self.logger.fail("⚠️ Configuration Issue Detected ⚠️")
1358-
self.logger.fail("Your configuration has BloodHound-CE enabled, but the regular BloodHound package is installed. Modify your ~/.nxc/nxc.conf config file or follow the instructions:")
1358+
self.logger.fail(f"Your configuration has BloodHound-CE enabled, but the regular BloodHound package is installed. Modify your {CONFIG_PATH} config file or follow the instructions:")
13591359
self.logger.fail("Please run the following commands to fix this:")
13601360
self.logger.fail("poetry remove bloodhound-ce # poetry falsely recognizes bloodhound-ce as a the old bloodhound package")
13611361
self.logger.fail("poetry add bloodhound-ce")

nxc/protocols/rdp.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
from nxc.connection import connection
1010
from nxc.helpers.bloodhound import add_user_bh
1111
from nxc.logger import NXCAdapter
12-
from nxc.config import host_info_colors
13-
from nxc.config import process_secret
12+
from nxc.config import host_info_colors, process_secret
1413
from nxc.paths import NXC_PATH
1514

1615
from aardwolf.connection import RDPConnection

0 commit comments

Comments
 (0)