Skip to content

Commit 75e9316

Browse files
authored
Merge pull request Pennyw0rth#242 from Pennyw0rth/neff-qol
Neff qol the second
2 parents 01c4a44 + 59a201a commit 75e9316

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

nxc/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def gen_cli_args():
3636
{highlight('Codename', 'red')}: {highlight(CODENAME)}
3737
""", formatter_class=RawTextHelpFormatter)
3838

39-
parser.add_argument("-t", type=int, dest="threads", default=100, help="set how many concurrent threads to use (default: 100)")
39+
parser.add_argument("-t", type=int, dest="threads", default=256, help="set how many concurrent threads to use (default: 256)")
4040
parser.add_argument("--timeout", default=None, type=int, help="max timeout in seconds of each thread (default: None)")
4141
parser.add_argument("--jitter", metavar="INTERVAL", type=str, help="sets a random delay between each connection (default: None)")
4242
parser.add_argument("--no-progress", action="store_true", help="Not displaying progress bar during scan")

nxc/connection.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ def __init__(self, args, db, host):
121121
try:
122122
self.proto_flow()
123123
except Exception as e:
124-
self.logger.exception(f"Exception while calling proto_flow() on target {self.host}: {e}")
124+
if "ERROR_DEPENDENT_SERVICES_RUNNING" in str(e):
125+
self.logger.error(f"Exception while calling proto_flow() on target {self.host}: {e}")
126+
else:
127+
self.logger.exception(f"Exception while calling proto_flow() on target {self.host}: {e}")
125128

126129
@staticmethod
127130
def proto_args(std_parser, module_parser):

nxc/netexec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ async def start_run(protocol_obj, args, db, targets):
4242
futures = []
4343
nxc_logger.debug("Creating ThreadPoolExecutor")
4444
if args.no_progress or len(targets) == 1:
45-
with ThreadPoolExecutor(max_workers=args.threads + 1) as executor:
45+
with ThreadPoolExecutor(max_workers=args.threads) as executor:
4646
nxc_logger.debug(f"Creating thread for {protocol_obj}")
4747
futures = [executor.submit(protocol_obj, args, db, target) for target in targets]
4848
else:
49-
with Progress(console=nxc_console) as progress, ThreadPoolExecutor(max_workers=args.threads + 1) as executor:
49+
with Progress(console=nxc_console) as progress, ThreadPoolExecutor(max_workers=args.threads) as executor:
5050
current = 0
5151
total = len(targets)
5252
tasks = progress.add_task(

0 commit comments

Comments
 (0)