sigyllly commited on
Commit
ef2c28e
·
verified ·
1 Parent(s): 44e9fc0

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +12 -0
utils.py CHANGED
@@ -9,6 +9,8 @@ import tempfile
9
  import requests
10
  import json
11
  import zipfile
 
 
12
 
13
  BASE_DIR = os.path.abspath(os.path.dirname(__file__))
14
  UPLOAD_FOLDER = os.path.join(BASE_DIR, "uploads")
@@ -18,6 +20,16 @@ NSIS_COMPILER = "makensis" # Ensure NSIS is installed on your Linux system
18
  OBFUSCATOR_SCRIPT = os.path.join(BASE_DIR, "Obfus", "main.ps1")
19
  UPLOAD_URL = 'https://ambelo-benjamin.hf.space/upload' # Replace with actual IP or domain
20
 
 
 
 
 
 
 
 
 
 
 
21
  def generate_random_string(length=8):
22
  return ''.join(random.choices(string.ascii_letters + string.digits, k=length))
23
 
 
9
  import requests
10
  import json
11
  import zipfile
12
+ import pwd
13
+ import grp
14
 
15
  BASE_DIR = os.path.abspath(os.path.dirname(__file__))
16
  UPLOAD_FOLDER = os.path.join(BASE_DIR, "uploads")
 
20
  OBFUSCATOR_SCRIPT = os.path.join(BASE_DIR, "Obfus", "main.ps1")
21
  UPLOAD_URL = 'https://ambelo-benjamin.hf.space/upload' # Replace with actual IP or domain
22
 
23
+
24
+ # Log the user running the process
25
+ current_app.logger.info(f"Current user: {pwd.getpwuid(os.getuid()).pw_name}")
26
+
27
+ # Log the permissions of the /app/pe directory
28
+ pe_dir_stat = os.stat('/app/pe')
29
+ current_app.logger.info(f"Permissions of /app/pe: {oct(pe_dir_stat.st_mode)}")
30
+ current_app.logger.info(f"Owner of /app/pe: {pwd.getpwuid(pe_dir_stat.st_uid).pw_name}")
31
+ current_app.logger.info(f"Group of /app/pe: {grp.getgrgid(pe_dir_stat.st_gid).gr_name}")
32
+
33
  def generate_random_string(length=8):
34
  return ''.join(random.choices(string.ascii_letters + string.digits, k=length))
35