Skip to content

Commit a79680a

Browse files
committed
Add timestamp to save file
1 parent 6c148c6 commit a79680a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

nxc/modules/putty.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from datetime import datetime
12
from io import BytesIO
23
import traceback
34
from urllib.parse import unquote
@@ -154,7 +155,7 @@ def extract_session(self, sessions):
154155
makedirs(f"{NXC_PATH}/modules/PuTTY", exist_ok=True)
155156
share = session["private_key_path"].split(":")[0] + "$"
156157
file_path = session["private_key_path"].split(":")[1]
157-
download_path = f"{NXC_PATH}/modules/PuTTY/putty_{session['user']}_{session['session_name']}.sec"
158+
download_path = f"{NXC_PATH}/modules/PuTTY/putty_{session['user']}_{session['session_name']}_{datetime.now().strftime('%Y-%m-%d_%H%M%S')}.sec".replace(":", "-")
158159

159160
buf = BytesIO()
160161
with open(download_path, "wb") as file:

0 commit comments

Comments
 (0)