From a79680aeffebc53dea65bbce2f7e7eb1835025ca Mon Sep 17 00:00:00 2001 From: Alexander Neff Date: Tue, 14 May 2024 19:39:42 -0400 Subject: [PATCH] Add timestamp to save file --- nxc/modules/putty.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nxc/modules/putty.py b/nxc/modules/putty.py index 441cd502..8339cada 100644 --- a/nxc/modules/putty.py +++ b/nxc/modules/putty.py @@ -1,3 +1,4 @@ +from datetime import datetime from io import BytesIO import traceback from urllib.parse import unquote @@ -154,7 +155,7 @@ class NXCModule: makedirs(f"{NXC_PATH}/modules/PuTTY", exist_ok=True) share = session["private_key_path"].split(":")[0] + "$" file_path = session["private_key_path"].split(":")[1] - download_path = f"{NXC_PATH}/modules/PuTTY/putty_{session['user']}_{session['session_name']}.sec" + download_path = f"{NXC_PATH}/modules/PuTTY/putty_{session['user']}_{session['session_name']}_{datetime.now().strftime('%Y-%m-%d_%H%M%S')}.sec".replace(":", "-") buf = BytesIO() with open(download_path, "wb") as file: